Nano AI API Documentation
Use one public API surface for every Nano AI model. Select nano, nano2, or nano2pro with the model parameter.
Quick Start
Use /api/generate for text-to-image, /api/edit for image editing, and /api/status for every task. Do not switch endpoints to select a model. Set model to nano, nano2, or nano2pro.
curl -X POST "https://nanobnana.com/api/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A professional product photo of a modern wristwatch on a clean white background",
"model": "nano2"
}'How Routing Works
POST /api/generate
Text to image
Creates a generation task. The model field decides whether the request goes to nano, nano2, or nano2pro.
POST /api/edit
Image editing
Creates an editing task with image URLs. The same model field selects the backend.
GET /api/status
Task status
Checks any task. The API infers the backend from the task_id format, with model only as an optional fallback.
Available Models
| Model | Model name | Use case |
|---|---|---|
nano | Original Nano AI Fast | Backward-compatible default for existing integrations. |
nano2 | Nano AI 2 | Recommended default for new image generation integrations. |
nano2pro | Nano AI 2 Pro | Higher quality generation and editing workflows. |
Unified Endpoints
Task Status
For legacy nano...ban tasks, status: 3 means the task is still processing, not failed. Prefer status_code across all models: 1 success, 2 failed, 3 in progress.