Luxeno Docs

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 --version should succeed)
  • A Luxeno API key — see Getting Started if you do not have one yet
  • A positive Luxeno balance for requests to succeed

Configuration

Step 1

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.

~/.claude/settings.json
{
  "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.

Step 2

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.

Step 3

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 requestsLuxeno routes toPrice
claude-sonnet-4-20250514glm-4-flash$0.30 / 1M tokens
claude-opus-4-20250514glm-4-flash$0.30 / 1M tokens

Verify It Works

Run a simple prompt to confirm everything is wired up correctly:

Terminal
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.