curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-nano-banana-2.1",
"prompt": "A cat playing on the grass",
"size": "16:9",
"quality": "2K"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "gemini-nano-banana-2.1",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image",
"usage": {
"billing_rule": "per_image",
"credits_reserved": 3.0845,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: gemini-nano-banana-2.1",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Nanobanana 2.1 Image Generation
- Nano Banana 2.1 (gemini-nano-banana-2.1) supports text to image, image to image, image editing, and multi-image composition, with
1K,2K, and4Koutput resolutions - Asynchronous processing: use the returned task ID to query the task
- Generated image links are valid for 24 hours. Please save the images promptly
- Billing: output images are billed by resolution, input images per image, and web search and image search by the actual number of searches. Prompt text, text output, and reasoning are billed per token. Actual charges are based on the
usagereturned by the task query
curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-nano-banana-2.1",
"prompt": "A cat playing on the grass",
"size": "16:9",
"quality": "2K"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "gemini-nano-banana-2.1",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image",
"usage": {
"billing_rule": "per_image",
"credits_reserved": 3.0845,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: gemini-nano-banana-2.1",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Authorizations
##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
Image generation model name, official channel, better stability and controllability, suitable for commercial scenarios
gemini-nano-banana-2.1 "gemini-nano-banana-2.1"
Prompt describing the image to generate or how to edit an input image, up to 4000 tokens
"A cat playing in the grass"
Aspect ratio of the generated image, default is auto
auto, 1:1, 1:4, 4:1, 1:8, 8:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 Output image resolution, default is 2K
Note:
- Prices vary by resolution. Output images are billed at the selected resolution. Setting this parameter explicitly is recommended
1K, 2K, 4K List of reference image URLs for image to image generation, image editing, and multi-image composition
Note:
- Up to
14input images per request - Image size: no more than
20MB - Supported file formats:
.jpeg,.jpg,.png,.webp - Image URLs must be directly accessible by the server or trigger a direct image download when accessed (such URLs typically end in an image extension such as
.pngor.jpg) - Input images are billed per image
14[
"https://example.com/image1.png",
"https://example.com/image2.png"
]
Model extension parameters
Show child attributes
Show child attributes
HTTPS callback address after task completion
Callback Timing:
- Triggered when task is completed, failed, or cancelled
- Sent after billing confirmation is completed
Security Restrictions:
- Only HTTPS protocol is supported
- Callback to internal IP addresses is prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
- URL length must not exceed
2048characters
Callback Mechanism:
- Timeout:
10seconds - Maximum
3retries on failure (retries after1second/2seconds/4seconds) - Callback response body format is consistent with the task query API response format
- Callback address returning 2xx status code is considered successful, other status codes will trigger retry
"https://your-domain.com/webhooks/image-task-completed"
Response
Image generation task created successfully
Task creation timestamp
1757165031
Task ID
"task-unified-1757165031-uyujaw3d"
Actual model name used
"gemini-nano-banana-2.1"
Specific task type
image.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Asynchronous task information
Show child attributes
Show child attributes
Task output type
text, image, audio, video "image"
Usage and billing information
Show child attributes
Show child attributes