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 family | Example IDs | Notes |
|---|---|---|
| NanoBanana | NanoBanana | Base NanoBanana model. |
| NanoBanana Pro | NanoBananaPro-* | Pro tier variants. |
| NanoBanana 2 | NanoBanana2-0.5K, NanoBanana2-1K | Resolution-tiered NanoBanana 2 variants. |
Actual availability depends on account channel and model-price configuration.
Recommended Endpoint
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
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Concrete Nano model ID, such as NanoBanana2-0.5K. |
prompt | string | Yes | Generation or editing prompt. |
task_type | string | No | text2image or image2image. Can be inferred from image input. |
image | string/object | Conditional | Single reference image for editing. |
images | string[] | Conditional | Multiple reference image URLs. |
aspect_ratio | string | No | Recommended shape control, such as 1:1, 16:9, 9:16, 4:3, or 3:4. |
output_format | string | No | NanoBanana supports png, jpeg, webp; Pro and NanoBanana 2 variants support png and jpeg in the current source scope. |
n | integer | No | Output count. Default is 1; maximum depends on upstream limits. |
response_format | string | No | Prefer 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
imageandimageswith compatibility image fields. - Treating
sizeas the primary Nano control; useaspect_ratioinstead. - Requesting an unsupported output format for the selected Nano family.
- Polling before the task has been created.