Nano banana Image Generation
Asynchronous processing mode, returns task ID for subsequent queries
Semua dokumentasi/v1/images/generations- Fast generation speed, optimized for quick image creation
- Generated image links are valid for 24 hours, please save them promptly
Note
Model name compatibility note: This endpoint also accepts the alias
nano-banana-ext, which is equivalent togemini-2.5-flash-image-preview. The two are interchangeable and produce identical results.
Contoh permintaan
# model can be "gemini-2.5-flash-image-preview", or the compatible alias "nano-banana-ext"
curl --request POST \
--url https://api.apisea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gemini-2.5-flash-image-preview",
"prompt": "A bamboo forest path under moonlight",
"size": "1:1",
"n": 1,
"image_urls": [
"https://openai-documentation.vercel.app/images/cat_and_otter.png"
]
}'Authorizations
AuthorizationstringrequiredAll API endpoints require Bearer Token authentication
Get your API Key:
Visit the API Key Management Page to get your API Key
Add it to the request header:
Authorization: Bearer YOUR_API_KEYBody
modelstringrequireddefault: gemini-2.5-flash-image-previewImage generation model name
Supported models:
gemini-2.5-flash-image-preview- Standard version (compatible aliasnano-banana-ext)gemini-2.5-flash-image-preview-official- Official version (compatible aliasnano-banana)
Example: "gemini-2.5-flash-image-preview" or "gemini-2.5-flash-image-preview-official"
Note
For backward compatibility, the aliases
nano-banana-ext(forgemini-2.5-flash-image-preview) andnano-banana(forgemini-2.5-flash-image-preview-official) remain usable.
nsfw_checkbooleandefault: falseWhether to run content moderation before submitting the image task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
promptstringrequiredText description for image generation
Maximum 1000 characters
sizestringImage generation size
Supported formats:
- Ratio:
auto,1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9
Warning
For text-to-image, when
sizeisauto, the default is1:1or16:9; for image-to-image, the aspect ratio follows the upstream response. We recommend specifying an aspect ratio.
resolutionstringdefault: 1KOutput image resolution
Supported values:
1K- 1K resolution (default)
nintegerNumber of images to generate
Range: 1
Default: 1
⚠️ Note: Must enter a plain number (e.g., 1), do not use quotes or it will cause an error
official_fallbackbooleandefault: falseWhether to use the official channel fallback
false: Do not use (default)true: Use official channel
Warning
When using the official channel (
gemini-2.5-flash-image-preview-official), this parameter cannot be used.
image_urlsarrayList of reference image URLs for image-to-image or image editing
💡 Quick Fill (Try it area):
- Click "+ Add an item" to add an image URL
- Enter the complete image URL address or base64 data
Detailed field description
Each element in the array is a string, supporting two formats:
1. Complete image URL address
- Publicly accessible image URL (http:// or https://)
- Example:
"https://example.com/image.jpg"
2. Base64 encoded format
- Must use complete Data URI format
- Format:
data:image/{format};base64,{base64data} - Supported image formats: jpeg, png, webp, etc.
- Example:
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg..." - ⚠️ Note: Must include the
data:image/jpeg;base64,prefix
Limitations:
- Single image must not exceed 10MB
- Supported formats: .jpeg, .jpg, .png, .webp
Limit: Maximum 14 images
Response
codeintegerResponse status code
dataarrayResponse data array
Properties
statusstringTask status
submitted- Submitted
task_idstringUnique task identifier
Respons
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01K8SGYNNNVBQTXNR4MM964S7K"
}
]
}Model yang menggunakan endpoint ini
Menemui masalah dalam dokumentasi ini? E-mel support@apisea.ai.