Skip to main content

Overview

Nano Banana 2.1 supports text-to-image generation and reference-guided image editing. It accepts flexible aspect ratios, up to 10 reference images in image-to-image mode, and 1K, 2K, or 4K output.

Endpoint and authentication

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

Copy-paste async quickstart

This 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"
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.1 input parameters.
image_urls is required only when mode is image-to-image. When omitted, aspect_ratio, resolution, and output_format default to 1:1, 1K, and jpg.

Response format

Submit task response

POST /generateTask/nano-banana-2-1 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: pending, processing, success, or failed.
string
JSON string containing a resultUrls array. 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

Nano Banana 2.1 is billed per generated image. The selected resolution determines the unit price. For current published pricing, see Pricing.

Latency and polling

Actual latency varies by prompt complexity, reference image accessibility, resolution, and current queue load.
Download and store important outputs promptly instead of relying on result URLs as permanent storage.
Rate limits and concurrency vary by account and API key. If you receive 429, slow down requests and retry with backoff.

Errors and troubleshooting

HTTP errors

Task failure codes

See Error Codes for the full error reference.