Skip to content
中文

POST /v1/images/generations

Method: POSTEndpoint: /v1/images/generations

This section contains endpoint-specific behavior, parameters, or usage notes for this API.

Request Parameters

Header Parameters

text
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}

Body Parameters application/json

text
model
string
Required
prompt
string
Required
aspect_ratio
enum<string>
Optional
Enum Values:
4:3
3:4
16:9
9:16
2:3
3:2
1:1
4:5
5:4
21:9
response_format
string
Optional
url or b64_json
image
array
[string]
Optional
Reference image array, either url or b64_json
image_size
enum<string>
Optional
Supported only by nano-banana-2
Enum Values:
1K
2K
4K
Example
{
"prompt"
:
"cat"
,
"model"
:
"nano-banana"
}

Example Request

Shell

bash
curl --location --request POST '/v1/images/generations' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "cat",
    "model": "nano-banana"
}'

Response

🟢 200 Success

Content Type: application/json

Response Schema

text
object

Example

json
{}