텍스트 → 이미지
POST/v1/images
텍스트 프롬프트로 이미지를 생성하며, 최대 4장의 레퍼런스 이미지로 결과를 유도할 수 있습니다.
파라미터
| 파라미터 | 설명 |
|---|---|
| promptREQ string | 이미지 프롬프트. 최대 5,000자. |
| model string | 예: nano-banana, gpt-image-2. 생략하면 기본값. |
| aspectRatio string | 예: 1:1, 16:9. 모델별로 다릅니다. |
| referenceImages string[] | 이미지 URL 최대 4개(또는 multipart로 referenceFiles 업로드). |
요청
요청
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;응답
응답 · 200
{ "success": true, "data": { "id": "019…", "taskStatus": 0, "type": "image" } }taskStatus가 2가 될 때까지 GET /v1/assets/{id}를 폴링하세요. 이미지 URL은 files.image에 담깁니다.
참조 이미지 (로컬 파일)
호스팅된 referenceImages URL 대신 multipart/form-data로 최대 4개의 referenceFiles 파트(각 ≤20 MB)를 보낼 수 있습니다 — 나머지 필드는 폼 필드가 됩니다.
curl -X POST https://api.picoberry.ai/v1/images \
-H "Authorization: Bearer pb_live_xxx" \
-F "prompt=a low-poly wooden barrel" -F "model=nano-banana" \
-F "referenceFiles=@./ref1.png" -F "referenceFiles=@./ref2.png"