Skip to main content
POST

Models you can use

Multiple reference images

Append multiple inline_data objects consecutively inside contents[].parts. Each object holds the Base64 data of one reference image, enabling multi-reference input.

Resolution configuration

Inside generationConfig.imageConfig:
  • aspectRatio: 1:1, 3:4, 4:3, 9:16, 16:9
  • imageSize: 1K, 2K, 4K

Thinking content

Set generationConfig.thinkingConfig.includeThoughts: true to include the model’s reasoning trace in the response.

Authorizations

Authorization
string
header
required

Bearer token authentication, format: Authorization: Bearer sk-xxxxxx. Get your API key in the console.

Path Parameters

model
string
required

NanoBanana model ID, e.g. nanobanana_pro. Accepted values: nanobanana, nanobanana_pro.

Body

application/json

NanoBanana native-format image generation/editing request body.

contents
object[]
required

A list of conversation turns. Typically one user message; its parts array can contain a text prompt and one or more reference images.

generationConfig
object
required

Generation configuration controlling output modalities, image dimensions, and optional thinking content.

Response

Image generated successfully

NanoBanana native-format response body.

candidates
object[]

List of generated candidate results.

usageMetadata
object

Token usage statistics.