Gemini 3.1 Pro Preview API
Call Gemini 3.1 Pro Preview from Google through Deftrouter's OpenAI-compatible endpoint: one key, the OpenAI SDK you already use, and usage tracked per key. Access is by request.
Reasoning-first Gemini preview for agentic coding and complex problem solving.
Specifications
| Provider | |
|---|---|
| Model ID | gemini-3.1-pro-preview |
| Context window | 1,048,576 tokens |
| Maximum output | 65,536 tokens |
| Input types | text, image, video, audio, PDF |
| Reasoning | Yes |
| Tool calling | Yes |
| Structured output | Yes |
| Open weights | No |
| Released | February 19, 2026 |
| Knowledge cutoff | January 2025 |
Gemini 3.1 Pro Preview API pricing
These are Google's list prices as of November 30, 2026, in US dollars per 1 million tokens. Deftrouter confirms its own price by email when you request access.
For example, a request with 10,000 input tokens and 1,000 output tokens costs about $0.032 at list price.
Call Gemini 3.1 Pro Preview with the OpenAI SDK
Point the OpenAI SDK at Deftrouter and set the model ID. The rest of your code stays the same.
from openai import OpenAI
client = OpenAI(
base_url="https://api.deftrouter.com/v1",
api_key="YOUR_DEFTROUTER_KEY",
)
# Your Deftrouter key, sent to one endpoint for every model.
reply = client.chat.completions.create(
model="gemini-3.1-pro-preview",
messages=[{"role": "user", "content": "Hello"}],
) Request Gemini 3.1 Pro Preview API access
Access is by request for now. Leave your email and the models you need, and we will email you when your key is ready.
Gemini 3.1 Pro Preview API questions
How do I get Gemini 3.1 Pro Preview API access?
Request it through Deftrouter: send the form on this page with your email, and we will email you when your key is ready. You then call Gemini 3.1 Pro Preview with the OpenAI SDK by changing the base URL and the model ID.
How much does the Gemini 3.1 Pro Preview API cost?
Google lists Gemini 3.1 Pro Preview at $2.00 per 1 million input tokens and $12.00 per 1 million output tokens as of November 30, 2026. Deftrouter confirms its own price by email when you request access.
What is the context window of Gemini 3.1 Pro Preview?
Gemini 3.1 Pro Preview accepts up to 1,048,576 tokens of context and can return up to 65,536 tokens in a single response.
Does Gemini 3.1 Pro Preview support tool calling and image input?
Gemini 3.1 Pro Preview supports tool calling. It accepts images as input.
More Google models
| Model | Context window | Input | Output |
|---|---|---|---|
| Gemini 4 Neon | 1,048,576 | $3.00 | $15.00 |
| Gemini 4 Hydrogen | 1,048,576 | $1.50 | $7.50 |
| Gemini 4 Carbon | 1,048,576 | $2.00 | $10.00 |
| Gemini 4 Argon | 1,048,576 | $2.00 | $10.00 |
| Gemini 3.8 Flash | 1,048,576 | $0.75 | $3.75 |
| Gemini 3.5 Flash Lite | 1,048,576 | $0.30 | $2.50 |
Model data from models.dev, retrieved November 30, 2026. Limits and prices are set by the provider and can change. models.dev · Google