How do I use Gemini 3.1 Pro in OpenCode or Cline without per-token billing?
Gemini 3.1 Pro Preview runs in OpenCode and Cline on any Standard Compute plan from $19 with the model ID google/gemini-3.1-pro-preview, billed as a fixed monthly compute budget with no Google Cloud account; when the budget hits 100%, new requests get HTTP 402. OpenCode, Cline, Kilo Code and Claude Code connect with one key; Gemini CLI cannot, because it speaks Google's own Gemini API.
| Model | Google's Pro model, released as a preview on February 19, 2026 and positioned by Google for software engineering and agentic work. It has a 1,048,576-token input window and 65,536-token max output. |
|---|---|
| Model ID | google/gemini-3.1-pro-previewShort form gemini-3.1-pro-preview also works |
| Base URL | https://api.stdcmpt.com/v1Claude Code uses https://api.stdcmpt.com |
| Input | Text and images |
| Reasoning | Always on; low, medium or high |
| Per request | About 850K input and 50K output tokens |
Copy a working config
These four agents take any OpenAI- or Anthropic-compatible endpoint. Kilo Code also needs the context size so it knows when to compact.
{
"$schema": "https://opencode.ai/config.json",
"model": "standardcompute/google/gemini-3.1-pro-preview",
"provider": {
"standardcompute": {
"npm": "@ai-sdk/openai-compatible",
"name": "Standard Compute",
"options": {
"baseURL": "https://api.stdcmpt.com/v1",
"apiKey": "{env:STANDARDCOMPUTE_API_KEY}"
},
"models": {
"google/gemini-3.1-pro-preview": { "name": "Gemini 3.1 Pro" },
"standardcompute": { "name": "Smart routing" }
}
}
}
}
Replace YOUR_API_KEY with a key from the dashboard. This config reads your key from STANDARDCOMPUTE_API_KEY; export it with a key from the dashboard. Full setup: OpenCode, Cline, Aider and other tools, Kilo Code, Claude Code.
What it costs
| Per 1M tokens | Prompt up to 200K | Prompt over 200K |
|---|---|---|
| Input | $2.00 | $4.00 |
| Cached input | $0.20 | $0.40 |
| Output | $12.00 | $18.00 |
Gemini API paid tier. Cache storage is billed on top at $4.50 per 1M tokens per hour, and Google offers no free tier for this model. Source: Gemini API pricing, checked October 13, 2026.
For agent work, check Gemini 3.8 Flash first. It is on every plan too, Artificial Analysis scores it 41 on its Intelligence Index against 30 for 3.1 Pro, and Google lists it at $0.75 / $3.75 per million tokens until December 31, 2026 ($1.50 / $7.50 from January). Gemini 3.1 Pro still fits long documents and screenshots where you want Google's Pro model.
What works differently here
- Gemini CLI has no setting for an OpenAI-compatible endpoint, and this gateway offers no Gemini API, so Gemini CLI stays on Google's billing.
- Google's API also takes audio, video and PDF for this model. Here it takes text and images.
- Thinking cannot be switched off; the lowest setting is low. Google's customtools variant and the newer Gemini 4 Argon are not served.
Other ways to run Gemini 3.1 Pro
| Gemini API$2 / $12 per 1M | First-party through Google AI Studio, pay per token, no free tier for this model. |
|---|---|
| Vertex AIPay per token | Google Cloud billing and quotas for procurement teams. |
| Google AI plans with Gemini CLISubscription | Gemini CLI within daily request limits; Gemini models only. |
| Standard ComputeMonthly plan | Gemini 3.1 Pro on an Anthropic-compatible endpoint as well, so Claude Code can run it. |
FAQ
Does Gemini 3.1 Pro work with Gemini CLI on Standard Compute?
No. Gemini CLI talks to Google's Gemini API, which this gateway does not offer. Use OpenCode, Cline, Kilo Code or Claude Code, or keep Gemini CLI on Google's own plans.
Gemini 3.1 Pro or Gemini 3.8 Flash for coding agents?
Gemini 3.8 Flash. Google describes it as engineered for long-horizon software engineering, Artificial Analysis rates it 41 against 30, and its list price is lower.
Gemini 3.1 Pro or DeepSeek V4 Flash?
For screenshots and long documents with images, Gemini 3.1 Pro, since DeepSeek V4 Flash is text-only. For plain-text tool calls, V4 Flash costs a small fraction of the price.
Is Gemini 3.1 Pro still a preview?
Yes. Google lists it as a preview model, so it can change or be retired. On Standard Compute a model you selected that leaves the catalog drops out of your selection, and the others keep serving.
Sources: Gemini API pricing; Google: Gemini 3.1 Pro Preview; Artificial Analysis: Gemini 3.1 Pro Preview; Artificial Analysis: Gemini 3.8 Flash
Plans from $19/mo
One key for Gemini 3.1 Pro and the rest of the catalog, with a monthly compute budget you can watch in the dashboard and no overage charges.