# Connect Claude Code

https://omnimodel.me/apps/claude-code

> Anthropic's terminal coding agent, connected over the Anthropic Messages protocol.

## Use cases

Good for letting an agent read your project, edit files and run tests from the terminal. Claude Code speaks the Anthropic Messages protocol at `https://omnimodel.me/anthropic`, and works with any catalog model that supports tool calling, not just Claude.

## Tips

A coding agent sends many long requests per task, so pick a long-context model with tool calling and set a daily spend limit on the key.

## Reasoning effort

Claude Code sends Anthropic `thinking`. A `budget_tokens` value maps to a level (≤512 minimal, ≤1024 low, ≤8192 medium, ≤24576 high, above that xhigh). `adaptive` without an effort counts as `xhigh`; `disabled` turns reasoning off. The platform follows the levels the serving line accepts: a level the upstream rejects becomes the next higher accepted level, or its highest one. If the model cannot turn reasoning off, asking for it returns 422 `model.reasoning_off_unsupported`. Each model's table is under Reasoning effort on its page in the [catalog](/catalog?lang=en); rewritten calls show the rewrite in usage records.

## If it cannot connect

1. Set `ANTHROPIC_BASE_URL` to `https://omnimodel.me/anthropic` without `/v1`; the client appends `/v1/messages` itself.
2. The key starts with `key_` and is not paused or revoked; `auth.invalid_key` means the key cannot be used.
3. The model ID matches the [catalog](/catalog) and is in the key's allowed models.
4. `billing.insufficient_credit` means the balance is too low; see [common errors](/docs/errors?lang=en) for more.

## Setup

1. Install: npm install -g @anthropic-ai/claude-code.
2. Add the environment variables below to your shell profile (such as ~/.zshrc) and open a new terminal.
3. Run claude in your project and check the active model with /model.

## Settings

- API host：`https://omnimodel.me/anthropic`
- API key：`YOUR_API_KEY`
- Model：`MODEL_ID`

> Compatibility testing for Claude Code is still in progress; if something breaks, open a ticket with the request ID.

```bash
export ANTHROPIC_BASE_URL="https://omnimodel.me/anthropic"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_MODEL="MODEL_ID"
export ANTHROPIC_DEFAULT_OPUS_MODEL="MODEL_ID"
export ANTHROPIC_DEFAULT_SONNET_MODEL="MODEL_ID"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="MODEL_ID"
```

## FAQ

### Why set all four model variables?

Claude Code switches between model tiers during a task, for example a small model for titles. Pointing all four at one model keeps it from asking for a model name the platform does not serve.

### What if I am already signed in with a Claude subscription?

Once ANTHROPIC_AUTH_TOKEN is set, Claude Code uses it first. Remove the variables to go back to your subscription.

