Google · Checked October 13, 2026

How do I use Gemini 3.1 Pro in OpenCode or Cline?

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.

ModelGoogle's Pro model, released as a preview on February 19, 2026 and positioned by Google for software engineering and agentic work.
Model IDgoogle/gemini-3.1-pro-previewShort form gemini-3.1-pro-preview also works
Base URLhttps://api.stdcmpt.com/v1Claude Code uses https://api.stdcmpt.com
InputText and images
ReasoningAlways on; low, medium or high
Context1,048,576 input and 65,536 output tokens at GoogleA request here takes up to 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.

~/.config/opencode/opencode.json/v1/chat/completions
{
  "$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 tokensPrompt up to 200KPrompt 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 is not served; the newer Gemini 4 Argon is, as google/gemini-4-argon.

Other ways to run Gemini 3.1 Pro

Gemini APIPay per tokenFirst-party through Google AI Studio, pay per token, no free tier for this model.
Vertex AIPay per tokenGoogle Cloud billing and quotas for procurement teams.
Google AI plans with AntigravitySubscriptionAntigravity and Antigravity CLI within weekly limits; Gemini models only. Since June 18, 2026 these plans no longer cover Gemini CLI.
Standard ComputeMonthly planGemini 3.1 Pro on an Anthropic-compatible endpoint as well, so Claude Code can run it.

FAQ

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, and it scores higher and lists lower, as noted above.

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.

Is Gemini 4 Argon available on Standard Compute?

Yes, as google/gemini-4-argon. Google released it on October 13, 2026. On Google's own API it costs $2 / $10 per million tokens through November 30, 2026 and $4 / $20 from December 1. GET https://api.stdcmpt.com/v1/models lists every served ID.

Sources: Gemini API pricing; Google: Gemini 3.1 Pro Preview; Artificial Analysis: Gemini 3.1 Pro Preview; Artificial Analysis: Gemini 3.8 Flash

Create your key

Sign in, create a key in the dashboard and paste it into the config above.

Get your API key