Skip to main content
POST
Nano Banana
Parameters and usage are aligned with the official implementation. For detailed parameters, refer directly to the official documentation.

How to Call

  • https://{api_domain}/gemini/v1/models/{model}:generateContent
  • https://{api_domain}/gemini/v1beta/models/{model}:generateContent
BaseURL:
  • https://{api_domain}/gemini

Supported Models

  • gemini-3.1-flash-lite-image
  • gemini-3.1-flash-image
  • gemini-3-pro-image
  • gemini-2.5-flash-image
  • gemini-3.1-flash-lite-image-as
  • gemini-3.1-flash-image-as
  • gemini-3-pro-image-as
  • gemini-2.5-flash-image-as

REST API

Request example (for detailed API usage, refer to the official documentation at https://ai.google.dev/gemini-api/docs/image-generation)

Text-to-Image

Image Editing

GenAI SDK

Best Practices

Thinking Draft Image Issue

  • With the default parameter responseModalities=["TEXT", "IMAGE"], image generation may probabilistically produce 2 images: one 1k thinking draft image and one final image. The thinking draft image is billed as thinking output tokens, while the final image is billed as final output tokens.
  • You need to set responseModalities = ["IMAGE"] so that only the final image is generated.