Back to Models
Gemini 3.1 Flash Image
googlegoogle/gemini-3.1-flash-image
How TheRouter serves this differently from the vendor
As the vendor operates it
Googleโs native Gemini API documents Gemini image models through generateContent and Gemini-specific image-generation guides.
On TheRouter
TheRouter serves the same model ID through an OpenAI-compatible API surface so teams can route it beside other hosted image and multimodal models without calling Googleโs native endpoint directly.
API guide
Multimodal image generation
Send a text prompt to TheRouterโs OpenAI-compatible chat endpoint and request Gemini 3.1 Flash Image when you need a balanced Google image tier.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.1-flash-image",
"messages": [
{
"role": "user",
"content": "Create a square product hero image for a ceramic travel mug on a warm studio background."
}
],
"max_tokens": 1024
}'Reference-image editing
Use the same model for edit-style prompts by attaching image context in your application layer; verify exact payload shape against your TheRouter SDK before production rollout.
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.1-flash-image",
"messages": [
{
"role": "user",
"content": "Using the provided product reference image, create a warmer lifestyle variant for an autumn landing page."
}
],
"max_tokens": 1024
}'Fact ledger โ every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Access tier | ai.google.dev changelog โ | 2026-08-05 | verified |
| Input / output modalities | ai.google.dev image generation docs โ | 2026-08-05 | verified |
| Context window | TheRouter API docs โ | 2026-08-05 | verified |
| Max output | TheRouter API docs โ | 2026-08-05 | verified |
| TheRouter blended pricing | TheRouter API docs โ | 2026-08-05 | verified |
| Native Google image-output rate | ai.google.dev pricing โ | 2026-08-05 | verified |
| Supported TheRouter parameters | TheRouter API docs โ | 2026-08-05 | verified |
| License | ai.google.dev image generation docs โ | 2026-08-05 | verified |
| Public benchmark suite | ai.google.dev image generation docs โ | 2026-08-05 | unknown |
| Production latency | TheRouter API docs โ | 2026-08-05 | unknown |
| Image quality ranking | ai.google.dev image generation docs โ | 2026-08-05 | unknown |
| Nano Banana 2 Lite is your new default Gemini image endpoint โ here's the routing decision framework | blog.google โ | 2026-08-05 | verified |
| Gemini API Image Generation 2026: Fix Failed to Fetch After Preview Shutdowns | ai.google.dev changelog โ | 2026-08-05 | verified |
| When should I choose Gemini 3.1 Flash Image instead of Lite or Pro? | ai.google.dev image generation docs โ | 2026-08-05 | to verify |
| Is google/gemini-3.1-flash-image the replacement for the preview ID? | ai.google.dev changelog โ | 2026-08-05 | to verify |
| Were the snippets on this page live-verified? | TheRouter API docs โ | 2026-08-05 | to verify |