Claude Code Integration
Claude Code is Anthropic's official CLI coding agent. Sozdai exposes an Anthropic-compatible Messages API, so you can point Claude Code at Sozdai and use real Claude models at lower cost — no code changes needed.
#How it works
Claude Code talks to the Anthropic Messages API. Setting three environment variables — base URL, auth token, and an empty API key — points every request at the Sozdai API, which serves it and bills your Sozdai balance.
Why ANTHROPIC_API_KEY must be empty
#Prerequisites
Install Node.js 18+
Claude Code needs Node.js 18 or newer.
Install Claude Code
npm install -g @anthropic-ai/claude-codeGet a Sozdai API key
Create an API key on the API Keys page in your console. It starts with sk-corr- and is used as ANTHROPIC_AUTH_TOKEN below.
#Setup by operating system
Pick your OS and follow the steps. Replace sk-corr-... with your real API key.
Open your shell profile
macOS uses zsh by default. Open ~/.zshrc in an editor:
nano ~/.zshrcAdd the configuration
# ~/.zshrc
export ANTHROPIC_BASE_URL="https://api.sozdai.ai"
export ANTHROPIC_AUTH_TOKEN="sk-corr-..."
export ANTHROPIC_API_KEY=""
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-8"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"Reload the profile
Apply it without reopening the terminal:
source ~/.zshrc#Model mapping
Claude Code has three model roles. Map each to a Sozdai model name via these variables (already included in the setup above):
| Role | Environment variable | Sozdai model |
|---|---|---|
| Main (Opus) | ANTHROPIC_DEFAULT_OPUS_MODEL | claude-opus-4-8 |
| Default (Sonnet) | ANTHROPIC_DEFAULT_SONNET_MODEL | claude-sonnet-4-6 |
| Background (Haiku) | ANTHROPIC_DEFAULT_HAIKU_MODEL | claude-haiku-4-5 |
These are required
#Cheaper models (DeepSeek / Kimi)
You don't have to use Claude. DeepSeek and Kimi cost a small fraction of Claude's price and work fully inside Claude Code — including tool calls (file edits, running commands) and extended thinking. Just point the overrides at them:
Change these lines in your ~/.zshrc or ~/.bashrc, then reload:
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-flash"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="kimi-k2.6"Mix and match
Which models work with Claude Code
#Verify
Start Claude Code and run /status. Confirm the API Base URL points at Sozdai and the auth token is set. Then just code as usual.
claude
# then, inside Claude Code:
/status#Troubleshooting
| Symptom | Fix |
|---|---|
| Requests still go to Anthropic | ANTHROPIC_API_KEY is not empty — set it to "" and restart the terminal. |
model_not_found | Set the ANTHROPIC_DEFAULT_*_MODEL variables to Sozdai model names. |
| 401 invalid api key | ANTHROPIC_AUTH_TOKEN is wrong or not an sk-corr- key. |
| 402 insufficient balance | Top up your Sozdai balance on the Billing page. |