Image Generation nano-banana
Overview
- Method:
POST - Path:
/v1/images/generations
Authentication
- Use HTTP Bearer Token, e.g.:
Authorization: Bearer sk-xxxxx
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Text prompt, max 32768 tokens |
| model | string | Yes | e.g. nano-banana / gemini-3.1-flash-image-preview / gemini-2.5-flash-image |
| response_format | string | No | b64_json/url |
| size | string | No | e.g. 2:3, 4K, etc. |
| aspect_ratio | string | No | Aspect ratio e.g. 2:3 (only supported for 3+ series) |
Request Example
json
{
"model": "nano-banana",
"prompt": "A realistic high-resolution photo of a busy city street",
"size": "2:3"
}Response Example
json
{
"created": 1725007743,
"data": [{"b64_json": "..."}],
"usage": {"input_tokens": 10, "output_tokens": 20, "total_tokens": 30}
}