Text → Image
POST/v1/images
Generate an image from a text prompt, optionally guided by up to four reference images.
Parameters
| Parameter | Description |
|---|---|
| promptREQ string | The image prompt. Up to 5,000 characters. |
| model string | e.g. nano-banana, gpt-image-2. Omit for the default. |
| aspectRatio string | e.g. 1:1, 16:9. Per-model. |
| referenceImages string[] | Up to 4 image URLs (or upload referenceFiles via multipart). |
Request
request
curl -X POST https://api.picoberry.ai/v1/images \
-H "Authorization: Bearer pb_live_xxx" \
-H "Content-Type: application/json" \
-d '{"prompt":"a low-poly wooden barrel","model":"nano-banana","aspectRatio":"1:1"}'r = requests.post("https://api.picoberry.ai/v1/images", headers=headers,
json={"prompt": "a low-poly wooden barrel", "model": "nano-banana"})
asset_id = r.json()["data"]["id"]const res = await fetch(`${BASE}/v1/images`, {
method: "POST", headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ prompt: "a low-poly wooden barrel", model: "nano-banana" }),
});
const { id } = (await res.json()).data;Response
response · 200
{ "success": true, "data": { "id": "019…", "taskStatus": 0, "type": "image" } }Poll GET /v1/assets/{id} until taskStatus is 2; the image URL lands in files.image.