Claude Code
Run Claude Code with a Claudech key.
- Four environment variables
- macOS, Linux and Windows
- Pay per token
Setup
Set the variables, then run claude
Paste your sk- key in place of sk-... . API access unlocks after your first purchase.
export ANTHROPIC_BASE_URL="https://api.claudech.com"
export ANTHROPIC_AUTH_TOKEN="sk-..."
export ANTHROPIC_MODEL="claude-fable-5-1"
export ANTHROPIC_SMALL_FAST_MODEL="claude-sonnet-5"
claudeMessages format
Claude Code talks to POST /v1/messages. Claudech serves that format directly, with streaming and tool use, so no proxy is needed.
Main and fast model
ANTHROPIC_MODEL is the main model. ANTHROPIC_SMALL_FAST_MODEL handles background and quick tasks, so a faster model there keeps sessions responsive.
Recent releases handled
Requests from newer Claude Code releases, such as system text inside messages and adaptive thinking settings, are normalised automatically.
Models
Model ids for Claude Code
Use any of them as ANTHROPIC_MODEL or switch with /model. Prices are per million tokens.
| Model id | Max output | Input / 1M | Cached input / 1M | Output / 1M |
|---|---|---|---|---|
claude-opus-5-5Fast and capable | 66K tokens | $0.50 | $0.010 | $1.90 |
claude-fable-5-1Advanced reasoning | 131K tokens | $0.50 | $0.010 | $1.90 |
claude-opus-5Deep reasoning | 131K tokens | $0.50 | $0.010 | $1.90 |
claude-sonnet-5Fast responses | 33K tokens | $0.50 | $0.010 | $1.90 |
Estimate a month of agent usage with the AI API cost calculator. Using Cursor as well? See Cursor with Claudech.
FAQ
Frequently asked questions
Which base URL does Claude Code need?
https://api.claudech.com, with nothing after it. Claude Code adds /v1/messages itself. Do not use the OpenAI-format address ending in /v1 or /v1/chat/completions.
ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY?
Either works with Claudech. ANTHROPIC_AUTH_TOKEN is sent as an Authorization: Bearer header and ANTHROPIC_API_KEY as x-api-key. Set one of them, not both.
Can I switch models inside Claude Code?
Yes. Run /model and type any Claudech model id from the table above. ANTHROPIC_MODEL sets the default for new sessions.
How do I make the settings permanent?
Add the variables to your shell profile, or put them under "env" in ~/.claude/settings.json so they apply to every session. The setup guide has a ready-made settings.json.
How am I billed?
Every request Claude Code makes is billed per token from your Claudech balance at the rates above. Agent sessions send long prompts, so prompt caching matters: cached input is billed at the much lower cached rate automatically.
Is Claudech part of Anthropic?
No. Claude Code is Anthropic’s command-line tool. Claudech is an independent service, not affiliated with or endorsed by Anthropic, that implements the Messages request format Claude Code speaks.
Start a Claude Code session on Claudech
Create an account, buy any token package to unlock API keys, set four variables and run claude.