Skip to content

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.

  1. Subscribe to a pool and copy your subscriber key (sk-...) from the dashboard.
  2. Export these variables in your shell (or put them in your shell profile):
Terminal window
export ANTHROPIC_BASE_URL="https://api.cheapestinference.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="sk-..." # your subscriber key
export ANTHROPIC_MODEL="glm-5.2" # any model in your pool
export ANTHROPIC_SMALL_FAST_MODEL="glm-5.2"
  1. Start claude as usual. All requests now run against your pool.
You wantSet ANTHROPIC_MODEL toPool
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 variable — no new key, no new plan.

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 thinking content 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.