Claude Code
Configure Claude Code to route all API calls through Luxeno. Because Luxeno exposes an Anthropic-compatible endpoint, no code changes are needed — only two environment variables.
Prerequisites
Before you begin
- Claude Code installed and working (
claude --versionshould succeed) - A Luxeno API key — see Getting Started if you do not have one yet
- A positive Luxeno balance for requests to succeed
Configuration
Edit ~/.claude/settings.json
Open (or create) ~/.claude/settings.json and add the two environment variables shown below. These tell Claude Code to send all requests to Luxeno instead of Anthropic directly.
{
"env": {
"ANTHROPIC_BASE_URL": "https://luxeno.ai/api",
"ANTHROPIC_API_KEY": "sk-silk-your-key-here"
}
}Replace sk-silk-your-key-here with your actual Luxeno API key from the dashboard.
Restart your terminal
Close and reopen your terminal session so that the updated settings file is picked up by the Claude Code process on next launch.
Run claude
Start Claude Code normally. All requests are now routed through Luxeno and served by the GLM backend — no other changes are required.
Model Mapping
Claude Code sends requests using Anthropic model identifiers. Luxeno maps these to GLM models transparently.
| Claude Code requests | Luxeno routes to | Price |
|---|---|---|
| claude-sonnet-4-20250514 | glm-4-flash | $0.30 / 1M tokens |
| claude-opus-4-20250514 | glm-4-flash | $0.30 / 1M tokens |
Verify It Works
Run a simple prompt to confirm everything is wired up correctly:
claude "Say hello"You should see a response within a few seconds. Check your dashboard usage page to confirm a token deduction was recorded.
Troubleshooting
Common errors
- 401 Unauthorized — your API key is incorrect or missing. Double-check the value in settings.json and ensure there are no extra spaces.
- 402 Payment Required — your Luxeno balance is zero. Top up from the Billing page.
- Settings not picked up — make sure you restarted the terminal after editing the file. Some shells also require a full logout/login.
- Slow first response — this is normal on a cold start. Subsequent calls will be faster thanks to semantic caching.