Skip to content

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.
You wantModel idPool
GLM 5.2glm-5.2Frontier
Kimi K2.7kimi-k2.7Frontier
Kimi K2.6kimi-k2.6Frontier
MiniMax M3 (1M context)minimax-m3Frontier
DeepSeek V4 Flash (1M context)deepseek-v4-flashCore
MiMo v2.5 (1M context)mimo-v2.5Core

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 declares custom OpenAI-compatible providers in opencode.json under the top-level provider object.

  1. Subscribe to a pool and copy your subscriber key (sk-...).
  2. Create opencode.json in your project root (or your global OpenCode config) with a provider that uses the @ai-sdk/openai-compatible package:
{
"$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" }
}
}
}
}
  1. Start opencode and select one of the models under the CheapestInference provider. Add or remove entries under models to 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 is a VS Code extension with a built-in provider for OpenAI-compatible endpoints.

  1. Subscribe to a pool and copy your subscriber key (sk-...).

  2. Open Roo Code’s settings and set the API Provider to OpenAI Compatible.

  3. 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
  4. 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.

  1. Subscribe to a pool and copy your subscriber key (sk-...).
  2. Export the endpoint and key, then launch aider with an openai/-prefixed model:
Terminal window
export OPENAI_API_BASE=https://api.cheapestinference.com/v1
export OPENAI_API_KEY=sk-...
aider --model openai/kimi-k2.7
  1. To switch models, change the value after openai/, e.g. aider --model openai/glm-5.2 or aider --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.

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.