Configure Claude Code
Claude Code uses the Anthropic protocol, so you need to point the API address to this site's Anthropic-compatible endpoint.
Option 1: Environment Variables
bash
export ANTHROPIC_BASE_URL="https://kuaiapi.net"
export ANTHROPIC_AUTH_TOKEN="sk-your-key"Then start Claude Code:
bash
claudeOption 2: settings.json (Recommended)
Edit ~/.claude/settings.json:
json
{
"env": {
"ANTHROPIC_BASE_URL": "https://kuaiapi.net",
"ANTHROPIC_AUTH_TOKEN": "sk-your-key"
}
}Option 3: Manage with CC-Switch
We recommend using CC-Switch to manage multiple provider configurations — switch in 5 seconds, and your configurations are synced to the cloud so they won't be lost.
Verify
Send a message in Claude Code. If you get a normal reply, it works.
Notes
- The protocol must match: your key must be bound to a group on the Anthropic platform, otherwise requests will fail
- Jailbreaking, distillation, and reverse engineering are strictly prohibited: the "Claude Max Full" and "GPT-Pro" groups are dedicated channel pools. Jailbreaking, distillation, reverse engineering, and similar behavior are strictly prohibited, and violators will be banned immediately with no refund
- The Base URL generally does not need
/v1added (Claude Code appends/v1/messagesautomatically). Follow the recommended configuration. - If you run into
not_found_error/invalid x-api-key, check against Troubleshooting
TIP
We strongly recommend using the Claude Code configuration generated by "Use Key". It fills in the endpoint for your current group automatically.
