Use Relixr with Claude Code

/docs/use-with-claude-code

Subscription or rate limit stalled Claude Code mid-task? Point ANTHROPIC_BASE_URL at Relixr, top up any amount, and keep a hard spend cap.

Claude Code runs unattended for long stretches — exactly when a soft subscription limit stalls the session, or an uncapped API key becomes a surprise bill. Relixr is the OpenAI/Anthropic-compatible endpoint with a hard spend cap.

Use official env vars only (ANTHROPIC_BASE_URL / ANTHROPIC_API_KEY). Keep Claude Code for the agent loop; Relixr handles models, prepaid cost, and the kill switch.

Fastest path: Connect setup pack

  1. Open Connect → Claude Code and mint a key.
  2. Download relixr-claude-code.env (or copy the exports from the pack).
  3. Source the file / add exports to your shell profile.
  4. Run claude, then confirm the turn under Logs.

Or:

zsh
$ npx relixr login
npx relixr connect claude-code
claude

Manual exports (fallback)

  1. Top up any amount under Credits.
  2. Create a key named claude-code from Connect with a daily cap sized for a worst-case runaway loop.
  3. Export:
zsh
$ export ANTHROPIC_BASE_URL="https://api.relixr.com"
export ANTHROPIC_API_KEY="$RELIXR_API_KEY"
claude
  1. Confirm the turn appears under Logs with cost attribution on that key.
Warning

Hitting the cap returns a typed 402 — Claude Code surfaces an API error. That stop is intentional.

Tip

Add both exports to your shell profile for every terminal. Unset ANTHROPIC_BASE_URL for a session to talk to Anthropic directly again. Short aliases like sonnet resolve to Relixr model ids on the gateway.

Was this helpful?

Still stuck? Help center · Doctor