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

# Claude Code

> Connect Claude Code to the LLM Gateway

You need an [LLM Gateway key](https://docs.getunbound.ai/llm-gateway/keys.md#create-a-key).

## Setup

Add the gateway to `~/.claude/settings.json`:

```json ~/.claude/settings.json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.getunbound.ai",
    "ANTHROPIC_AUTH_TOKEN": "<your-key>"
  }
}
```

Leave `/v1` off the base URL. Claude Code adds it.

> [!WARNING]
>
> Keep the key in `~/.claude/settings.json`, not in a project's `.claude/settings.json`. Project settings are often committed to git.

## Choose models

Set any of these in the same `env` block, to a model or [alias](https://docs.getunbound.ai/llm-gateway/models.md#aliases):

| Variable | Sets |
| - | - |
| `ANTHROPIC_MODEL` | The model Claude Code starts with |
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | The model behind **Opus** in `/model` |
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | The model behind **Sonnet** in `/model` |
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | The model behind **Haiku** in `/model`, also used for background tasks |

To also list the gateway's Claude models in `/model`, add `"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"`. Claude Code lists only names that contain `claude` or `anthropic`, so set aliases with the variables above.

## Check it works

Start `claude` and send a prompt. In **LLM Gateway → Keys**, the key's **Last Used** updates.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.