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 Preview)
google/gemini-3.1-flash-image-previewTry Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) 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 Preview) at a glance
- Input price is 90% lower than the median of 21 Image models.
- Context window of 65,536 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 Preview)
Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) is an image generation and editing model from Google, identified on api14 as google/gemini-3.1-flash-image-preview. It sits in the image category with text as a secondary category, and it is the model behind the Nano Banana 2 name. It is a preview release from Google rather than a finished, generally available model, so treat it as something to evaluate against your own workload before depending on it in production.
The model accepts image and text inputs and can return both image and text outputs, so a single call can generate a picture and produce written content alongside it. It has a context window of 65,536 tokens and a maximum output of 58,982 tokens. Image generation is configurable: resolution can be set to 512, 1K, 2K or 4K, and aspect ratio can be set to 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 or 21:9. The n parameter accepts a value from 1 to 1, so each request returns one image, and input_references accepts from 0 to 14 images, which is what makes reference-driven editing and guided generation possible.
Those capabilities point to a fairly specific set of uses. Text to image generation covers concept art, product mockups, illustrations and social assets at whichever resolution and aspect ratio the destination requires. Because the model takes up to 14 reference images, it also suits editing and transformation work: restyling an existing photo, combining elements from several references, or keeping a subject consistent across a series of outputs. The text output side means it can caption, describe or reason about images in the same response, which is useful for asset pipelines that need both the image and its metadata. The wide aspect ratio range, from 1:8 and 8:1 through to 21:9, makes it practical for banners, tall mobile formats and wide cinematic frames without cropping afterwards.
You call it through api14's OpenAI-compatible API using the model id google/gemini-3.1-flash-image-preview, so existing OpenAI SDKs and clients work with a change of base URL and model name. The supported request parameters are include_reasoning, max_tokens, reasoning, reasoning_effort, response_format, seed, structured_outputs, temperature and top_p. Seed is worth setting when you need reproducible outputs, and temperature and top_p control sampling. The image specific options (resolution, aspect ratio, n and input_references) are passed as part of the request alongside those parameters.
A few constraints are worth knowing before you commit. The context window of 65,536 tokens is modest compared with long context text models, so very large documents or long multi turn histories may need trimming or a different model. Each request returns a single image, so batch generation means multiple calls. It is also a preview model, which is a reason to keep a fallback in mind for anything user facing. If your task is text only, or needs a much larger context, a dedicated text model on api14 will usually be the better fit.
How to call the Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) 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-preview".
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-preview",
"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
- 65,536
- Max output
- 58,982
- Input
- image, text
- Output
- image, text
Requests on api14 · last 7 days
Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview): frequently asked questions
- How much does the Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) API cost?
- Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) 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 Preview)?
- Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) reads up to 65,536 tokens per request: prompt, history and documents together. It writes up to 58,982 output tokens per response.
- What can Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) do?
- Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) 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 Preview) from my code?
- Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "google/gemini-3.1-flash-image-preview". 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 Preview)?
- Comparable Image models at a similar price: Google: Nano Banana 2 (Gemini 3.1 Flash Image), 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 Preview) community
New topicThis community has no topics yet. Open the first one about Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview).