Images
Nano Banana
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}:generateContenthttps://{api_domain}/gemini/v1beta/models/{model}:generateContent
https://{api_domain}/gemini
Supported Models
gemini-3.1-flash-lite-imagegemini-3.1-flash-imagegemini-3-pro-imagegemini-2.5-flash-imagegemini-3.1-flash-lite-image-asgemini-3.1-flash-image-asgemini-3-pro-image-asgemini-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.