Gemini 3.1 Pro Preview
AvailableGemini 3.1 Pro Preview is the Pro-tier model in Google’s Gemini 3.1 line, released in preview on 19 February 2026.
Good for Coding agents · Hard reasoning · Long context · Images and screenshots
Is it right for you?
Google lists a 1M-token context and up to 65,536 tokens per reply, with text, image, video, audio and PDF input. Reasoning stays on at low, medium or high effort, with high as the default. Google also lists a separate gemini-3.1-pro-preview-customtools endpoint, tuned to prefer custom tools such as file viewing or code search.
Best for
- Harder reasoning, planning and debugging where you want a Pro tier.
- Large inputs: 1M-token context with text, image, video, audio and PDF.
- Agent work with function calling, code execution and structured output.
Not ideal for
- Anything that needs a stable model. It is a preview and may change or be retired.
- Cheap, high-volume calls. Google lists a higher rate for long prompts on this model, so large prompts cost more.
Next to the rest of the Google line
| Model | Input | Output | Context | Per session |
|---|---|---|---|---|
| Gemini 3 Flash Preview | $0.5757 | $3.4545 | 977K | $0.2004 |
| Gemini 3.1 Flash-Lite | $0.2879 | $1.7272 | 977K | $0.1029 |
| Gemini 3.1 Pro Preview (this page) | $2.3030 | $13.8178 | 195K | $0.8014 |
| Gemini 3.6 Flash | $0.8636 | $4.3181 | 977K | $0.2746 |
| Gemini 3.8 Flash | $0.8636 | $4.3181 | 977K | $0.2746 |
What it costs
Prepaid, per token, no subscription. Set your traffic to see your bill.
30 days, at today's prices. You're billed on actual tokens.
- Per request
- $0.014647
- Coding session
- $0.80
- Per day
- $29.29
- Suggested key budget
- $1,015.00
- Alert at 80%
- $812.00
A coding session is 30 requests of 20,000 input tokens, 80% from cache, and 1,000 output tokens each: the same session as the "Per session" column above. Thinking tokens are billed as output, so reasoning raises the cost.
Provider list price (Google): Google lists a higher rate for long prompts than for shorter ones.
Cached input. When the provider serves part of a prompt from its cache, those tokens are billed at the cache-read price instead of the input price. Writing a prompt into the cache is billed at the cache-write price. Separately, an exact repeat of a recent request is answered from Yunshu’s own cache and not charged.
Capabilities
What Gemini 3.1 Pro Preview can do, as Google lists it.
Get started
Create a key in the console, export it as YUNSHU_API_KEY, then use one of these.
curl https://api.yunshurouter.com/v1/chat/completions \
-H "Authorization: Bearer $YUNSHU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-pro-preview",
"messages": [{"role": "user", "content": "Write a Python function that checks if a string is a palindrome."}]
}'curl https://api.yunshurouter.com/v1/messages \
-H "x-api-key: $YUNSHU_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-pro-preview",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Write a Python function that checks if a string is a palindrome."}]
}'from openai import OpenAI
client = OpenAI(base_url="https://api.yunshurouter.com/v1", api_key="YOUR_YUNSHU_KEY")
resp = client.chat.completions.create(
model="gemini-3.1-pro-preview",
messages=[{"role": "user", "content": "Explain what this regex does: ^\\d{3}-\\d{4}$"}],
)
print(resp.choices[0].message.content)import anthropic
client = anthropic.Anthropic(base_url="https://api.yunshurouter.com", api_key="YOUR_YUNSHU_KEY")
msg = client.messages.create(
model="gemini-3.1-pro-preview",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain what this regex does: ^\\d{3}-\\d{4}$"}],
)
print(msg.content[0].text)Full steps for each tool: integration guides →
Questions
What is Gemini 3.1 Pro Preview?
Gemini 3.1 Pro Preview is Google’s Pro-tier model in the Gemini 3.1 line, available as a preview. It is built for harder reasoning and agent work than the Flash models. It is a preview model, so Google may change or retire it. See the Google page for the rest of the family.
Does Gemini 3.1 Pro Preview support tool calling?
Yes. Send tools in OpenAI format to /v1/chat/completions or in Anthropic format to /v1/messages. Through the Responses API (used by Codex) only function tools are passed through.
Does Gemini 3.1 Pro Preview support reasoning?
Yes, and Google documents no way to turn it off; you choose the effort. Google lists low, medium and high, with high as the default.
How is Gemini 3.1 Pro Preview different from Gemini 3.8 Flash?
Gemini 3.8 Flash is newer and is a stable Flash model; this one is an older Pro-tier preview. Both list a 1M-token context and up to 65,536 output tokens. Google lists computer use as supported on 3.8 Flash but not on this model. This model defaults to high thinking and 3.8 Flash defaults to medium. Google lists a long-prompt price tier here and none for 3.8 Flash. Pick this model when you want the Pro tier and accept preview terms; otherwise pick 3.8 Flash.