Nano Banana 2
Nano Banana 2
Next-generation image generation and editing with Google Search grounding, up to 14 reference images, and 4K output
- Endpoint
- POST /api/v1/images/generate
- model
- nano-banana-2
- Output
- Image
- Credits
- from 7
작업 제출
/api/v1/images/generate매개변수
modelstring필수Must be "nano-banana-2"
typestring선택 사항기본값text-to-image"text-to-image" or "image-to-image" (default: text-to-image)
text-to-imageimage-to-imagepromptstring필수Text description of the image to generate. Supports up to 20,000 characters.
resolutionstring선택 사항기본값1K"1K", "2K", or "4K" (default: 1K)
1K2K4Kaspect_ratiostring선택 사항"auto", "1:1", "16:9", "9:16", "4:3", "3:4", "1:4", "1:8", "4:1", "8:1", "21:9"
auto1:116:99:164:33:41:41:84:18:121:9image_urlsstring[]선택 사항Input image URLs or base64 for image-to-image. Supports up to 14 images.
input_imagestring선택 사항Deprecated. Alias for image_urls[0]
google_searchboolean선택 사항Enable Google Search grounding for real-time information
truefalsegoogle_image_searchboolean선택 사항Enable image search grounding. Requires google_search=true.
truefalseoutput_formatstring선택 사항기본값jpg"jpg" or "png" (default: jpg)
jpgpngnum_imagesnumber선택 사항Must be 1
요청
curl -X POST https://www.bananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2",
"prompt": "A cinematic product photo of a transparent smart speaker on a glass table",
"resolution": "2K",
"aspect_ratio": "16:9"
}'응답200
{
"success": true,
"data": {
"task_id": "task_nb2_abc123",
"credits_used": 11,
"remaining_credits": 489,
"model": "nano-banana-2"
}
}예시의 credits_used 값은 참고용입니다. 실제 사용량은 제출 시 계산되어 API가 반환합니다.
작업 조회
/api/v1/images/{task_id}status
pending- Accepted and waiting to start. Keep polling.
processing- Running. Keep polling.
completed- Finished. Read image_url; output holds the full result.
failed- Ended without a result. error_message says why and credits_refunded shows what was returned.
Poll every 5 to 10 seconds and stop at completed or failed, or register a webhook to be notified instead. Failed tasks are refunded automatically.
요청
curl https://www.bananapro.site/api/v1/images/task_abc123 \
-H "Authorization: Bearer sk-your-api-key"응답200
{
"success": true,
"data": {
"task_id": "task_abc123",
"model": "nano-banana-2",
"status": "completed",
"output": { "images": [{ "url": "https://..." }] },
"primary_url": "https://...",
"image_url": "https://...",
"error_message": null,
"credits_used": 11,
"credits_refunded": 0,
"created_at": "2026-10-04T10:00:00.000Z",
"updated_at": "2026-10-04T10:01:12.000Z",
"completed_at": "2026-10-04T10:01:12.000Z"
},
"request_id": "req_abc123"
}결과 기다리기
TASK_ID=task_abc123
while true; do
TASK=$(curl -s https://www.bananapro.site/api/v1/images/$TASK_ID \
-H "Authorization: Bearer sk-your-api-key")
STATUS=$(echo "$TASK" | jq -r '.data.status')
if [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ]; then
echo "$TASK" | jq
break
fi
sleep 10
done요금제
| Resolution | Credits |
|---|---|
| 1K | 7 |
| 2K | 11 |
| 4K | 15 |
기능
- Text-to-image generation
- Image-to-image transformation
- Google Search grounding
- Up to 14 reference images
- Extreme aspect ratios and up to 4K resolution