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

# Claude Code

> Configure Claude Code to use AI Gateway through the Anthropic-compatible endpoint.

<img src="https://mintcdn.com/gpuhub/GEB8Gf9uDczdNFr-/images/ide-agents-claude-code-icon.png?fit=max&auto=format&n=GEB8Gf9uDczdNFr-&q=85&s=619cd3f258c8dfc724b94ac2b85f2721" alt="" width="96" height="96" data-path="images/ide-agents-claude-code-icon.png" />

Claude Code can use AI Gateway through the Anthropic-compatible API endpoint. Configure the base URL and API key before starting Claude Code.

<Note>
  Create or copy your API key from the console before configuring Claude Code.
</Note>

## Configure Environment Variables

```bash theme={null}
export ANTHROPIC_BASE_URL=https://llm.gpuhub.com/api/v1/anthropic
export ANTHROPIC_AUTH_TOKEN=$API_KEY
```

If you do not specify a model, Claude Code uses the default model configured by the gateway. You can also route Claude Code model aliases to a specific model.

```bash theme={null}
export ANTHROPIC_DEFAULT_HAIKU_MODEL=GLM-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=GLM-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=GLM-5
```

## Start Claude Code

After the environment variables are set, start Claude Code from your project directory.

```bash theme={null}
claude
```
