Save 15% on top-ups — use OFOXAI2608Learn more
Gemini

Google: Nano Banana 2 (Gemini 3.1 Flash Image)

Image Generation
google/gemini-3.1-flash-image

Nano Banana 2 (Gemini 3.1 Flash Image) is Google's state-of-the-art image generation and editing model, delivering Pro-level visual quality at Flash speed. Released on 2026-06-18, it is the GA version of gemini-3.1-flash-image-preview, combining advanced contextual understanding with fast, cost-efficient inference. It accepts image input alongside text prompts, so it handles both text-to-image generation and editing of existing images, and it can ground generations with web search. Available via OpenAI and Gemini protocols through Ofox.

Context Window
131K
Max Output Tokens
64K
Released
2026-06-18
Capabilities
VisionWeb Search
Available Providers
GoogleCloudVertex
Supported Protocols
OpenAIopenaiGeminigemini

Providers

GoogleCloudVertex
Input Tokens
$0.5/M
Output Tokens
$3/M
Output Image
$60/M
Web Search
$0.014/R
Protocols
OpenAIopenai/v1/chat/completions/v1/images/generations
Geminigemini

Code Examples

from google import genai
client = genai.Client(
api_key="YOUR_OFOX_API_KEY",
http_options={"api_version": "v1beta", "base_url": "https://api.ofox.io/gemini"},
)
response = client.models.generate_content(
model="google/gemini-3.1-flash-image",
contents="Generate an image of a beautiful sunset over mountains",
)
print(response.text)

Frequently Asked Questions

Google: Nano Banana 2 (Gemini 3.1 Flash Image) 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.