How to use OpenCode cheaper without a subscription
OpenCode is a fast, open-source terminal coding agent — but the model bill behind it can creep up quickly. If you are paying a flat monthly subscription to a single provider, you are likely overpaying for tokens you never use and locking yourself into one model family. Here is how to run OpenCode cheaper, with no subscription and no commitment.
The hidden cost of subscriptions
Most coding-agent pricing falls into two traps:
- Flat monthly plans charge you whether you ship 10 lines or 10,000. Light weeks are pure waste.
- Single-provider lock-in means you pay premium-model prices even for trivial edits that a cheaper model handles fine.
The fix is simple: pay only for the tokens you actually send, and pick the right model per task. That is exactly what a usage-based, multi-model gateway gives you.
Use one key for every model
AnyModel is a single OpenAI-compatible endpoint that reaches GPT, Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. One base URL, one API key, every model:
base_url: https://anymodel.org/v1
Switching models is just changing the model id in your request — nothing else. That means you can route heavy refactors to a frontier model and quick autocompletes or commit messages to a cheaper one, all from the same OpenCode config. No second account, no second invoice.
There is no subscription and no minimums — you pay per token. And you can start free: you get 1,000,000 tokens on signup with no credit card, rising to a total of 6,000,000 tokens if you link Telegram. That is enough to run real OpenCode sessions before you spend a cent.
Set it up in OpenCode
OpenCode is one of the tools with a one-line installer. Drop in your AnyModel key and it wires up the endpoint for you:
bash <(curl -fsSL "https://anymodel.org/i?tool=opencode") <YOUR_API_KEY>
That is the whole setup. The same one-liner pattern works for codex, claude (use tool=claude for Claude Code), and hermes. If you also use editor clients like Cursor, Windsurf, Zed, Cline, Aider, or Continue, configure them manually as an OpenAI-compatible provider with the same base URL and key.
Pick cheaper models per task
The biggest savings come from matching the model to the job. A rough strategy:
| Task | Suggested model class |
|---|---|
| Large refactors, architecture, tricky bugs | A frontier model (top-tier GPT / Claude / Gemini) |
| Routine edits, tests, boilerplate | A mid-tier model |
| Commit messages, renames, quick Q&A | A budget model (DeepSeek, Qwen, GLM, Kimi) |
Because the model id is the only thing that changes, you can experiment freely. Not sure which model wins on price-versus-quality for your stack? The compare page lays out the options side by side so you can choose deliberately instead of defaulting to the most expensive one.
A quick cost sanity check
Subscriptions feel cheap until you do the math. Ask yourself:
- How many days last month did I actually use the agent?
- On those days, did most prompts really need a frontier model?
- Would token-metered billing have cost less than my flat fee?
For most developers who code in bursts, pay-per-token wins — you stop paying for idle weeks entirely.
Keep prompts off our servers
If you work on private or client code, enable Ghost Mode: opt-in, zero-retention API keys where your prompts and responses are not stored on our side — only a token counter remains for billing. To be clear, this is not "100% privacy": the underlying model provider still receives your prompt to generate a response. But it removes our side of the equation entirely.
The bottom line
Running OpenCode cheaper does not require a subscription or a tradeoff in capability. With one OpenAI-compatible key you get every major model, usage-based pricing, and the freedom to route each task to its most cost-effective model. Start with the free tokens, measure your real usage, and only pay for what you ship. For more setup walkthroughs and model breakdowns, browse the blog.
Ready to cut your OpenCode bill? Create a free AnyModel account — 1,000,000 tokens to start, no card required.
AnyModel