Skip to main content

Claude Code + OpenLimits

Claude Code is Anthropic’s terminal-based coding agent. When used with a single account, rate limits can interrupt long sessions. OpenLimits provides access through a pool of accounts to reduce these interruptions. The setup process is straightforward.

Prerequisites

  • Claude Code CLI installed (npm install -g @anthropic-ai/claude-code)
  • An OpenLimits account. Create one here.

Get your API key

After signing up, go to your OpenLimits dashboard. Your API key is displayed on the overview page. Copy it.

Set environment variables

Add these two lines to your shell profile (~/.zshrc, ~/.bashrc, or ~/.bash_profile):

export ANTHROPIC_BASE_URL=https://openlimits.app
export ANTHROPIC_API_KEY=your-openlimits-key

Then reload your shell:

source ~/.zshrc  # or ~/.bashrc

Verify the route

Start a Claude Code session:

claude

Send a message, then check your OpenLimits dashboard. The request should appear in the live feed with model, token count, and latency information.

What changes

With OpenLimits configured, Claude Code behaves the same, with these routing differences:

  • Pooled routing: Eligible requests can use another healthy provider account when one account is constrained
  • Bounded retries: Transient failures can move to another eligible account before output begins
  • Claude models: Every plan includes Claude Opus 4.8 and 4.7, Sonnet 5, and Haiku 4.5
  • Usage records: The dashboard shows request state, timing, and token breakdowns

Streaming, extended thinking, tool use, file operations, and multi-turn conversations continue through the compatible API.

Using Conductor

If you use Conductor for parallel Claude Code sessions, the same environment variables apply. Conductor inherits your Claude Code CLI settings, so OpenLimits works automatically across all your parallel agents.

Troubleshooting

Requests aren't showing in the dashboard

Make sure you reloaded your shell after adding the environment variables. Run echo $ANTHROPIC_BASE_URL to verify it's set to https://openlimits.app.

Getting “Invalid API key” errors

Double-check that ANTHROPIC_API_KEY is set to your OpenLimits key (not an Anthropic API key). You can find your key on the dashboard overview page.

Connection timeouts

OpenLimits is served from dedicated VPS infrastructure. If you're behind a corporate proxy or VPN, make sure openlimits.app is not blocked.

Extended thinking not working

Extended thinking works the same as with the direct API. Make sure you're using a model that supports it (Sonnet or Opus). If Claude Code is auto-selecting models, it will use thinking when appropriate.

Use OpenLimits from Claude Code.

Set the compatible endpoint and keep the rest of your workflow unchanged.

Get API key

Related