POST
/api/v1/nanobananapro/generateGenerate Image (Pro)
High-quality 4K image generation using Gemini 3 Pro. Supports up to 14 reference images.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | The text prompt describing the image |
imageSize | string | No | "1K", "2K", or "4K". Default: "1K". 4K costs 2x. |
useGoogleSearch | boolean | No | Enable grounding with real-time search. |
callbackUrl | string | No | Webhook URL for async callback mode. Returns 202 immediately. |
temperature | number | No | Controls randomness (0-2). Recommended: 1.0 for image generation. |
thinkingConfig | object | No | Enables reasoning pass for better reference adherence. Example: {"includeThoughts": true} |
mediaResolution | string | No | Input image fidelity: "MEDIA_RESOLUTION_LOW", "MEDIA_RESOLUTION_MEDIUM", or "MEDIA_RESOLUTION_HIGH". |
responseModalities | array | No | Response types. Default: ["TEXT", "IMAGE"]. |
safetySettings | array | No | Safety filter thresholds. Allowed thresholds: BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH. |
Image Sizes & Pricing
| Image Size | Cost per Image |
|---|---|
| 1K (default) | $0.09 |
| 2K | $0.09 |
| 4K | $0.175 |
Supported Aspect Ratios
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Async Mode (Recommended)
Recommended for production
Image generation can take 15-90+ seconds. Use async mode with callbackUrl or job polling to avoid timeouts. The API returns a 202 response instantly, and results are delivered via webhook or the job status endpoint.
bash
curl -X POST https://eccoapi.com/api/v1/nanobananapro/generate \
-H "Authorization: Bearer nk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Ultra detailed mountain landscape at golden hour",
"aspectRatio": "16:9",
"imageSize": "4K",
"callbackUrl": "https://your-server.com/webhook"
}'Returns 202 Accepted with a jobId. Poll /api/v1/jobs/:jobId for status, or receive the result at your callbackUrl.
Sync Request
Sync mode waits for the image and returns it directly. Best for quick generations under 60 seconds.
bash
curl -X POST https://eccoapi.com/api/v1/nanobananapro/generate \
-H "Authorization: Bearer nk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Ultra detailed mountain landscape at golden hour",
"aspectRatio": "16:9",
"imageSize": "4K",
"useGoogleSearch": false
}'Response
json
{
"code": 200,
"msg": "Success",
"data": {
"assetUrl": "https://<signed-url>",
"candidates": [{
"content": {
"parts": [{
"inlineData": {
"mimeType": "image/png",
"assetUrl": "https://<signed-url>",
"assetKey": "user/<userId>/nanobananapro/....png"
}
}]
}
}]
},
"meta": {
"model": "nanobananapro",
"cost": 0.175,
"remaining_credits": 9.825,
"settings": {
"aspectRatio": "16:9",
"imageSize": "4K"
}
}
}