DEV Community

brian austin
brian austin

Posted on

I use Claude Code daily — here's how I cut my API bill to $2/month

I use Claude Code daily — here's how I cut my API bill to $2/month

The .claude/ folder is having a moment on Hacker News right now. Hundreds of developers are comparing their Claude Code configurations, sharing hooks, and debugging workflows.

And almost none of them are talking about the bill.

The quiet cost of Claude Code

Claude Code uses Anthropic's API directly. Every message, every file read, every tool call — it's all tokens. If you're building anything non-trivial, you're looking at $20-50/month in API costs without even trying.

Most developers don't track this until they get the bill.

# Check your actual Claude API spend
curl https://api.anthropic.com/v1/usage \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01"
Enter fullscreen mode Exit fullscreen mode

What I did instead

I run my Claude API access through a proxy that caps my spend at $2/month. Here's the full setup:

# Instead of hitting Anthropic directly:
export ANTHROPIC_BASE_URL="https://api.simplylouie.com/v1"
export ANTHROPIC_API_KEY="your-louie-key"

# Your existing Claude Code config in .claude/settings.json
# doesn't need to change at all
Enter fullscreen mode Exit fullscreen mode

The proxy is API-compatible — same request format, same response format, same streaming support. Claude Code doesn't know the difference.

import anthropic

# Works with any Anthropic-compatible client
client = anthropic.Anthropic(
    base_url="https://api.simplylouie.com/v1",
    api_key="your-louie-key"
)

message = client.messages.create(
    model="claude-opus-4-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Review this PR diff"}]
)
print(message.content)
Enter fullscreen mode Exit fullscreen mode

The math

Anthropic charges:

  • Claude Sonnet 4.5: $3/MTok input, $15/MTok output
  • Claude Opus: $15/MTok input, $75/MTok output

For a typical day of Claude Code usage (reading files, generating code, debugging):

  • ~500K input tokens
  • ~100K output tokens
  • Daily cost: ~$3
  • Monthly: ~$90

With a flat $2/month proxy: you save $88/month.

The catch? There's a fair-use cap. Heavy users will hit it. But for most developers using Claude Code as a coding assistant (not training models or processing documents at scale), $2/month covers everything.

Why I built this

I got tired of tracking token counts. I wanted to use AI naturally — ask questions, iterate, experiment — without a mental tax meter running.

The proxy handles the rate limiting, I handle the creative work.

# Test it in 30 seconds
curl https://api.simplylouie.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_KEY" \
  -d '{
    "model": "claude-opus-4-5",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Hello"}]
  }'
Enter fullscreen mode Exit fullscreen mode

The .claude/ folder config

For anyone who wants to configure Claude Code to use a cheaper API endpoint permanently:

// .claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.simplylouie.com/v1"
  }
}
Enter fullscreen mode Exit fullscreen mode

Set this once in your project's .claude/settings.json and forget about it. Every session uses the cheaper endpoint automatically.

"Hold on to your hardware" energy

There's a big HN story right now about not renting when you can own. The same logic applies to AI subscriptions.

You don't need to pay $20-90/month for Claude access. The model doesn't cost that much to run at your usage level. The premium is marketing, infrastructure, and VC returns.

A $2/month flat rate exists. Use it.


7-day free trial, no credit card required initially. Developer API at simplylouie.com/developers

50% of revenue goes to animal rescue. We're a weird little indie SaaS and we're okay with that.

Top comments (0)