Claude Code setup
Claude Code runs in the terminal and as an extension for VS Code and Cursor. All three share one settings file, so you configure it once.
Setup
- Install Claude Code:
npm install -g @anthropic-ai/claude-code. Node.js 18 or newer is required. Check withclaude --version. - Open the settings file
~/.claude/settings.json. On Windows it is%USERPROFILE%\.claude\settings.json. Create the folder if it does not exist. - Paste the configuration and put in your key from the API Keys section of the dashboard:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.claudexia.tech",
"ANTHROPIC_AUTH_TOKEN": "sk_cdx_YOUR_KEY",
"ANTHROPIC_MODEL": "claude-sonnet-5[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-5",
"CLAUDE_CODE_SUBAGENT_MODEL": "claude-sonnet-5"
}
}- Run
claude.
Important: The base URL has no /v1.
The ANTHROPIC_DEFAULT_* lines are required. Without them Claude Code asks for its own default models and fails with "There's an issue with the selected model".
What the variables do
| Variable | Purpose |
|---|---|
ANTHROPIC_BASE_URL | Claudexia API address, without /v1. |
ANTHROPIC_AUTH_TOKEN | Your Claudexia key. |
ANTHROPIC_MODEL | The model Claude Code starts with. |
ANTHROPIC_DEFAULT_OPUS_MODEL | Model for the opus alias. |
ANTHROPIC_DEFAULT_SONNET_MODEL | Model for the sonnet alias. |
ANTHROPIC_DEFAULT_HAIKU_MODEL | Model for light background tasks (the haiku alias). |
CLAUDE_CODE_SUBAGENT_MODEL | Model used by subagents. |
Sonnet 5 handles background tasks because it is available in both channels. The catalog also has claude-haiku-4.5: it is cheaper and has a 200K context. You can use it if your key runs on Premium. Haiku is not in the Cheap channel, where such a request returns model_not_in_channel.
Instead of the file, you can set the same variables in your shell environment.
1M context
Without a suffix Claude Code treats the model as 200K and compacts history at about 190K. The [1m] suffix unlocks the full 1M, for example claude-opus-5-5[1m]. It is needed only in Claude Code and only for models with a 1M context. In other tools, write the model name without it.
Model and reasoning
Switch models with /model claude-opus-5-5[1m]. Any model from the catalog works, including GPT and Gemini, for example gpt-6-astra.
For deeper reasoning, add think, think hard or ultrathink to your prompt. You can also set a budget with MAX_THINKING_TOKENS=12000.
When something goes wrong
Claude Code asks you to sign in to an Anthropic account
Close Claude Code and start it again: settings are read at startup. If it still asks, check ANTHROPIC_BASE_URL: it must have no typos and no /v1.
Model not found
Check the model name in the catalog: it is written exactly as in the ID column.
Error 401
The key must start with sk_cdx_ and be active in the API Keys section. Other codes are listed in the error reference.