Skip to main content

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.

What this model is for

Use this page after trying Nano Banana in the APIXO playground. It shows the model ID, request body, result format, and the shared async workflow links you need for API integration.

Model ID, endpoint, and auth

  • Model ID: nano-banana
  • Base URL: https://api.apixo.ai/api/v1
MethodEndpointDescription
POST/api/v1/generateTask/nano-bananaCreate generation task
GET/api/v1/statusTask/nano-bananaQuery task status

Authentication

All requests require an API Key in the header:
Authorization: Bearer YOUR_API_KEY

Request Body

{
  "request_type": "async",
  "callback_url": "https://...",
  "provider": "auto",
  "input": {
    "mode": "text-to-image",
    "prompt": "...",
    "aspect_ratio": "16:9",
    "image_urls": ["..."],
    "output_format": "png"
  }
}

Parameters

request_type
string
default:"async"
async (polling) or callback (webhook)
callback_url
string
Callback URL, required when request_type=callback (conditional)
provider
string
default:"auto"
Routing strategy: auto, value, or official
input
object
required
Model input parameters
Mode Options:
  • text-to-image — Generate from text description
  • image-to-image — Generate with reference images

Copy-paste quickstart

Text-to-Image
curl -X POST "https://api.apixo.ai/api/v1/generateTask/nano-banana" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "provider": "value",
    "input": {
      "mode": "text-to-image",
      "prompt": "a cozy cyberpunk cafe with neon lights",
      "aspect_ratio": "3:2",
      "output_format": "png"
    }
  }'
Image-to-Image
curl -X POST "https://api.apixo.ai/api/v1/generateTask/nano-banana" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/callback",
    "provider": "official",
    "input": {
      "mode": "image-to-image",
      "prompt": "make this scene look like sunrise with warm golden light",
      "aspect_ratio": "4:5",
      "image_urls": ["https://example.com/ref1.jpg"],
      "output_format": "jpeg"
    }
  }'

Response and result format

POST /api/v1/generateTask/nano-banana

Returns taskId on success for subsequent status queries. Success:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Error:
{
  "code": 400,
  "message": "Insufficient credits",
  "data": null
}

GET /api/v1/statusTask/nano-banana

Query task execution status and results via taskId.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/nano-banana?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Success:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/image.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
Failed:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "CONTENT_VIOLATION",
    "failMsg": "Content does not meet safety guidelines"
  }
}

Polling result fields

taskId
string
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing resultUrls array. Only present on success. Parse with JSON.parse().
failCode
string
Error code. Only present when state is failed. See Error Codes.
failMsg
string
Human-readable error message. Only present when state is failed.
createTime
integer
Task creation timestamp (Unix milliseconds).
completeTime
integer
Task completion timestamp (Unix milliseconds).
costTime
integer
Processing duration in milliseconds.

Polling and webhook result retrieval

Use request_type: "async" with the status endpoint when your app wants to poll for completion. Use request_type: "callback" with callback_url when your production service should receive the final result automatically. See Webhooks for delivery details.

Common errors

CodeDescription
400Invalid parameters or request error
401Invalid or missing API Key
429Rate limit exceeded
Fail CodeDescription
CONTENT_VIOLATIONContent violates safety guidelines
INVALID_IMAGE_URLCannot access provided image URL

Rate Limits

LimitValue
Requests10000 / minute
Concurrent tasks1000
Exceeding limits returns 429 error. Wait and retry.

Tips

  • Generation time: Average ~15-20 seconds. Submit task, wait 10 seconds, then poll every 3 seconds.
  • Fast and affordable: Nano Banana excels at speed and cost-effectiveness, ideal for rapid prototyping and batch generation.
  • Callback mode: For high-concurrency scenarios, use callback mode to avoid frequent polling.
  • Image expiration: Result URLs are valid for 15 days. Download and store important outputs promptly.
  • Content moderation: Prompts must comply with content safety guidelines. Violations return CONTENT_VIOLATION.
  • Aspect ratio selection:
    • 1:1: Square, for avatars and social media
    • 3:2/4:3: Landscape, for traditional photos
    • 2:3/3:4: Portrait, for mobile screens
    • 16:9/21:9: Ultra-wide, for banners and backgrounds
    • auto: Automatically select best ratio
  • Format selection:
    • png: Lossless, supports transparency, larger file size (default)
    • jpeg: Lossy compression, smaller file, good for fast transfer
  • Multiple references: image-to-image mode supports up to 5 reference images, model combines all styles and content.
  • Image formats: image_urls supports JPG, PNG, WebP, max 10MB per image.

Result URLs expire after 15 days. Download and store important outputs promptly. For high-concurrency scenarios, use callback mode to avoid frequent polling.