The Nano Banana image generation endpoint creates an async task that generates high-quality AI images from a text prompt. You’ll receive a task ID to poll for the result. Because generation happens asynchronously, your application can continue doing other work while the image is being produced.Documentation Index
Fetch the complete documentation index at: https://docs.xingchaoyiqing.com/llms.txt
Use this file to discover all available pages before exploring further.
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.| Model | Description |
|---|---|
nano-banana | Base model, fast generation |
nano-banana-2 | Enhanced model with resolution support |
nano-banana-pro | Professional — up to 4K |
nano-banana-2-stable | Stable version of nano-banana-2 |
nano-banana-pro-stable | Stable professional version |
Request Parameters
The model to use for image generation. See the Models table above for valid values.
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".The output resolution of the generated image. Defaults to
1k for all models.| Value | Resolution |
|---|---|
1k | 1K resolution (default, supported by all models) |
2k | 2K resolution (supported by nano-banana-pro and nano-banana-pro-stable) |
4k | 4K resolution (supported by nano-banana-pro and nano-banana-pro-stable) |
nano-banana, nano-banana-2, and nano-banana-2-stable have limited resolution capability — use 1k for these models.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:9An 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
The unique task ID for this generation job. Use this value to poll the Query Image Task endpoint for the result.
The object type. Always
nanobanana.Unix timestamp indicating when the task was created.
The model name used for this task.
The initial task status. Will be
queued or processing immediately after creation.| Value | Meaning |
|---|---|
queued | Task is waiting in the queue |
processing | Task is actively being processed |
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.