We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.
Google: Nano Banana 2 (Gemini 3.1 Flash Image)
google/gemini-3.1-flash-imageTry Google: Nano Banana 2 (Gemini 3.1 Flash Image) now
Runs on your balance at the prices above. New accounts start with free usage.
Settings
Google: Nano Banana 2 (Gemini 3.1 Flash Image) at a glance
- Input price is 90% lower than the median of 21 Image models.
- Context window of 131,072 tokens, enough for long documents and multi-turn conversations.
- Supports structured JSON output with a schema.
- Supports reasoning effort control.
About Google: Nano Banana 2 (Gemini 3.1 Flash Image)
Google: Nano Banana 2 (Gemini 3.1 Flash Image) is an image generation and editing model from Google, identified on api14 as google/gemini-3.1-flash-image. It sits in the image category with text as a secondary category, and it is the successor to Google's earlier Nano Banana image model. The provider release date is 2026-06-18. Google positions it as delivering Pro-level visual quality at Flash speed, which tells you the intent: high output quality without the slower turnaround usually associated with larger image models.
The model accepts image and text inputs and can return image and text outputs, so it handles both generation from a prompt and editing of images you supply. Its context window is 131,072 tokens, and the maximum output is 32,768 tokens. Image generation is configurable: resolution can be set to 512, 1K, 2K or 4K, and aspect ratio supports 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9 and 21:9. The n parameter accepts a minimum of 1 and a maximum of 1, so each request produces a single image. Input references accept from 0 to 14 images, which is what makes multi-image editing and composition practical.
Those capabilities point to a fairly wide set of uses. Text to image generation covers illustration, concept art, product mockups and marketing assets, with the aspect ratio list handling everything from square social posts to wide banners and tall mobile formats. Because the model takes image input alongside text, it also fits editing workflows: retouching, restyling, background changes, and combining elements from several source images, since up to 14 references can be passed in. The 4K resolution option suits work that needs to hold up when printed or displayed large, while 512 keeps drafts cheap to iterate on. The text output side means the model can return explanations or descriptions alongside the image it produces.
You call it through api14's OpenAI-compatible API using the model id google/gemini-3.1-flash-image, so existing OpenAI client libraries work with only the base URL and model name changed. The supported request parameters are include_reasoning, max_tokens, reasoning, reasoning_effort, response_format, seed, structured_outputs, temperature and top_p. Seed is useful when you want reproducible image output across runs, and temperature and top_p control how much variation you get between generations. The reasoning related parameters let you trade latency for more deliberate handling of complex prompts.
A few constraints are worth knowing before you commit. The n parameter is fixed at 1, so you cannot request multiple images in a single call; if you need variations, issue separate requests, optionally with different seeds. Input references cap at 14, so very large reference sets need to be narrowed down first. If your task is purely text generation with no image component, a dedicated text model will usually be a better fit, and if you need heavier reasoning over long documents, the image focus here is not the point. For image generation and editing within these bounds, it covers the common cases directly.
How to call the Google: Nano Banana 2 (Gemini 3.1 Flash Image) API
- Create an API key in your dashboard.
- Install the official openai SDK for your language.
- Set baseURL to https://api14.com/api/v1 and model to "google/gemini-3.1-flash-image".
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.images.generate({
"model": "google/gemini-3.1-flash-image",
"prompt": "A minimalist product photo of a ceramic mug on a wooden table",
"n": 1,
"aspect_ratio": "1:1"
});
import { writeFile } from "node:fs/promises";
await writeFile("image.png", Buffer.from(result.data[0].b64_json, "base64"));
Supported parameters
include_reasoningmax_tokensreasoningreasoning_effortresponse_formatseedstructured_outputstemperaturetop_pSpecifications
- Context length
- 131,072
- Max output
- 32,768
- Input
- image, text
- Output
- image, text
Requests on api14 · last 7 days
Google: Nano Banana 2 (Gemini 3.1 Flash Image): frequently asked questions
- How much does the Google: Nano Banana 2 (Gemini 3.1 Flash Image) API cost?
- Google: Nano Banana 2 (Gemini 3.1 Flash Image) costs Input $1.75 / 1M tokens. It is charged from your USD balance only for successful requests; failed requests are free.
- What is the context window of Google: Nano Banana 2 (Gemini 3.1 Flash Image)?
- Google: Nano Banana 2 (Gemini 3.1 Flash Image) reads up to 131,072 tokens per request: prompt, history and documents together. It writes up to 32,768 output tokens per response.
- What can Google: Nano Banana 2 (Gemini 3.1 Flash Image) do?
- Google: Nano Banana 2 (Gemini 3.1 Flash Image) accepts image, text and returns image, text. It supports structured JSON output, reasoning effort control.
- How do I call Google: Nano Banana 2 (Gemini 3.1 Flash Image) from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "google/gemini-3.1-flash-image". No other code changes. Copy a ready example from the code panel on this page.
- What are alternatives to Google: Nano Banana 2 (Gemini 3.1 Flash Image)?
- Comparable Image models at a similar price: Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview), Tencent: Hy Image 3.5 Preview, Google: Nano Banana (Gemini 2.5 Flash Image). Each runs through the same API key, so switching is one string.
Google: Nano Banana 2 (Gemini 3.1 Flash Image) community
New topicThis community has no topics yet. Open the first one about Google: Nano Banana 2 (Gemini 3.1 Flash Image).