DEV Community

brian austin
brian austin

Posted on

Claude Code without the $20/month rate limits: using ANTHROPIC_BASE_URL in production

Claude Code without the $20/month rate limits: using ANTHROPIC_BASE_URL in production

If you use Claude Code daily, you've hit this wall:

Claude Code is currently unavailable due to high demand.
Please try again later.
Enter fullscreen mode Exit fullscreen mode

Mid-session. Mid-refactor. Gone.

Here's the env var that fixes it — and the economics behind why it works.

The ANTHROPIC_BASE_URL trick

Claude Code respects one environment variable:

export ANTHROPIC_BASE_URL=https://api.simplylouie.com
Enter fullscreen mode Exit fullscreen mode

Set it, and Claude Code routes through a different API endpoint instead of Anthropic's direct consumer tier.

No code changes. No config files. No Claude Code settings to touch.

Why this matters

Claude.ai's consumer tier has rate limits designed for casual users. When you're running Claude Code for 8 hours straight — generating, refactoring, reviewing — you're not a casual user.

The consumer tier wasn't built for you.

ANTHROPIC_BASE_URL lets you point Claude Code at any OpenAI-compatible API. Including proxies that run on the API tier, which has different rate limit characteristics.

Setting it persistently

Add to your shell profile so it persists across sessions:

# ~/.zshrc or ~/.bashrc
export ANTHROPIC_BASE_URL=https://api.simplylouie.com
export ANTHROPIC_API_KEY=your_key_here
Enter fullscreen mode Exit fullscreen mode

Then reload:

source ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Verify it's working

Quick test before committing:

curl -s https://api.simplylouie.com/v1/models \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY" | jq '.data[].id'
Enter fullscreen mode Exit fullscreen mode

You should see:

"claude-sonnet-4-5"
"claude-opus-4-5"
Enter fullscreen mode Exit fullscreen mode

The economics

Claude.ai Pro: $20/month. Rate limits included.

API tier via proxy: $2/month flat. The same claude-sonnet-4-5 model. No per-token billing surprises.

For someone running Claude Code as their primary coding tool, the math is obvious:

$20/month × 12 = $240/year
$2/month × 12 = $24/year
Enter fullscreen mode Exit fullscreen mode

$216 stays in your pocket. The model is identical.

What you're actually getting

When Claude Code hits a rate limit on the consumer tier, it's not because the API is overloaded. It's because you've exceeded the consumer quota.

Routing through the API tier means:

  • The same Claude model
  • Different quota pool
  • Flat monthly rate regardless of usage
  • No surprise overage charges

A complete session setup

Here's the full environment I use for long Claude Code sessions:

#!/bin/bash
# start-claude-session.sh

export ANTHROPIC_BASE_URL=https://api.simplylouie.com
export ANTHROPIC_API_KEY=your_key_here

# Optional: set model preference
export ANTHROPIC_MODEL=claude-sonnet-4-5

echo "Claude Code configured:"
echo "  API: $ANTHROPIC_BASE_URL"
echo "  Model: ${ANTHROPIC_MODEL:-default}"
echo ""

# Launch Claude Code
claude
Enter fullscreen mode Exit fullscreen mode

Save it, chmod +x, and run it instead of claude directly.

CLAUDE.md note

If you're using CLAUDE.md (you should be), you can also document the API config there:

# Session Configuration

This project uses a flat-rate Claude API via ANTHROPIC_BASE_URL.
No rate limit interruptions during long sessions.
Cost: $2/month regardless of token volume.
Enter fullscreen mode Exit fullscreen mode

Not functional — Claude doesn't read env var configs from CLAUDE.md. But it documents the setup for teammates who clone the repo.

Try it

SimplyLouie gives you a 7-day free trial before any charge. Set the env var, run a full coding session, see if the rate limit problem goes away.

simplylouie.com


Claude Code is a trademark of Anthropic. This post is about the ANTHROPIC_BASE_URL configuration, not affiliated with Anthropic.

Top comments (0)