Base URL
Endpoint
Authentication
Include your API key as a Bearer token in theAuthorization header on every request:
Models
Choose the model that best fits your quality and speed requirements.Request Parameters
string
required
The model to use for image generation. See the Models table above for valid values.
string
required
A text description of the image you want to generate. Clear, descriptive prompts produce the best results. Example:
"A cute orange cat sitting on a windowsill, golden hour lighting".string
default:"1k"
The output resolution of the generated image. Defaults to
1k for all models.nano-banana, nano-banana-2, and nano-banana-2-stable have limited resolution capability — use 1k for these models.string
The aspect ratio of the generated image. If omitted, the model uses its default aspect ratio.Supported values:
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9array
An array of reference image URLs used to guide the style of the generated image. You may provide up to 6 images. Reference images are optional but can significantly improve style consistency.
Response Fields
string
The unique task ID for this generation job. Use this value to poll the Query Image Task endpoint for the result.
string
The object type. Always
nanobanana.integer
Unix timestamp indicating when the task was created.
string
The model name used for this task.
string
The initial task status. Will be
queued or processing immediately after creation.string
An error message describing what went wrong. Only present when
status is failed.Code Example
Success Response
Failure Response
Image generation is processed asynchronously. The create endpoint returns a task
id immediately — use that ID with the Query Image Task endpoint (GET /v1/result/{id}) to check task status and retrieve your image URL when generation is complete.