If you write code in 2026, you have most likely met Claude Code already. It is Anthropic's official CLI that turns Claude into a pair programmer: it lives in the terminal, reads the repository, runs tests and edits files. After two years of iteration it has become the default agentic tool for a large part of the industry and left the IDE assistants of the early 2020s behind.
It has one rough edge: payment. Anthropic's direct API wants a US or European corporate card, monthly invoicing and a Console account. That account is awkward to share across a team, and from countries where the card form simply will not submit, it does not open at all. codexkey removes the friction. The Claude models are the same, the Anthropic-compatible endpoint is the same, and you pay as you go: with crypto, a card or SBP (the Russian Faster Payments System). Setup takes 5 minutes, there is no contract and no monthly minimum.
The guide walks through the full setup on macOS, Linux and Windows. It covers the GUI installer, persistent configuration through settings.json, model choice, spend tracking and a short list of errors you may meet on the first run.
Why route Claude Code through codexkey
Three reasons, starting with the most common:
- No Anthropic billing account. Neither a US corporate card nor a Console subscription is needed. Top up your codexkey balance by whatever payment method works in your country and use Claude Code the same minute.
- A clear price per token. codexkey matches Anthropic's rates one to one for every model. You pay exactly for the tokens used, the dashboard shows each request with an input/output/cache breakdown, and the invoice has nothing else on it.
- One key for the whole stack. The
sk_cdx_...key works with Claude Code, with Anthropic's Python and TypeScript SDKs, with the Claude Agent SDK and with any OpenAI-compatible client that speaks/v1/messagesor/v1/chat/completions. One top-up, one spend log, every tool.
If you already have an Anthropic account and it suits you, keep using it. codexkey is for developers and teams who need Claude Code without a bureaucratic detour.
Step 1: Install Claude Code
Claude Code ships as a standalone binary and as an npm package. Pick whichever is closer to your workflow.
npm (anywhere Node ≥ 18 is installed):
npm install -g @anthropic-ai/claude-code
macOS / Linux installer (no Node needed):
curl -fsSL https://claude.ai/install.sh | sh
Windows GUI installer: download claude-code-setup.exe from the official Claude Code page and run it. It adds claude to your PATH and creates a Start menu shortcut.
Check the installation:
claude --version
The output looks like claude-code 2.x.x. Command not found? Restart your shell so the new PATH is picked up.
Step 2: Point Claude Code at codexkey
Claude Code learns where to send requests and which models to use from environment variables:
ANTHROPIC_BASE_URL: the API host. By default it is Anthropic's production endpoint. To work through codexkey, set it tohttps://api.codexkey.online.ANTHROPIC_AUTH_TOKEN: your key. Replace anysk-ant-...value with thesk_cdx_...key from your codexkey dashboard.ANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL,ANTHROPIC_DEFAULT_HAIKU_MODEL: the models behind theopus,sonnetandhaikualiases. Without them Claude Code asks for its own default models and answers "There's an issue with the selected model".
macOS / Linux (zsh or bash):
export ANTHROPIC_BASE_URL="https://api.codexkey.online"
export ANTHROPIC_AUTH_TOKEN="sk_cdx_yourkeyhere"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5[1m]"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-sonnet-5"
To make the settings permanent, add these lines to ~/.zshrc, ~/.bashrc or ~/.config/fish/config.fish.
Windows PowerShell (current session):
$env:ANTHROPIC_BASE_URL = "https://api.codexkey.online"
$env:ANTHROPIC_AUTH_TOKEN = "sk_cdx_yourkeyhere"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "claude-opus-5-5[1m]"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "claude-sonnet-5[1m]"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "claude-sonnet-5"
Windows PowerShell (persistent, survives a reboot):
setx ANTHROPIC_BASE_URL "https://api.codexkey.online"
setx ANTHROPIC_AUTH_TOKEN "sk_cdx_yourkeyhere"
setx ANTHROPIC_DEFAULT_OPUS_MODEL "claude-opus-5-5[1m]"
setx ANTHROPIC_DEFAULT_SONNET_MODEL "claude-sonnet-5[1m]"
setx ANTHROPIC_DEFAULT_HAIKU_MODEL "claude-sonnet-5"
setx writes to the user environment, so close the terminal and open it again, or the new values will not be picked up. If you prefer a GUI, open System Properties → Advanced → Environment Variables and add the entries under User variables. Teammates without a technical background usually go this way, and the result is the same.
Step 3: Verify the connection
Open a new terminal so the variables load, then run:
claude --version
claude /status
claude /status makes a real request to the configured base URL and prints the active model, the account and the key prefix. Do you see api.codexkey.online in the output and a non-zero balance? Then you are done.
To test the whole chain end to end, send a one-shot prompt:
claude -p "Summarise the diff in this repo since main."
The settings.json approach (recommended for teams)
Environment variables are enough for one developer on one machine. For teams, and for machines where the setup must survive a change of shell, Claude Code's settings.json fits better. On macOS and Linux the file lives at ~/.claude/settings.json, on Windows at %USERPROFILE%\.claude\settings.json.
{
"apiBaseUrl": "https://api.codexkey.online",
"apiKey": "sk_cdx_yourkeyhere",
"defaultModel": "claude-sonnet-5",
"telemetry": false
}
The CLI reads settings.json on every launch, so you can change the model or rotate the key without touching your shell profile. On shared workstations, set the file permissions to 600 so other users of the machine cannot read your key.
Picking a model
By default Claude Code runs on Sonnet 4.6. For about 90% of tasks that is the right choice: refactoring, test generation, code review, edits across several files, debugging. Sonnet is fast enough that the work feels interactive and cheap enough that long sessions do not scare you.
For the truly hard cases, whether architectural design, a hunt for a tangled bug in a large codebase, or a situation where one Opus call replaces five Sonnet retries, switch to Opus on demand:
claude --model claude-opus-4.8 -p "Design a sharding strategy for this table."
We have Haiku: the catalog lists claude-haiku-5.5 and claude-haiku-4.5, with prices on the models page. They run in the Premium channel, and the Cheap channel has no Haiku.
For frequent low-stakes work (lint fixes, doc rewrites, commit message generation), drop down to gpt-5.6-luna:
claude --model gpt-5.6-luna -p "Rewrite this commit message."
You can also switch models inside an interactive session: type /model and pick from the list.
Tracking spend
Every request to api.codexkey.online shows up in your codexkey dashboard within a few seconds. The record shows:
- timestamp and request ID,
- the model used,
- input tokens, output tokens and cached input tokens,
- the exact dollar cost of the call,
- the API key that made the call (handy when different machines or teammates have different keys).
You can filter the records by date range, model and key, and export the ledger to CSV for accounting. There are no monthly bills, no minimum and no surprise charges. When the balance reaches zero, the next request returns 402, and you top up.
Troubleshooting
The errors you are most likely to meet on day one:
401 Unauthorized: the key is wrong or expired. Make sureANTHROPIC_AUTH_TOKENstarts withsk_cdx_and matches the value in the dashboard. If the key was recently reissued, the old one no longer works.429 Too Many Requests: you hit the per-minute request limit. Wait a few seconds and retry. Heavy parallel agents should respect theRetry-Afterheader.402 Payment Required: the balance is exhausted. Top it up in the dashboard.502 Bad Gatewayand network timeouts: a transient problem on the upstream side. Before you debug your own code, look at the status page.claudecommand not found after installation: restart your shell to pick up the newPATH. On Windows, log out and back in after the GUI installer finishes.
Bottom line
Five minutes pass between npm install and your first claude /status through codexkey. Two environment variables or one settings.json, and Claude Code works with a payment setup that actually suits you.
For the full reference with every flag, config field and supported model, see the codexkey docs on Claude Code.