OpenCode, Roo Code & Aider: pointing them at unlimited models
OpenCode, Roo Code and Aider all speak the OpenAI API, so each one can point at
CheapestInference’s
OpenAI-compatible Chat Completions endpoint at
https://api.cheapestinference.com/v1. You supply your subscriber key and a
model id, and during your reserved time blocks the tool runs with no per-token
billing — the cost is a flat monthly subscription instead of a bill that scales
with how many tokens the agent burns.
Every setup below needs the same two things:
- Base URL:
https://api.cheapestinference.com/v1 - API Key: your subscriber key (
sk-...) — subscribe to a pool and copy it from the dashboard.
Which model id to use
Section titled “Which model id to use”| You want | Model id | Pool |
|---|---|---|
| GLM 5.2 | glm-5.2 | Frontier |
| Kimi K2.7 | kimi-k2.7 | Frontier |
| Kimi K2.6 | kimi-k2.6 | Frontier |
| MiniMax M3 (1M context) | minimax-m3 | Frontier |
| DeepSeek V4 Flash (1M context) | deepseek-v4-flash | Core |
| MiMo v2.5 (1M context) | mimo-v2.5 | Core |
A subscription covers every model in its pool, so you can switch models by changing the model id — no new key, no new plan. See current pool pricing on the pools page.
OpenCode
Section titled “OpenCode”OpenCode declares custom OpenAI-compatible providers in opencode.json under the
top-level provider object.
- Subscribe to a pool and copy your
subscriber key (
sk-...). - Create
opencode.jsonin your project root (or your global OpenCode config) with a provider that uses the@ai-sdk/openai-compatiblepackage:
{ "$schema": "https://opencode.ai/config.json", "provider": { "cheapestinference": { "npm": "@ai-sdk/openai-compatible", "name": "CheapestInference", "options": { "baseURL": "https://api.cheapestinference.com/v1", "apiKey": "sk-..." }, "models": { "kimi-k2.7": { "name": "Kimi K2.7" }, "glm-5.2": { "name": "GLM 5.2" }, "deepseek-v4-flash": { "name": "DeepSeek V4 Flash" } } } }}- Start
opencodeand select one of the models under the CheapestInference provider. Add or remove entries undermodelsto expose the ids you use.
Each key under models is the exact model id sent to the API, so it must match
the table above. If you prefer not to inline the key, OpenCode also accepts
"apiKey": "{env:CHEAPESTINFERENCE_API_KEY}" and reads it from the environment.
Roo Code
Section titled “Roo Code”Roo Code is a VS Code extension with a built-in provider for OpenAI-compatible endpoints.
-
Subscribe to a pool and copy your subscriber key (
sk-...). -
Open Roo Code’s settings and set the API Provider to OpenAI Compatible.
-
Fill in the fields:
- Base URL:
https://api.cheapestinference.com/v1 - API Key: your subscriber key (
sk-...) - Model: a model id from the table above, e.g.
kimi-k2.7
- Base URL:
-
Save. Roo Code now sends every request to your pool. Change the Model field any time to switch models — no new key.
Roo Code relies on native tool calling, so use a model that supports tool calls for agentic tasks — the Frontier models are a good fit (see below).
Aider reads the endpoint and key from standard OpenAI environment variables, and
you pass the model with an openai/ prefix so it routes through the
OpenAI-compatible path.
- Subscribe to a pool and copy your
subscriber key (
sk-...). - Export the endpoint and key, then launch aider with an
openai/-prefixed model:
export OPENAI_API_BASE=https://api.cheapestinference.com/v1export OPENAI_API_KEY=sk-...aider --model openai/kimi-k2.7- To switch models, change the value after
openai/, e.g.aider --model openai/glm-5.2oraider --model openai/deepseek-v4-flash.
The --openai-api-base and --openai-api-key command-line flags work as an
alternative to the environment variables if you prefer to pass them inline.
Which model for these tools
Section titled “Which model for these tools”For agentic coding — planning edits, calling tools, iterating across files — the Frontier models are the strongest fit: Kimi K2.7 is Moonshot’s flagship agentic and coding model, and GLM 5.2 is a capable frontier coding and reasoning model. Both are in the Frontier Pool, and both support the native tool calling that Roo Code, OpenCode and Aider rely on.
If you want a cheaper option that still handles large repositories, use DeepSeek V4 Flash from the Core Pool: it pairs high speed with a 1M-token context window, so a big codebase or a long agent conversation fits in a single request. MiMo v2.5 is the other Core Pool model and also has a 1M-token context window. Pick by pool and price on the pools page.
- Unlimited during your blocks: within your reserved time blocks there are no token caps, so an agent that reads and retries a lot does not cost more. Outside your blocks, requests are rejected until the next block starts — see Unlimited Subscriptions.
- Concurrency: a subscription is sized for one active session at a time. These tools run one task at a time, which fits this model well.
- Also see: the same base URL and key work in Cline and any
other client that speaks the OpenAI API. If your tool speaks the Anthropic API
instead, use
https://api.cheapestinference.com/anthropic— see the Claude Code guide.