gemini-3.1-flash-image.
The model supports synchronous generation, asynchronous tasks, multiple reference images, three output tiers, and fourteen aspect ratios. That combination makes it a practical starting point for most new Nano Banana integrations.
Gemini 3.1 Flash Image capabilities
One model for drafts and final assets
Use 1K for prompt iteration and web assets, 2K for design work and product imagery, and 4K when the final deliverable will use the additional pixels. Changing the output tier does not require changing the model ID or request format.Layout flexibility
The model includes common square, portrait, and landscape formats plus1:4, 1:8, 4:1, and 8:1 for banners, long-form graphics, and unusual canvases.
Generation and editing in the same protocol
A text-to-image request contains a text part. An edit request adds oneinlineData source image beside the instruction in contents[].parts[]. Both use the same generateContent schema.
Google positions the upstream model around a balance of quality, speed, high-volume use, ratio adherence, and multilingual text rendering. See the Gemini 3.1 Flash Image model page.
Current API controls
Google’s upstream documentation also describes a 0.5K tier. The current gateway contract exposes only
1K, 2K, and 4K, so requests must not send 0.5K. The parameters page lists every accepted ratio and field location.
Workloads and model alternatives
Gemini 3.1 Flash Image is suited to product scenes, marketing assets, editorial images, social content, background replacement, and design pipelines that may move between resolutions. Choose another model when the constraint is clearer:- use
gemini-3.1-flash-lite-imagefor a permanently 1K workflow that prioritizes an efficiency-focused model; - compare
gemini-3-pro-imagewhen complex typography, professional layouts, or high-value assets justify a premium request; - keep
gemini-2.5-flash-imageonly while migrating a legacy integration.
Response handling
The image is returned as Base64 in aninlineData part. A response may include both text and image parts, so clients must iterate through all candidates[].content.parts[] entries. Use inlineData.mimeType to choose the file format rather than hard-coding JPEG or PNG.
For requests that can keep an HTTP connection open, use :generateContent. Queue-based systems, browser workflows, and clients behind shorter proxy timeouts should submit /v1/images/tasks with action=generate|edit and poll with a bounded deadline.
Start an integration
Review Flash parameters
Choose the output tier, aspect ratio, response type, and edit input.
Run complete examples
Generate, queue, edit, and save the returned image.