Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview)
Image Generationgoogle/gemini-3.1-flash-image-previewGemini 3.1 Flash Image Preview, a.k.a. "Nano Banana 2," is Google’s latest state of the art image generation and editing model, delivering Pro-level visual quality at Flash speed. It combines advanced contextual understanding with fast, cost-efficient inference, making complex image generation and iterative edits significantly more accessible.
64K context window
64K max output tokens
Released: 2026-03-03
Supported Protocols:openaigemini
Available Providers:Vertex
Capabilities:VisionWeb Search
Pricing
| Type | Price |
|---|---|
| Input Tokens | $0.5/M |
| Output Tokens | $3/M |
| Output Image | $60/M |
| Web Search | $0.014/R |
Code Examples
from google import genaiclient = genai.Client(api_key="YOUR_OFOX_API_KEY",http_options={"api_version": "v1beta", "url": "https://api.ofox.ai/gemini"},)response = client.models.generate_content(model="google/gemini-3.1-flash-image-preview",contents="Generate an image of a beautiful sunset over mountains",)print(response.text)
Related Models
Frequently Asked Questions
Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) on Ofox.ai costs $0.5/M per million input tokens and $3/M per million output tokens. Pay-as-you-go, no monthly fees.
Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) supports a context window of 64K tokens with max output of 64K tokens, allowing you to process large documents and maintain long conversations.
Simply set your base URL to https://api.ofox.ai/v1 and use your Ofox API key. The API is OpenAI-compatible — just change the base URL and API key in your existing code.
Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview) supports the following capabilities: Vision, Web Search. Access all features through the Ofox.ai unified API.