Use Claude Code with GLM 5.2, Kimi K2.7 or DeepSeek
Claude Code works with CheapestInference out of the box: the API exposes an Anthropic-compatible Messages endpoint, so you only need to set two environment variables and pick a model. During your reserved time blocks, usage is unlimited — no per-token billing.
Setup (2 minutes)
Section titled “Setup (2 minutes)”- Subscribe to a pool and copy your
subscriber key (
sk-...) from the dashboard. - Export these variables in your shell (or put them in your shell profile):
export ANTHROPIC_BASE_URL="https://api.cheapestinference.com/anthropic"export ANTHROPIC_AUTH_TOKEN="sk-..." # your subscriber keyexport ANTHROPIC_MODEL="glm-5.2" # any model in your poolexport ANTHROPIC_SMALL_FAST_MODEL="glm-5.2"- Start
claudeas usual. All requests now run against your pool.
Which model id to use
Section titled “Which model id to use”| You want | Set ANTHROPIC_MODEL to | 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 variable — no new key, no new plan.
Per-project configuration
Section titled “Per-project configuration”To pin a project to a specific model without touching your global shell
profile, create .claude/settings.json in the project:
{ "env": { "ANTHROPIC_BASE_URL": "https://api.cheapestinference.com/anthropic", "ANTHROPIC_AUTH_TOKEN": "sk-...", "ANTHROPIC_MODEL": "kimi-k2.7", "ANTHROPIC_SMALL_FAST_MODEL": "kimi-k2.7" }}- Unlimited during your blocks: within your reserved time blocks there are no token caps. Outside your blocks, requests are rejected until the next block starts — see Unlimited Subscriptions.
- Thinking: models that emit reasoning surface it through the standard
Anthropic
thinkingcontent blocks, so Claude Code renders it natively. - Other coding agents: the same two variables work for any tool that
speaks the Anthropic API. Tools that speak the OpenAI API instead (Cline,
Aider, OpenCode, Cursor with a custom endpoint) should use
https://api.cheapestinference.com/v1— see Chat Completions.