Nano Banana 2.1 API
Fast 1K–4K image & 14-ref editing · 14 ratios
POST /v1/images/generations · https://api.callmodels.dev/v1/images/generations
Pricing & specification tiers
Fixed per-image pricing: 2.2 Credits (1K), 2.6 Credits (2K), or 3.4 Credits (4K) per image, with 0–14 reference images included at 0 extra Credits.
| Specification | Price (USD) | Credits ($1 = 100) | Per $10 Est. |
|---|---|---|---|
| 1K output (default) · 0–14 ref images included | $0.0220 | 2.200000 Credits | ~454 images |
| 2K output · 0–14 ref images included | $0.0260 | 2.600000 Credits | ~384 images |
| 4K ultra-HD output · 0–14 ref images included | $0.0340 | 3.400000 Credits | ~294 images |
Request parameters
Local reference assets: upload via
POST /v1/files/uploads (0 Credits) for a 24h signed URL.| Parameter | Type & Default | Constraints |
|---|---|---|
AuthorizationRequiredHeader | string | Bearer sk-... server-side API key from your account. |
Idempotency-KeyOptionalHeader | stringDefault: recommended | 1 to 255 ASCII chars. Prevents duplicate submissions and charges for 24h. |
modelRequired | "nano-banana-2.1" | Stable public model ID for Google Nano Banana 2.1. |
promptRequired | string | 1 to 10,000 UTF-8 characters describing the image or multi-reference edit. |
resolutionOptional | "1K" | "2K" | "4K"Default: "1K" | Output resolution tier ("1K" = 2.2, "2K" = 2.6, "4K" = 3.4 Credits). |
sizeOptional | "auto" | 14 aspect ratios ("1:1".."8:1")Default: "auto" | Supports "auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "4:5", "5:4", "21:9", "1:4", "4:1", "1:8", and "8:1". |
image_urlsOptional | string[] (1..14)Default: omitted | Optional 1–14 downloadable HTTPS reference images, included at 0 extra Credits. |
nOptional | 1Default: 1 | Outputs 1 image per task; submit concurrent async tasks for batch throughput. |
Code examples
# Set CALLMODELS_OPERATION_ID once per job and keep it for retries.
: "${CALLMODELS_OPERATION_ID:?Set a stable job ID}"
curl --silent --show-error --fail-with-body --max-time 15 "https://api.callmodels.dev/v1/images/generations" \
-H "Authorization: Bearer $CALLMODELS_API_KEY" \
-H "Idempotency-Key: $CALLMODELS_OPERATION_ID" \
-H "Content-Type: application/json" \
--data-binary '{
"model": "nano-banana-2.1",
"prompt": "Sunlit cedar and glass architectural pavilion beside a still alpine mirror pool",
"size": "16:9",
"resolution": "1K"
}'
# Set TASK_ID to the id from the response, then poll until terminal.
if [ -n "${TASK_ID:-}" ]; then
curl --silent --show-error --fail-with-body --max-time 15 "https://api.callmodels.dev/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $CALLMODELS_API_KEY"
fiTask responses
On completed, read results[0].url (30-day signed link, no auth header) and usage.cost_credits.
HTTP/1.1 202 Accepted
X-Request-Id: req_example
Cache-Control: no-store
{
"id": "task_01e561ba-859e-47fe-be79-60bc6f1d6499",
"model": "nano-banana-2.1",
"object": "image.generation.task",
"created_at": "2026-11-21T00:00:00.000Z",
"status": "pending"
}Error codes
| HTTP / Error Code | Cause & Handling | Billing |
|---|---|---|
400 invalid_parameter400 model_not_found | Use the model ID and parameters documented for the endpoint. Correct the JSON before sending again. | 0 Credits for this rejection |
| 401 invalid_api_key | Check the server-side Bearer key, expiration and revocation status. | 0 Credits for this rejection |
402 insufficient_balance402 key_quota_exceeded | Check available account credits and the key’s total and daily limits with GET /v1/credits. | 0 Credits for this rejection |
403 model_access_denied403 account_disabled | Check the model allowlist and account status. | 0 Credits for this rejection |
| 404 not_found | Check the task ID or original Idempotency-Key and the account that submitted it. | 0 Credits for this rejection |
| 409 idempotency_key_conflict | Use the original JSON for this job. Assign a fresh key only to a new job. | 0 Credits for this rejection |
413 body_too_large415 unsupported_media_type | Send application/json with a request body no larger than 128 KiB. | 0 Credits for this rejection |
500 internal_error503 service_unavailable503 model_unavailable | On a timeout or transient error, look up the original job and retry only with its original key and body. | Check the task record |
Task: delivery_failedTask: submission_unknownTask: submission_rejectedTask: upstream_failedTask: timeout | The task ended. Its hold was released. Review error.code before creating a separate generation job. | 0 Credits charged |