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
sourceURLretrieved
Access tierai.google.dev changelog โ†—2026-08-05verified
Input / output modalitiesai.google.dev image generation docs โ†—2026-08-05verified
Context windowTheRouter API docs โ†—2026-08-05verified
Max outputTheRouter API docs โ†—2026-08-05verified
TheRouter blended pricingTheRouter API docs โ†—2026-08-05verified
Native Google image-output rateai.google.dev pricing โ†—2026-08-05verified
Supported TheRouter parametersTheRouter API docs โ†—2026-08-05verified
Licenseai.google.dev image generation docs โ†—2026-08-05verified
Public benchmark suiteai.google.dev image generation docs โ†—2026-08-05unknown
Production latencyTheRouter API docs โ†—2026-08-05unknown
Image quality rankingai.google.dev image generation docs โ†—2026-08-05unknown
Nano Banana 2 Lite is your new default Gemini image endpoint โ€” here's the routing decision frameworkblog.google โ†—2026-08-05verified
Gemini API Image Generation 2026: Fix Failed to Fetch After Preview Shutdownsai.google.dev changelog โ†—2026-08-05verified
When should I choose Gemini 3.1 Flash Image instead of Lite or Pro?ai.google.dev image generation docs โ†—2026-08-05to verify
Is google/gemini-3.1-flash-image the replacement for the preview ID?ai.google.dev changelog โ†—2026-08-05to verify
Were the snippets on this page live-verified?TheRouter API docs โ†—2026-08-05to verify
Help & contact