# 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.

- Page: https://models.litellm.ai/models/gemini-3.1-flash-image-preview
- Lab: Google
- LiteLLM model name: `gemini/gemini-3.1-flash-image-preview`
- Context window: 65,536 tokens
- Max output: 65,536 tokens
- Added to LiteLLM: March 2026
- Deprecation date: June 25, 2026
- Prices updated: October 10, 2026

## Pricing by provider

Token prices in USD per 1M tokens.

| Provider | Model name | Input | Output | Cache read | Per image | Per second | Context |
|---|---|---|---|---|---|---|---|
| Google AI Studio | `gemini/gemini-3.1-flash-image-preview` | $0.50 | $3.00 | – | $0.045 | – | 64K |
| Google Vertex AI | `vertex_ai/gemini-3.1-flash-image-preview` | $0.50 | $3.00 | $0.05 | $0.0672 | – | 64K |

## Cost examples

Generating 1,000 images:

- Google AI Studio: $45.00
- Google Vertex AI: $67.20

## Features

Supported: Image input, Prompt caching, Web search.
Not supported: Function calling, Structured output, Reasoning.

## Use it with LiteLLM

```python
from litellm import image_generation

response = image_generation(
    model="gemini/gemini-3.1-flash-image-preview",
    prompt="A cute baby sea otter",
)
```

## 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.

Source: LiteLLM model price file, https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json
