Claude Code setup guide (pending verification)
Configure the gateway endpoint and credential for Claude Code and check the connection.
Prerequisites
Pending verification. The configuration has been checked against client documentation and repository examples. End-to-end acceptance on the production line is pending. Update this status after acceptance.
Prepare the Claude Code CLI, an iRouter key, and an Anthropic Messages model and line confirmed by your administrator to support Claude Code. Record the client version with claude --version.
Configuration
Use the client’s official installation and update instructions. Complete environment setup, set the iRouter key, and preserve existing client configuration.
Set the gateway endpoint and bearer credential in the terminal that starts Claude Code. Replace <model-id> with an available model ID. Claude Code uses the gateway root endpoint.
export ANTHROPIC_BASE_URL='https://gateway.irouter.io'
export ANTHROPIC_AUTH_TOKEN="$IROUTER_API_KEY"
export IROUTER_MODEL='<model-id>'
claude --model "$IROUTER_MODEL"IROUTER_API_KEY is your iRouter key, already stored in the local environment. In PowerShell, use the following.
$env:ANTHROPIC_BASE_URL = 'https://gateway.irouter.io'
$env:ANTHROPIC_AUTH_TOKEN = $env:IROUTER_API_KEY
$env:IROUTER_MODEL = '<model-id>'
claude --model $env:IROUTER_MODELVerify
Use /status to check the endpoint and authentication, then send a short message. Confirm a reply and check the model and request in iRouter Usage details. Line acceptance also needs streaming, tool calls, and multi-turn conversations, with the client version and model ID recorded.
Troubleshooting
For authentication failures, check inherited variables and conflicts with an existing login or managed configuration. For model or protocol errors, ask your administrator to check Messages and Claude Code compatibility. Keep status codes and request identifiers in diagnostics and credentials in your local environment.
References
The official gateway guide describes environment variables, bearer authentication, and status checks. Claude Code gateway setup