# Claude Code setup

## Prerequisites and availability

Install Claude Code from its official instructions and run claude --version. This guide configures the CLI, not the Claude Desktop application. You need a U9 key, sufficient credit and a Claude model explicitly verified for Anthropic Messages, streaming and tool calls. A video model or an OpenAI-only text model cannot satisfy this requirement. The template is an integration starting point, not a certification that every Claude Code feature has been tested.

## Configure a terminal session

Replace both placeholders locally. ANTHROPIC_BASE_URL is the root address, without /v1. ANTHROPIC_AUTH_TOKEN sends the platform key as a bearer token. Remove conflicting gateway environment variables or settings before testing.

```bash
export ANTHROPIC_BASE_URL="https://u9ai.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_U9AI_API_KEY"
export ANTHROPIC_MODEL="YOUR_CLAUDE_MODEL_ID"
claude --model "$ANTHROPIC_MODEL"
```

```powershell
$env:ANTHROPIC_BASE_URL = "https://u9ai.ai"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_U9AI_API_KEY"
$env:ANTHROPIC_MODEL = "YOUR_CLAUDE_MODEL_ID"
claude --model $env:ANTHROPIC_MODEL
```
## Verify before using a project

Run /status in Claude Code and confirm the active gateway and model. Start with a short question, then test one file read and a tool-call round trip in a disposable directory. A successful /models request alone does not validate these behaviors. Small requests can incur charges.

## Persist configuration carefully

After a successful session, merge the non-secret URL and model settings into your existing user settings if needed. Keep the key in a local secret mechanism; do not commit it in .claude/settings.json or CLAUDE.md. Shell exports last only for that terminal session. A CLAUDE.md file supplies project instructions; it does not authenticate the CLI or automatically configure the gateway.

## Downloads and reference

Download [this complete guide](/en/docs/claude-code.md) or the [CLAUDE.md project instruction template](/en/docs/CLAUDE.md). Merge the template with existing project rules rather than overwriting them.

[Official gateway connection instructions](https://code.claude.com/docs/en/llm-gateway-connect) · [Official gateway compatibility](https://code.claude.com/docs/en/llm-gateway). Features such as token counting, prompt caching and background models require separate verification with the actual upstream.
