Skip to main content

Overview

Nano Banana 2 is a high-quality image generation model for text-to-image creation and reference-guided image generation. Use this page when you are ready to call the API after trying the model in the APIXO playground.

Endpoint and authentication

Base URL:
All requests require your APIXO API key:
Submit requests also require:

Copy-paste async quickstart

This minimal request submits a text-to-image task and returns a taskId.
Successful response:
Save the taskId; you need it to poll for the final result.

Poll for result

Processing response:
Success response:
Failed response:
Parse resultJson after state becomes success:

Request body

Text-to-image

Image-to-image

Parameters

string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
object
required
Nano Banana 2 input parameters.
aspect_ratio and resolution are required. auto is accepted for aspect_ratio; automatic framing is used when supported.

Response format

Submit task response

POST /generateTask/nano-banana-2 returns a task ID when the task is accepted:
integer
API status code. 200 means the task was accepted.
string
Human-readable status message.
string
Unique task identifier used with the status endpoint.

Status response fields

string
Unique task identifier.
string
Current task state: processing, success, or failed.
string
JSON string containing the generated image URLs. Present when state is success.
string
Machine-readable failure code. Present when state is failed.
string
Human-readable failure message. Present when state is failed.
integer
Task creation timestamp in Unix milliseconds.
integer
Task completion timestamp in Unix milliseconds. Present after completion.
integer
Processing duration in milliseconds. Present after successful completion when available.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
See Webhooks for delivery requirements and retry behavior.

Billing

New non-LLM requests use 1 credit = $0.001. Calculate the full amount, including billable quantity and add-ons, apply the applicable account discount, then round the request total upward to the next whole credit. Agreed fixed unit prices retain their precision and replace the standard price and discount; final rounding still applies. See credit conversion and rounding. Nano Banana 2 is billed per generated image. The selected resolution determines the unit price. For current API rates in USD, see API pricing.

Latency and polling

Actual latency may vary by prompt complexity, reference image accessibility, selected resolution, route health, and current queue load. The backend returns costTime in milliseconds after completion when timing data is available.
Result URLs are available for 15 days by default. Download and store important outputs promptly.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

Task failure codes

See Error Codes for the full error reference.

MCP integration

The complete model schema declares result decoding in mcp.result and supported file bindings in mcp.attachments. These are client integration metadata, not generation input parameters. Attachment paths: image_urls. Preserve the user’s file order. Model parameter validation remains on the API.