Skip to main content
AI

Nano Series Image Generation

Nano Series covers the NanoBanana family. Use it when you need a concrete Nano model tier and aspect_ratio-based shape control. The source scope includes both OpenAI-compatible and Gemini-compatible entry points, but new general integrations can start from the async image task flow.

Supported Models

Model familyExample IDsNotes
NanoBananaNanoBananaBase NanoBanana model.
NanoBanana ProNanoBananaPro-*Pro tier variants.
NanoBanana 2NanoBanana2-0.5K, NanoBanana2-1KResolution-tiered NanoBanana 2 variants.

Actual availability depends on account channel and model-price configuration.

POST /v1/images/tasks
GET /v1/images/tasks/{task_id}

The Apifox source also exposes OpenAI-compatible image endpoints for Nano:

POST /v1/images/generations
POST /v1/images/edits

and a Gemini-compatible format for Gemini-style clients. Use the format that matches your client. The request concepts below stay the same.

Authentication

Authorization: Bearer sk-***
Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
modelstringYesConcrete Nano model ID, such as NanoBanana2-0.5K.
promptstringYesGeneration or editing prompt.
task_typestringNotext2image or image2image. Can be inferred from image input.
imagestring/objectConditionalSingle reference image for editing.
imagesstring[]ConditionalMultiple reference image URLs.
aspect_ratiostringNoRecommended shape control, such as 1:1, 16:9, 9:16, 4:3, or 3:4.
output_formatstringNoNanoBanana supports png, jpeg, webp; Pro and NanoBanana 2 variants support png and jpeg in the current source scope.
nintegerNoOutput count. Default is 1; maximum depends on upstream limits.
response_formatstringNoPrefer url.

Text-To-Image Example

curl -X POST "{BASE_URL}/v1/images/tasks" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "NanoBanana2-0.5K",
"task_type": "text2image",
"prompt": "A small red cube on a clean white desk, minimal product photo, soft daylight",
"aspect_ratio": "1:1",
"output_format": "png",
"n": 1,
"response_format": "url"
}'

Image-To-Image Example

curl -X POST "{BASE_URL}/v1/images/tasks" \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "NanoBanana2-0.5K",
"task_type": "image2image",
"prompt": "Turn the reference image into a clean product render",
"image": "https://example.com/input.png",
"aspect_ratio": "16:9",
"output_format": "jpeg",
"n": 1,
"response_format": "url"
}'

Query Task Status

curl "{BASE_URL}/v1/images/tasks/task_xxx" \
-H "Authorization: Bearer sk-***"
{
"code": "success",
"message": "",
"data": {
"task_id": "task_xxx",
"status": "succeeded",
"progress": "100%",
"result_url": "https://example.com/result.png",
"metadata": {
"task_type": "text2image",
"result_count": 1
},
"error": null
}
}

Billing Notes

NanoBanana family models are billed by configured model unit price multiplied by n or the actual returned result count. aspect_ratio and output_format control output shape and format, but are not separate billing dimensions in the current source scope.

Common Errors

  • Passing a Nano model ID that is not enabled for the current account.
  • Mixing image and images with compatibility image fields.
  • Treating size as the primary Nano control; use aspect_ratio instead.
  • Requesting an unsupported output format for the selected Nano family.
  • Polling before the task has been created.