Documentation Index
Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
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.| Capability | Value |
|---|---|
| Model ID | nano-banana-2 |
| Modes | text-to-image, image-to-image |
| Prompt length | 1-20000 characters |
| Reference images | Required for image-to-image; up to 14 URLs |
| Aspect ratios | auto, 1:1, 1:4, 4:1, 1:8, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 |
| Resolution tiers | 1k, 2k, 4k |
| Output formats | png, jpeg, jpg |
Endpoint and authentication
Base URL:| Method | Endpoint | Purpose |
|---|---|---|
POST | /generateTask/nano-banana-2 | Submit a generation task |
GET | /statusTask/nano-banana-2?taskId={taskId} | Poll task status and retrieve results |
Copy-paste async quickstart
This minimal request submits a text-to-image task and returns ataskId.
taskId; you need it to poll for the final result.
Poll for result
resultJson after state becomes success:
Request body
Text-to-image
Image-to-image
Parameters
Result delivery mode. Use
async for polling with statusTask, or callback for webhook delivery.Required when
request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.Nano Banana 2 input parameters.
aspect_ratio and resolution are required. auto is accepted for aspect_ratio; on some routes it lets the upstream service choose the default framing.Response format
Submit task response
POST /generateTask/nano-banana-2 returns a task ID when the task is accepted:
API status code.
200 means the task was accepted.Human-readable status message.
Unique task identifier used with the status endpoint.
Status response fields
Unique task identifier.
Current task state:
processing, success, or failed.JSON string containing the generated image URLs. Present when
state is success.Machine-readable failure code. Present when
state is failed.Human-readable failure message. Present when
state is failed.Task creation timestamp in Unix milliseconds.
Task completion timestamp in Unix milliseconds. Present after completion.
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.Billing
Nano Banana 2 is billed per generated image. The selectedresolution determines the unit price.
| Resolution | APIXO price |
|---|---|
1k | $0.05 / image |
2k | $0.08 / image |
4k | $0.12 / image |
Latency and polling
Actual latency may vary by prompt complexity, reference image accessibility, selected resolution, route health, and current queue load. The backend returnscostTime in milliseconds after completion when timing data is available.
| Stage | Guidance |
|---|---|
| First poll | Wait 10s-20s after task creation before the first status request |
| Poll interval | Poll every 10s while state is processing |
| Production delivery | Use callback mode for high-concurrency workloads |
429, slow down requests and retry with backoff. For account-level details, see System APIs.
Errors and troubleshooting
HTTP errors
| Code | Meaning | What to do |
|---|---|---|
400 | Invalid request body, mode, parameter, or image URL shape | Fix the request before retrying |
401 | Missing or invalid API key | Check the Authorization header |
402 | Insufficient balance or quota | Add balance or switch account/key |
403 | Key or route cannot access the model | Check permissions and route strategy |
429 | Rate limit or concurrency limit reached | Retry with exponential backoff |
500 | Server or unmapped upstream error | Retry with backoff |
502 | Upstream service error | Retry with backoff |
504 | Upstream timeout | Retry or use callback mode for long-running jobs |
Task failure codes
| Fail code | Meaning | What to do |
|---|---|---|
PromptInvalid | Prompt was invalid or rejected upstream | Revise the prompt |
SensitiveContent | Prompt or output violated safety policy | Change the prompt or reference image |
ImageFormatIncorrect | A reference image could not be accepted upstream | Use a public, direct image URL in a common image format |
MissingParameter | A required upstream parameter was missing | Check mode, prompt, aspect_ratio, resolution, and image_urls |
RateLimited | Upstream rate limit was reached | Retry with backoff |
Timeout | Upstream timeout | Retry, reduce input complexity, or use callback mode |
Unknown error | Upstream failure did not match a known rule | Retry with backoff or contact support with the taskId |