# Claude Code

> Two environment variables point Claude Code at TokRouter, so the terminal agent can call models from any vendor.

Claude Code speaks the Anthropic protocol. Two environment variables are enough:

```bash
export ANTHROPIC_BASE_URL="https://api.tokrouter.dev"
export ANTHROPIC_AUTH_TOKEN="sk-your-token"
```

Then run `claude` as usual. Requests go to the gateway over Anthropic Messages; `model` is supplied by
Claude Code.

## Choosing models

Claude Code uses different model tiers internally (reasoning and fast). Override the ids when needed:

```bash
export ANTHROPIC_MODEL="claude-opus-5-5"
export ANTHROPIC_SMALL_FAST_MODEL="claude-sonnet-5"
```

<Callout type="warn" title="The model must support tool use">
Claude Code depends on tool calling and long context. Prefer models with a large context window that
support tool use; a model without it fails on the first tool call.
</Callout>

## Put it in your shell profile

```bash
# ~/.zshrc or ~/.bashrc
export ANTHROPIC_BASE_URL="https://api.tokrouter.dev"
export ANTHROPIC_AUTH_TOKEN="sk-your-token"
```

Do not commit the token into a dotfiles repo; inject it at startup with `pass`, the 1Password CLI or
similar.
