Claude Code gateway configuration

Use this reference after activating access and creating a CAK key for the correct group.

Reviewed 2026-10-10 · Claude API documentation

Connection settings

SettingValue
ANTHROPIC_BASE_URLhttps://claudeapikey.dev
ANTHROPIC_API_KEYYour private CAK key
ModelAn ID returned by /v1/models for that key

The client adds /v1/messages to the root URL. A CAK subscription applies to the key’s selected group; it does not replace a separate Claude.ai subscription.

Verify before a coding session

Follow the full Windows and macOS/Linux setup walkthrough. It prompts for your key, checks the model list and explains how to verify a short generation request. The downloadable starter includes dependency-free Python and Node.js clients.

Credential precedence

Claude Code supports different credential sources. Use one intentional configuration and check /status if the client is billing or authenticating unexpectedly. Refer to the official gateway configuration reference for your client version.

Request failures

Check the active plan or credit group for access failures, the base URL for 404s, and parallel work for 429s. For 500 errors or dropped streams, retain the request ID and use the diagnostic guide.

Read as Markdown