Skip to content

Use Claude Code with Kimi K3, GLM 5.2, Qwen 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
Kimi K3kimi-k3Flagship
Qwen3.8 Max (1M context, vision)qwen3.8-maxFlagship
GLM 5.2glm-5.2Frontier
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": "glm-5.2",
"ANTHROPIC_SMALL_FAST_MODEL": "glm-5.2"
}
}

Each model has its own setup page with the right context-window settings and a model-specific FAQ:

  • 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.