Gemini 3.1 Flash Image Preview API Pricing
As of October 10, 2026, Gemini 3.1 Flash Image Preview costs $0.045 per image on Google AI Studio, plus $0.50 per 1M input tokens. Across 2 providers on LiteLLM, the price ranges from $0.045 to $0.0672. It has a 65,536-token context window and returns up to 65,536 tokens per response.
gemini/gemini-3.1-flash-image-preview.- Per image
- $0.045
- Input
- $0.50 / 1M tokens
- Output
- $3.00 / 1M tokens
- Context window
- 65,536 tokens
- Max output
- 65,536 tokens
- Providers
- 2
- Added to LiteLLM
- March 2026
Gemini 3.1 Flash Image Preview pricing by provider
2 listings across 2 providers. Token prices are in US dollars per 1M tokens. The highlighted row is the price quoted above.
| Provider | Model name in LiteLLM | Per image | Input | Output | Image output | Cache read | Batch in | Batch out | Context |
|---|---|---|---|---|---|---|---|---|---|
| Google AI Studio | gemini/gemini-3.1-flash-image-preview | $0.045 | $0.50 | $3.00 | $60.00 | – | $0.25 | $1.50 | 64K |
| Google Vertex AI | vertex_ai/gemini-3.1-flash-image-preview | $0.0672 | $0.50 | $3.00 | $60.00 | $0.05 | $0.25 | $1.50 | 64K |
Other Gemini 3.1 Flash Image Preview prices on Google AI Studio
| Web search | $14.00 per 1K searches |
What Gemini 3.1 Flash Image Preview costs in practice
Generating 1,000 images
| Google AI Studio | $45.00 |
| Google Vertex AI | $67.20 |
Gemini 3.1 Flash Image Preview features
Input: text, image. Output: text, image.
- Function calling
- Structured output
- Image input
- Reasoning
- Prompt caching
- Web search
Use Gemini 3.1 Flash Image Preview with LiteLLM
Call Gemini 3.1 Flash Image Preview through the LiteLLM Python SDK, or put it behind the LiteLLM proxy and send OpenAI-format requests to /v1/images/generations. LiteLLM tracks the cost of every request at these prices.
from litellm import image_generation
response = image_generation(
model="gemini/gemini-3.1-flash-image-preview",
prompt="A cute baby sea otter",
)model_list:
- model_name: gemini-3.1-flash-image-preview
litellm_params:
model: gemini/gemini-3.1-flash-image-preview
api_key: os.environ/GEMINI_API_KEYcurl http://0.0.0.0:4000/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-d '{
"model": "gemini-3.1-flash-image-preview",
"prompt": "A cute baby sea otter",
"n": 1,
"size": "1024x1024"
}'Gemini 3.1 Flash Image Preview FAQ
How much does Gemini 3.1 Flash Image Preview cost?
Gemini 3.1 Flash Image Preview costs $0.045 per image on Google AI Studio, plus $0.50 per 1M input tokens. Batch requests cost $0.25 per 1M input tokens and $1.50 per 1M output tokens. Across 2 providers on LiteLLM, the price ranges from $0.045 to $0.0672.
What is the context window of Gemini 3.1 Flash Image Preview?
Gemini 3.1 Flash Image Preview has a 65,536-token context window and returns up to 65,536 tokens per response.
Which providers offer Gemini 3.1 Flash Image Preview?
Gemini 3.1 Flash Image Preview is available from 2 providers through LiteLLM: Google AI Studio and Google Vertex AI. The lowest price is on Google AI Studio.
How do I call Gemini 3.1 Flash Image Preview with an OpenAI-compatible API?
Use the LiteLLM Python SDK with model="gemini/gemini-3.1-flash-image-preview", or add the model to the LiteLLM proxy's config.yaml and send requests to /v1/images/generations from any OpenAI client. LiteLLM tracks the cost of every request at the prices on this page.
What features does Gemini 3.1 Flash Image Preview support?
Gemini 3.1 Flash Image Preview supports image input, prompt caching and web search. It does not support function calling, structured output and reasoning.
When did LiteLLM add Gemini 3.1 Flash Image Preview?
Gemini 3.1 Flash Image Preview was added to LiteLLM's model price file in March 2026.
Is Gemini 3.1 Flash Image Preview being deprecated?
Google AI Studio deprecated gemini/gemini-3.1-flash-image-preview on June 25, 2026.
Sources
Prices come from LiteLLM's open-source model_prices_and_context_window.json, which LiteLLM uses to calculate the cost of every request. Provider pricing pages:
LiteLLM docs: Google AI Studio, Google Vertex AI.
Provider pages: Google AI Studio, Google Vertex AI.
