Skip to content
GoogleImageChatgemini-3.1-flash-image-preview

Gemini 3.1 Flash Image (Preview) API

Per image
$0.045–$0.151
Context
131K
No gateway feesEvery Gemini model's pricePay-as-you-go only

Gemini 3.1 Flash Image (Preview) for OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses.

Explore Gemini 3.1 Flash Image (Preview) for OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses through the unified API. Supported interfaces and current availability are shown below.

  • OpenAI-style Image Generation
  • Image editing
  • OpenAI-style Chat Completions
  • Anthropic-style Messages
  • OpenAI-style Responses

Model details

Context window
131K tokens
Max output
33K tokens
Input
Text, images
Output
Text, images
Capabilities
Vision, Streaming
Interfaces
OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses

Gemini 3.1 Flash Image (Preview) API pricing

What each generation costs. The Inferray price is what you are charged — no gateway fee is added on top of it.

Gemini 3.1 Flash Image (Preview) pricing.
ResolutionPrice
0.5K / image$0.04482
1K / image$0.0672
2K / image$0.1008
4K / image$0.1512
/ 1M input tokens$0.5
/ 1M output tokens$3
/ 1M image input tokens$0.5

What Gemini 3.1 Flash Image (Preview) costs per batch

Typical workloads at list price, worked out from the rates above. Nothing is added on top.

WorkloadTokensCost
100 images at 0.5K$0.045 × 100$4.48
1,000 images at 0.5K$0.045 × 1,000$44.82
100 images at 1K$0.067 × 100$6.72
1,000 images at 1K$0.067 × 1,000$67.20
100 images at 2K$0.101 × 100$10.08
1,000 images at 2K$0.101 × 1,000$101
100 images at 4K$0.151 × 100$15.12
1,000 images at 4K$0.151 × 1,000$151

Gemini 3.1 Flash Image (Preview) is pay-as-you-go only

Gemini 3.1 Flash Image (Preview) is not included in Token Plans. Call it from a pay-as-you-go balance at the list price above, with no gateway fee.

Why teams pick it

  • Gemini 3.1 Flash Image (Preview) for OpenAI-style Image Generation, Image editing, OpenAI-style Chat Completions, Anthropic-style Messages, OpenAI-style Responses.

Call Gemini 3.1 Flash Image (Preview)

Gemini 3.1 Flash Image (Preview) answers on any of the APIs below — pick the one your code already speaks and just swap in your Inferray key.

/v1/images/generationsOpenAI-style Image Generation · openai SDK or plain HTTP
curl https://api.inferray.com/v1/images/generations \
  -H "Authorization: Bearer inferray_..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-image-preview",
  "prompt": "A quartz crystal on a workbench"
}'
/v1/images/editsImage editing · openai SDK or plain HTTP
curl https://api.inferray.com/v1/images/edits \
  -H "Authorization: Bearer inferray_..." \
  -F 'model=gemini-3.1-flash-image-preview' \
  -F 'prompt=Make the background blue' \
  -F 'image=@input.png'
/v1/chat/completionsOpenAI-style Chat Completions · openai SDK or plain HTTP
curl https://api.inferray.com/v1/chat/completions \
  -H "Authorization: Bearer inferray_..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-image-preview",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}'
/v1/messagesAnthropic-style Messages · @anthropic-ai/sdk SDK or plain HTTP
curl https://api.inferray.com/v1/messages \
  -H "Authorization: Bearer inferray_..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-image-preview",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}'
/v1/responsesOpenAI-style Responses · openai SDK or plain HTTP
curl https://api.inferray.com/v1/responses \
  -H "Authorization: Bearer inferray_..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-image-preview",
  "input": "Hello"
}'

Conversation compaction is also available at POST /v1/responses/compact.

More from Google

Alternatives to Gemini 3.1 Flash Image (Preview)

Questions about this model

How much does the Gemini 3.1 Flash Image (Preview) API cost?
Gemini 3.1 Flash Image (Preview) costs $0.045 per image at 0.5K, $0.067 per image at 1K, $0.101 per image at 2K, $0.151 per image at 4K on Inferray. That is the list price, with no gateway fee on top.
Is there a free tier for Gemini 3.1 Flash Image (Preview)?
No. You add credit and pay Gemini 3.1 Flash Image (Preview)'s list rate for each request — seats, projects, and API keys are free, and pay-as-you-go credit never expires.
Am I charged for failed requests?
No. A request that fails without returning a result is not billed. If a response fails part-way, the tokens already processed before the failure are charged.
Is Gemini 3.1 Flash Image (Preview) included in Token Plans?
No. Gemini 3.1 Flash Image (Preview) is pay-as-you-go only; Token Plans cover the other models in the catalog.
Is it the real Gemini 3.1 Flash Image (Preview)?
Yes. A request for gemini-3.1-flash-image-preview is answered by Gemini 3.1 Flash Image (Preview) from Google, billed at its published list price. Inferray never substitutes a different or smaller model.

Prices from the catalog as of November 12, 2026.