Gemini 3.1 Pro (Preview) API: Endpoint & Pricing
Gemini 3.1 Pro Preview is a preview large language model from Google’s Gemini family, offering advanced reasoning and multimodal capabilities for early experimentation and feedback.
What is Gemini 3.1 Pro Preview?
Gemini 3.1 Pro Preview is an experimental version of Google’s Gemini 3.1 Pro large language model made available for limited testing. It is primarily used by developers and researchers to explore its capabilities in tasks such as code assistance, structured reasoning, and information retrieval. It is also used to prototype multimodal and agentic applications so Google can refine quality, safety, and performance. It belongs to the Gemini model family, following earlier Gemini 1.x and 2.x generations and the non-preview Gemini Pro variants.
Can you self-host Gemini 3.1 Pro Preview?
No. We found no public weights for Gemini 3.1 Pro Preview on Hugging Face, so there is nothing to download, quantize or serve on your own GPUs: no VRAM budget, no vLLM or GGUF build to plan for. The only way to run it is over an API.
Skip the deploy — use LLM.API as your endpoint
No GPUs, no quantization trade-offs. Same model, OpenAI-compatible, with custom volume discounts on request.
Providers
Different companies host the same model. OpenRouter routes your request to one of them based on the routing mode you pick — Balanced (price + speed), Nitro (fastest), or Exacto (highest tool-calling accuracy).
List price by provider
InputOutputProvider list prices; the LLM.API discount applies on top.
| Provider | Input | Output | Cache read /M | Latency | Throughput | Uptime |
|---|---|---|---|---|---|---|
| google-ai-studio | in $2; out $12 per 1M tokens | 1M tokens | vision, tools, streaming, reasoning, JSON | |||
| google-vertex | in $2; out $12 per 1M tokens | 1M tokens | vision, tools, streaming, reasoning, JSON |
Prices and availability from the LLMAPI catalogue, updated nightly. Last updated 11 Oct 2026.
Try this model
Test Gemini 3.1 Pro Preview right here — free to start.
Suggestions for your first prompt
Code snippet
Call the model through the OpenAI-compatible API.
Switching from OpenAI? Change 2 lines.
- base_url="https://api.openai.com/v1"
- api_key="YOUR_OPENAI_KEY"
+ base_url="https://api.llmapi.ai/v1"
+ api_key="YOUR_LLMAPI_KEY"Everything else stays the same — SDK, message format, tools, streaming. Set model to gemini-3.1-pro-preview and the call runs unchanged.
curl https://api.llmapi.ai/v1/chat/completions \
-H "Authorization: Bearer $LLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-pro-preview",
"messages": [
{"role": "user", "content": "Give me three crisp launch checklist items."}
],
"reasoning_effort": "low"
}'from openai import OpenAI
client = OpenAI(
api_key="YOUR_LLMAPI_KEY",
base_url="https://api.llmapi.ai/v1",
)
resp = client.chat.completions.create(
model="gemini-3.1-pro-preview",
messages=[
{"role": "system", "content": "You are a precise product assistant."},
{"role": "user", "content": "Give me three crisp launch checklist items."},
],
reasoning_effort="low",
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.LLMAPI_KEY,
baseURL: "https://api.llmapi.ai/v1",
});
const resp = await client.chat.completions.create({
model: "gemini-3.1-pro-preview",
messages: [
{ role: "user", content: "Give me three crisp launch checklist items." },
],
});
console.log(resp.choices[0].message.content);stream = client.chat.completions.create(
model="gemini-3.1-pro-preview",
messages=[{"role": "user", "content": "Write a haiku about latency."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True){
"model": "gemini-3.1-pro-preview",
"messages": [
{"role": "system", "content": "You are a precise product assistant."},
{"role": "user", "content": "Give me three crisp launch checklist items."}
],
"reasoning_effort": "low"
}ENDPOINTS
Supported endpoints & features
Base URL https://api.llmapi.ai/v1 · model ID gemini-3.1-pro-preview · OpenAI-compatible.
POST /v1/chat/completionsChat Completions — supported
| Feature | Status | How to set it |
|---|---|---|
| Function calling (tools) | Supported | tools, tool_choice |
| Parallel tool calls | Not supported | parallel_tool_calls |
| JSON mode | Supported | response_format: {"type": "json_object"} |
| Structured outputs | Not supported | response_format: {"type": "json_schema", …} |
| Streaming | Supported | stream: true |
| Vision (image input) | Supported | image_url content parts |
| Web search | Not supported | web_search |
| Reasoning effort | low · medium · high | reasoning_effort: "low" |
ERRORS
Errors & fallback routing
| Code | What it means | What to do |
|---|---|---|
401 | Missing or invalid API key. | Send Authorization: Bearer YOUR_LLMAPI_KEY and check the key is active. |
429 | Rate limited, or the upstream provider is throttling the request. | Back off and retry with jitter; the gateway also retries the request on another provider where one is available. |
5xx | Upstream provider error or timeout. | Retry; fallback routing sends the retry to the next healthy provider for this model. |
When a provider fails or throttles, the request is routed to the next provider serving this model — the ones listed in the providers table above.
Uptime
Last 30 days
30/30 days operational | 100.00% uptime
Gemini 3.1 Pro (Preview) in production
What the model is good at.
-
Advanced Reasoning
Performs complex logical reasoning and problem solving, excelling on benchmarks like ARC-AGI-2 and SWE-Bench for difficult tasks.
-
Multimodal Input
Understands text, code, images, audio, video, and PDFs within a very long context window for rich cross-modal analysis.
-
Document Comprehension
Processes and synthesizes information from large documents and datasets, supporting enterprise knowledge tasks and technical analysis.
-
Coding Assistance
Supports code understanding and generation, autonomous software engineering tasks, and tool-assisted code execution workflows.
-
Multilingual Skills
Handles multiple languages for reading and generation, enabling cross-language understanding and globally-deployed conversational applications.
What you get when you call Gemini 3.1 Pro (Preview) through LLM.API.
-
Unified AI Routing
Dynamically route each request to the optimal model across providers based on latency, cost, or quality—without changing your integration or redeploying.
One endpoint, every model -
Cost-Aware Orchestration
Control spend with per-route cost caps, dynamic model downgrades, and usage insights so you ship rich AI features without surprise bills.
Cut spend, keep quality -
Automatic Provider Fallback
If a provider throttles or fails, LLM.API seamlessly retries on backup models, keeping your AI workflows online without custom failover logic.
Resilience by default -
End-to-End Observability
Trace every request across models and providers with rich logs, metrics, and timelines to debug prompts, tune routing, and prove reliability in production.
See every token -
Task-Centric Abstractions
Call higher-level tasks—chat, RAG, tools, moderation—instead of raw models, letting LLM.API manage prompts, memory, and orchestration under a stable interface.
Code to tasks, not models -
High-Throughput Batch APIs
Process thousands of prompts in parallel with batch operations, reducing overhead, smoothing rate limits, and maximizing throughput for large-scale workloads.
Scale from day one
When to Use — When NOT to Use
Use it if...
- You need a general-purpose LLM from Google with strong text generation and understanding.
- You need good integration with other Google Cloud services and existing GCP infrastructure.
- Your use case involves multimodal inputs like combining text with images or screenshots.
- You need a model suitable for chatbots, assistants, and interactive web or mobile experiences.
- Your use case involves summarizing, classifying, or extracting information from medium-length documents.
- You need a widely supported, mainstream model with extensive community examples and tooling.
Avoid if...
- You need guaranteed mature, production-hardened behavior rather than a preview-stage model.
- Your workload requires strict, contractually defined SLAs and long-term backward compatibility guarantees.
- You need highly specialized domain performance better served by fine-tuned or niche expert models.
- Your workload requires running fully on-premise or outside Google Cloud’s managed environments.
- You need fully transparent, fine-grained control over training data, weights, and model internals.
- Your workload requires ultra-low-latency inference for high-frequency trading or hard real-time systems.
COMMUNITY
What developers say about Gemini 3.1 Pro Preview
Summarised from public developer discussions and write-ups. Opinions are the sources’, not LLM.API’s.
- Developers on Reddit report the model excels at 1-million-token document synthesis and multi-turn state retention when 'Extended Thinking' is enabled, outperforming standard modes in connecting granular details across large contexts.
- Developers note significant performance discrepancies between the Web client and API, observing that the Web version includes additional wrapper layers and system prompts that can result in lower performance.
- Early testing by developers in Google AI Studio indicates significant latency issues during launch, with simple prompts taking over 100 seconds to respond or failing due to high demand and expired deadlines.
SOURCES
Frequently Asked Questions
-
What is Gemini 3.1 Pro Preview?
Gemini 3.1 Pro Preview is a Google frontier language model optimized for high‑quality reasoning, coding, and general-purpose chat use cases.
-
What modalities does Gemini 3.1 Pro Preview support via LLM.API?
Through LLM.API, Gemini 3.1 Pro Preview currently supports text input and output, with image and other modalities exposed as the provider enables them.
-
How is Gemini 3.1 Pro Preview typically priced on LLM.API?
Gemini 3.1 Pro Preview is billed on a pay-as-you-go per-token basis, with separate input and output token rates defined by LLM.API.
-
What context window does Gemini 3.1 Pro Preview support?
Gemini 3.1 Pro Preview supports a large context window suitable for multi-thousand token prompts and long conversations, as configured by LLM.API.
-
How fast is Gemini 3.1 Pro Preview in terms of latency?
Typical latency is comparable to other large frontier models, with first-token times dependent on prompt size and current LLM.API and Google load.
-
What is Gemini 3.1 Pro Preview best suited for?
It excels at multi-step reasoning, complex code generation, data analysis, and high-quality natural language generation across many domains.
-
How do I call Gemini 3.1 Pro Preview through LLM.API?
You select the model name "google/gemini-3.1-pro-preview" (or similar identifier) in LLM.API and send standard chat or completion-style requests.
-
How does Gemini 3.1 Pro Preview compare to GPT-4.1 or Claude 3.5?
Gemini 3.1 Pro Preview targets similar advanced reasoning and coding capabilities, but performance, cost, and latency vary by task and provider configuration.
-
Does Gemini 3.1 Pro Preview support streaming responses on LLM.API?
Yes, when enabled in your LLM.API request, Gemini 3.1 Pro Preview can return tokens incrementally for lower perceived latency.
-
What are the main limitations of Gemini 3.1 Pro Preview?
It can hallucinate, may contain training-data biases, and should not be relied on for authoritative legal, medical, or safety-critical decisions.
COMPARE
Competitive Models
GPT-5.6 Terra
$2 in / $12 out per 1M tokens, 1,050,000 context — the closest current alternative to Gemini 3.1 Pro (Preview).
Qwen 3.8 Max
$2 in / $6 out per 1M tokens, 1,000,000 context — the closest current alternative to Gemini 3.1 Pro (Preview).
DeepSeek V4 Pro
$1.74 in / $3.48 out per 1M tokens, 1,048,576 context — the closest current alternative to Gemini 3.1 Pro (Preview).
Nano Banana Pro (Gemini 3 Pro Image Preview) is Google’s preview-stage image generation and editing model built on the Gemini 3 Pro family, optimized for complex, multi-turn visual creation tasks.
Gemini 3.5 Flash
Gemini 3.5 Flash is Google’s natively multimodal reasoning model optimized for very low latency and cost while maintaining frontier‑level performance, particularly for coding and agentic workflows.
Gemini 3 Flash Preview
Gemini 3 Flash Preview is a Google multimodal large language model optimized for high speed and cost‑effective performance in complex reasoning tasks. It offers long‑context understanding and strong support for agents, coding, and retrieval‑augmented applications.
Get one key to every model
Swap your API key. Keep your code.