DEV Community

brian austin
brian austin

Posted on

I built a $10/month Claude API — here's the curl command

I built a $10/month Claude API — here's the curl command

Most developers don't know you can run Claude Code against a custom API endpoint.

Anthropic built in a variable called ANTHROPIC_BASE_URL specifically for this. You point it at any OpenAI-compatible endpoint, and Claude Code routes all its requests there instead of directly to Anthropic.

I've been running this setup for a while now. Here's exactly how to use it.

The one-liner setup

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

That's it. Claude Code now routes through SimplyLouie's API instead of hitting Anthropic directly.

Why would you want this?

Anthropic charges per token. A heavy Claude Code session can easily cost $5-15 in API calls. SimplyLouie's developer tier gives you Claude API access for a flat $10/month — unlimited calls, same claude-3-5-sonnet model.

For developers doing CI/CD automation, testing pipelines, or just heavy daily coding sessions, the math is obvious.

curl examples

Basic message completion

curl https://simplylouie.com/api/claude \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Write a Python function to parse JSON"}
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

Code review automation

curl https://simplylouie.com/api/claude \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -d "{
    \"model\": \"claude-3-5-sonnet-20241022\",
    \"max_tokens\": 2048,
    \"messages\": [
      {\"role\": \"user\", \"content\": \"Review this code for bugs and security issues: $(cat myfile.js | head -50 | jq -Rs .)\"}
    ]
  }"
Enter fullscreen mode Exit fullscreen mode

Streaming responses

curl https://simplylouie.com/api/claude \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $YOUR_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "model": "claude-3-5-sonnet-20241022",
    "max_tokens": 1024,
    "stream": true,
    "messages": [
      {"role": "user", "content": "Explain async/await in JavaScript"}
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

Using it with Claude Code directly

This is the most powerful use case. Claude Code has native support for custom base URLs:

# Add to your .bashrc or .zshrc
export ANTHROPIC_BASE_URL=https://simplylouie.com/api/claude
export ANTHROPIC_API_KEY=sl_your_key_here

# Now just run claude normally
claude "refactor this authentication module"
Enter fullscreen mode Exit fullscreen mode

Every Claude Code session now routes through the proxy. You get:

  • Flat-rate pricing (no per-token surprises)
  • Same claude-3-5-sonnet model
  • All Claude Code features work identically
  • Works with hooks, subagents, MCP servers

CI/CD pipeline integration

# .github/workflows/code-review.yml
name: AI Code Review
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run AI code review
        env:
          ANTHROPIC_BASE_URL: https://simplylouie.com/api/claude
          ANTHROPIC_API_KEY: ${{ secrets.SIMPLYLOUIE_KEY }}
        run: |
          # Install claude CLI
          npm install -g @anthropic-ai/claude-code
          # Review changed files
          git diff HEAD~1 | claude "Review these changes for bugs, security issues, and style problems. Be concise."
Enter fullscreen mode Exit fullscreen mode

Python SDK integration

import anthropic

client = anthropic.Anthropic(
    api_key="sl_your_key_here",
    base_url="https://simplylouie.com/api/claude"
)

message = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Explain the difference between async and threading in Python"}
    ]
)

print(message.content[0].text)
Enter fullscreen mode Exit fullscreen mode

Node.js integration

import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  apiKey: 'sl_your_key_here',
  baseURL: 'https://simplylouie.com/api/claude',
});

const message = await client.messages.create({
  model: 'claude-3-5-sonnet-20241022',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Write unit tests for this function' }],
});

console.log(message.content[0].text);
Enter fullscreen mode Exit fullscreen mode

Pricing comparison

Method Cost Rate limits
Anthropic direct API ~$15/1M tokens Hard limits
Claude Pro $20/month Session limits
SimplyLouie Developer $10/month flat Generous

For developers running multiple sessions per day or automating Claude in pipelines, the flat rate beats per-token pricing almost immediately.

Get started

simplylouie.com/developers

7-day free trial, no card required to start. The API key works in curl, Python SDK, Node SDK, and directly with claude CLI via ANTHROPIC_BASE_URL.


SimplyLouie is a $2/month Claude proxy built by one person. 50% of revenue goes to animal rescue. simplylouie.com

Top comments (0)