curl --request POST \
--url https://api.getinfinityblue.com/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Draw a cat sitting on a rooftop under moonlight"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
],
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "4K"
}
}
}
'{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>",
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}Nano Banana
NanoBanana native format
Call NanoBanana via the Gemini native protocol with multi-reference and high-resolution support
POST
/
v1beta
/
models
/
{model}
:generateContent
curl --request POST \
--url https://api.getinfinityblue.com/v1beta/models/{model}:generateContent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Draw a cat sitting on a rooftop under moonlight"
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
],
"imageConfig": {
"aspectRatio": "16:9",
"imageSize": "4K"
}
}
}
'{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>",
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"totalTokenCount": 123
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}{
"error": {
"message": "Invalid size. Supported sizes are 1024x1024, 1536x1024, 1024x1536.",
"type": "invalid_request_error",
"param": "size",
"code": "invalid_size"
}
}Models you can use
| Model ID | Notes |
|---|---|
nanobanana | Standard — balanced speed and quality |
nanobanana_pro | High-quality — ideal for product images and precise style unification |
nanobanana_2 | 2nd generation — budget tier only supports the OpenAI chat format (see separate endpoint) |
Multiple reference images
Append multipleinline_data objects consecutively inside
contents[].parts. Each object holds the Base64 data of one reference
image, enabling multi-reference input.
Resolution configuration
InsidegenerationConfig.imageConfig:
aspectRatio:1:1,3:4,4:3,9:16,16:9imageSize:1K,2K,4K
Thinking content
SetgenerationConfig.thinkingConfig.includeThoughts: true to
include the model’s reasoning trace in the response.Authorizations
Path Parameters
NanoBanana model ID, e.g. nanobanana_pro.
Accepted values: nanobanana, nanobanana_pro.
Body
application/json
NanoBanana native-format image generation/editing request body.
A list of conversation turns. Typically one user message; its
parts array can contain a text prompt and one or more reference
images.
Show child attributes
Show child attributes
Generation configuration controlling output modalities, image dimensions, and optional thinking content.
Show child attributes
Show child attributes