> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkmodel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Configure Claude Code to route Anthropic-compatible Messages requests through LinkModel.

Claude Code can route Anthropic-format requests through a custom base URL.

## Configure

Set your LinkModel key and Claude Code endpoint variables before launching `claude`:

```bash theme={null}
export LINKMODEL_API_KEY="<YOUR_API_KEY>"
export ANTHROPIC_BASE_URL="https://api.linkmodel.ai/v1"
export ANTHROPIC_AUTH_TOKEN="$LINKMODEL_API_KEY"
export ANTHROPIC_MODEL="claude-opus-4-7"

claude
```

Use a model available on the [Messages endpoint](/api-reference/chat/anthropic-messages). Anthropic-family models are the safest first choice for Claude Code because the request format is Anthropic-native.

## Custom Model Picker

If your Claude Code version supports custom model picker entries, expose a LinkModel model with:

```bash theme={null}
export ANTHROPIC_CUSTOM_MODEL_OPTION="claude-opus-4-7"
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="Claude Opus 4.7 via LinkModel"
export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="LinkModel Anthropic-compatible Messages endpoint"
```

Then open Claude Code and choose the custom model entry.

## Notes

* `ANTHROPIC_AUTH_TOKEN` is sent as the bearer token value.
* `ANTHROPIC_BASE_URL` changes where Claude Code sends Anthropic API requests.
* If a selected model fails on tool-use fields, switch models or remove the custom endpoint.

## Official Reference

* [Claude Code environment variables](https://code.claude.com/docs/en/env-vars)
* [Claude Code authentication](https://code.claude.com/docs/en/team)
