EccoAPIeccoapi
POST/api/v1/nanobananapro/generate

Generate Image (Pro)

High-quality 4K image generation using Gemini 3 Pro. Supports up to 14 reference images.

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe text prompt describing the image
imageSizestringNo"1K", "2K", or "4K". Default: "1K". 4K costs 2x.
useGoogleSearchbooleanNoEnable grounding with real-time search.
callbackUrlstringNoWebhook URL for async callback mode. Returns 202 immediately.
temperaturenumberNoControls randomness (0-2). Recommended: 1.0 for image generation.
thinkingConfigobjectNoEnables reasoning pass for better reference adherence. Example: {"includeThoughts": true}
mediaResolutionstringNoInput image fidelity: "MEDIA_RESOLUTION_LOW", "MEDIA_RESOLUTION_MEDIUM", or "MEDIA_RESOLUTION_HIGH".
responseModalitiesarrayNoResponse types. Default: ["TEXT", "IMAGE"].
safetySettingsarrayNoSafety filter thresholds. Allowed thresholds: BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH.

Image Sizes & Pricing

Image SizeCost 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"
    }
  }
}