Use Gemini 4 Argon in OpenCode
Gemini 4 Argon is the first Gemini 4 model, made generally available by Google on 2026-10-13. Its API ID is gemini-4-argon. The official Google API price is $2 per million input tokens and $10 per million output tokens. That is an introductory price valid until 2026-11-30; after that it returns to $4 / $20.
The short answer for OpenCode users: Argon already works in OpenCode through the Google API, OpenCode Zen, and gateways that speak the Gemini protocol. The model is the same everywhere; the price is not. For pay-as-you-go coding agents the difference adds up quickly. The AI Code With channel this site partners with bills at 19% of the official price: $0.38 / $1.90.
Model ID and specs
| Item | Value |
|---|---|
| API ID | gemini-4-argon |
| Release | Announced 2026-09-30, generally available in the Gemini API on 2026-10-13 (paid tier only) |
| Context | 1,048,576 tokens, shared by input, thinking and output |
| Max output | 65,536 tokens by default; long decode can use the rest of the window |
| Thinking levels | low, medium, high; default medium |
| Input | Multimodal: text, images, documents, video |
Sources: Google's announcement (opens in a new tab) and kingy.ai's summary of the Gemini API docs (opens in a new tab). Thinking tokens are billed at the output rate, so high raises output cost noticeably.
Gemini 4 Argon pricing
USD per million tokens.
| Channel | Input | Output | Cache read |
|---|---|---|---|
| Google, until 2026-11-30 (introductory) | $2 | $10 | $0.10 |
| Google, after 2026-11-30 | $4 | $20 | not published |
| OpenCode Zen | $2 | $10 | $0.10 |
| AI Code With channel (81% off) | $0.38 | $1.90 | — |
The Zen price is the current models.dev entry; the Zen page is authoritative. The AI Code With console prices in CNY (¥2.736 / ¥13.68), converted at the console's rate of about 7.2 CNY per USD. Its documentation says billing is "official unit price × channel discount". Under that rule, once the official price returns to $4 / $20, the channel price would be $0.76 / $3.80; check the console for the actual figure.
What one coding task costs
OpenCode resends the system prompt, tool definitions, file contents and conversation history on every call, so input tokens far exceed output. Assume a medium task with 30 model calls, each with 80K input and 4K output tokens (thinking included): 2.4M input and 120K output in total.
| Channel | Calculation | Cost |
|---|---|---|
| Google (introductory) | 2.4 × $2 + 0.12 × $10 | $6.00 |
| Google (after Nov 30) | 2.4 × $4 + 0.12 × $20 | $12.00 |
| AI Code With channel | 2.4 × $0.38 + 0.12 × $1.90 | $1.14 |
Caching is not included; cache hits lower input cost on every channel. Use your provider's usage log for real token counts.
Connect Argon in OpenCode
OpenCode's model catalog comes from models.dev, where Google, Zen, GitHub Copilot and others already list Argon. If it is missing from /models, upgrade OpenCode first. Pick one route:
| Route | Model value in opencode.json | Billed by |
|---|---|---|
| Google AI Studio API key | google/gemini-4-argon | Your Google account, official price |
| OpenCode Zen | opencode/gemini-4-argon | Zen |
| GitHub Copilot | github-copilot/gemini-4-argon | Your Copilot plan and org policy |
| AI Code With | aicodewith-gemini/gemini-4-argon | Channel price, 19% of official |
Route 1: Google API
Run /connect in OpenCode, choose Google and paste a Google AI Studio (opens in a new tab) API key. Argon is paid-tier only: a free-tier key will not show it in /models, or will return a permission error. After connecting, pick Gemini 4 Argon with /models, or set it in config:
{
"$schema": "https://opencode.ai/config.json",
"model": "google/gemini-4-argon"
}Route 2: OpenCode Zen
Run /connect, choose OpenCode Zen and use the model value opencode/gemini-4-argon. Endpoints and team settings are in the Zen docs.
Route 3: AI Code With (81% off)
- Sign up with the button on this page, create a key under API keys in the console, and confirm the Gemini channel is enabled under Channels.
- Run
export AICODEWITH_API_KEY=your-keyin your terminal. Do not put the key in project files. - Save the config below as
opencode.jsonin the project root, startopencodeand pick Gemini 4 Argon with/models.
{
"$schema": "https://opencode.ai/config.json",
"model": "aicodewith-gemini/gemini-4-argon",
"provider": {
"aicodewith-gemini": {
"npm": "@ai-sdk/google",
"name": "AI Code With Gemini",
"options": {
"baseURL": "https://api.aicodewith.ai/gemini_cli/v1beta",
"apiKey": "{env:AICODEWITH_API_KEY}"
},
"models": {
"gemini-4-argon": {
"name": "Gemini 4 Argon",
"limit": { "context": 1048576, "output": 65536 }
}
}
}
}
}This endpoint speaks the native Gemini protocol, so it uses @ai-sdk/google, not an OpenAI-compatible adapter. limit tells OpenCode the model's context and output caps. If you also use Claude through this channel, put this provider and the aicodewith-anthropic block from the API platform page in the same provider object.
Choose a thinking level
OpenCode ships low and high variants for Google models, which you can switch with the variant_cycle keybind (see variants). Without a variant, the model default medium applies.
- Large refactors and cross-module debugging:
high. - Copy edits, adding tests, small fixes:
low. Thinking tokens are billed as output, so do not pay for them here. - If a custom provider does not show variants, add them as custom variants.
Gemini 4 Argon benchmarks
These results are self-reported by Google, taken from the announcement and the vendor table transcribed by kingy.ai (opens in a new tab). Argon was run at its highest thinking level with a single attempt; competitor scores come from mixed sources. This site did not run these tests.
| Benchmark (task) | Gemini 4 Argon | Claude Opus 5.5 | GPT-6 Astra | Claude Fable 5.1 |
|---|---|---|---|---|
| DeepSWE v1.1 (software engineering) | 77.9% | 74.2% | 74.1% | 67.4% |
| FrontierSWE v2 (software engineering) | 55.0% | 62.3% | 65.5% | 56.3% |
| Terminal-bench 4.0 (terminal tasks) | 57.4% | 66.4% | 58.2% | 57.9% |
| PostTrainBench (10 hours in OpenCode) | 45.3% | 49.3% | 44.3% | 40.2% |
| GraphWalks 256K–1M (long context, F1) | 84.2% | 66.8% | 71.8% | 65.0% |
What this means for coding:
- In PostTrainBench Google ran all four models in OpenCode with the same setup, so this row is closest to how OpenCode users work. Argon trails Opus 5.5 slightly and beats GPT-6 Astra and Fable 5.1.
- The long-context lead is large. For finding things in big repositories or long documents, Argon is worth trying first.
- On long terminal tasks (Terminal-bench), Opus 5.5 still leads by about 9 points.
- During the introductory period Argon's official price is half of Opus 5.5. At the channel price it costs $0.38 / $1.90, the same as Sonnet 5.5 on this channel.
Benchmarks do not include your repository, rules or tools. Before changing your default model, run the same task on each candidate and compare results and actual spend.
Troubleshooting
- Argon missing from
/models: OpenCode is outdated and its catalog has not refreshed; with a Google key, also check that the account is on the paid tier. - 404 or unknown model: use the exact ID
gemini-4-argon, not the display name, and make sure the provider prefix matches the provider ID in your config. - 401: check that the environment variable is set in the same terminal that starts
opencode. - Long output cut off: the default synchronous output cap is 65,536 tokens. Split the task or ask the model to write files in parts.
- Higher bill than expected: check the thinking level;
highproduces many thinking tokens billed as output. Also note the official price doubles after Nov 30. - 429 or timeouts: see model connection troubleshooting.
Related pages
- API platform: Claude, GPT and Gemini channel prices
- Models: default model, variants and model options.
- Providers: writing a custom provider.
- Claude Haiku 5.5 pricing and setup
- Model connection troubleshooting