Skip to content
All API documentation

Nano Banana 2 API

Account and deployment availability

Requires eligible legacy billing or expanded USD generation, plus a configured provider.

For expanded USD generation, use the resolutions listed for your account and keep the signed quote intact.

Call GET /api/v1/models with your API key to see the models and options available to your account.

Request fields

modelPreset
gemini-3-1-flash-image
Provider
apimart
mode
text-to-image, image-to-image
aspectRatio
auto, 1:1, 3:2, 2:3, 16:9, 9:16, 4:3, 3:4, 5:4, 4:5, 21:9, 1:4, 4:1, 1:8, 8:1
resolution
1k, 2k, 4k
Expanded USD image resolutions
1k, 2k, 4k
referenceAssetIds
0 · 1–10
Maximum outputs by resolution
1k → 4, 2k → 4, 4k → 4
Prompt limit
5000

Use an empty referenceAssetIds array for text-to-image. For image-to-image, use distinct IDs from your own account. Legacy accounts without active membership are limited to 1k and may have lower output limits.

Quote examples

Replace any REPLACE_WITH_* asset IDs with IDs returned by your own completed uploads. Send the draft to the quote endpoint. Upload a reference

text-to-image

curl --fail-with-body "$GAPTI_ORIGIN/api/v1/quotes" \
  -H "Authorization: Bearer $GAPTI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "draft": {
    "kind": "image",
    "modelPreset": "gemini-3-1-flash-image",
    "mode": "text-to-image",
    "prompt": "Photograph a yellow ceramic mug on a pale blue background. Light it from the left.",
    "aspectRatio": "1:1",
    "resolution": "1k",
    "outputCount": 1,
    "toolId": null,
    "negativePrompt": "",
    "referenceAssetIds": [],
    "generationQuality": null,
    "seed": null,
    "imageSetMode": false
  }
}'
image-to-image
curl --fail-with-body "$GAPTI_ORIGIN/api/v1/quotes" \
  -H "Authorization: Bearer $GAPTI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "draft": {
    "kind": "image",
    "modelPreset": "gemini-3-1-flash-image",
    "mode": "image-to-image",
    "prompt": "Keep the mug and change the background to warm gray.",
    "aspectRatio": "1:1",
    "resolution": "1k",
    "outputCount": 1,
    "toolId": null,
    "negativePrompt": "",
    "referenceAssetIds": [
      "REPLACE_WITH_FIRST_IMAGE_ASSET_ID"
    ],
    "generationQuality": null,
    "seed": null,
    "imageSetMode": false
  }
}'

Submit and download

Pass normalizedDraft as draft and the full quote as quoteAcknowledgement. Review the returned credits before submitting.

Submit the job