텍스트 → 이미지
POST/v1/images
텍스트 프롬프트로 이미지를 생성하며, 최대 4장의 레퍼런스 이미지로 결과를 유도할 수 있습니다.
파라미터
| 파라미터 | 설명 |
|---|---|
| prompt필수 string | 이미지 프롬프트. 최대 5,000자. |
| model선택 string | 사용할 이미지 모델 — 예: nano-banana, gpt-image-2. 생략하면 기본값. 목록: GET /v1/models?category=image. |
| aspectRatio선택 string | 예: 1:1, 16:9, 9:16. 지원되는 비율은 모델마다 다릅니다 — GET /v1/models의 supportedAspectRatios를 참고하세요. |
| referenceImages선택 string[] | 시각적 가이드로 사용할 이미지 URL 최대 4개. 로컬 파일은 multipart referenceFiles 파트에 넣습니다(각 ≤20 MB). 레퍼런스 편집에는 nano-banana를 권장합니다. |
요청
요청
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"