DEV Community

brian austin
brian austin

Posted on

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

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

Last year I was spending $20/month on ChatGPT Plus for my side projects. Then I found a way to access Claude's API for $2/month. Here's exactly how it works.

The curl command

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

That's it. Same Claude model you'd access via Anthropic's official API, for a fraction of the price.

Why $2/month?

SimplyLouie is a flat-rate Claude API proxy. Instead of paying per token, you pay $2/month for unlimited usage within fair limits.

For side project developers and students, this is dramatically cheaper than:

  • Anthropic's official API: ~$15-$75 per million tokens depending on model
  • ChatGPT Plus: $20/month (OpenAI model, not Claude)
  • Claude Pro: $20/month (no API access)

Real usage examples

Code review in your CI pipeline

#!/bin/bash
# .github/scripts/ai-review.sh

DIFF=$(git diff HEAD~1)

curl https://simplylouie.com/api/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LOUIE_API_KEY" \
  -d "{
    \"messages\": [{
      \"role\": \"user\",
      \"content\": \"Review this diff for bugs and security issues:\\n$DIFF\"
    }]
  }"
Enter fullscreen mode Exit fullscreen mode

Generate test cases

curl https://simplylouie.com/api/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "messages": [{
      "role": "user",
      "content": "Write Jest test cases for this function: function calculateDiscount(price, percent) { return price * (1 - percent/100); }"
    }]
  }'
Enter fullscreen mode Exit fullscreen mode

Automate documentation

import requests

def document_function(code: str) -> str:
    response = requests.post(
        'https://simplylouie.com/api/chat',
        headers={
            'Content-Type': 'application/json',
            'Authorization': 'Bearer YOUR_API_KEY'
        },
        json={
            'messages': [{
                 'role': 'user',
                'content': f'Write JSDoc comments for this function:\n{code}'
            }]
        }
    )
    return response.json()['content'][0]['text']
Enter fullscreen mode Exit fullscreen mode

Node.js SDK-style wrapper

const axios = require('axios');

class LouieClient {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseURL = 'https://simplylouie.com';
  }

  async chat(message, options = {}) {
    const response = await axios.post(
      `${this.baseURL}/api/chat`,
      {
        messages: [{ role: 'user', content: message }],
        model: options.model || 'claude-3-5-sonnet-20241022',
        max_tokens: options.maxTokens || 1024
      },
      {
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${this.apiKey}`
        }
      }
    );
    return response.data.content[0].text;
  }
}

// Usage
const louie = new LouieClient(process.env.LOUIE_API_KEY);
const review = await louie.chat(`Review this PR:\n${diff}`);
console.log(review);
Enter fullscreen mode Exit fullscreen mode

What's included at $2/month

  • Claude 3.5 Sonnet (the best Claude model for coding tasks)
  • REST API compatible with Claude's message format
  • API key management
  • Reasonable rate limits for side projects
  • 50% of revenue goes to animal rescue 🐾

Get your API key

  1. Sign up at simplylouie.com
  2. Start your 7-day free trial (no charge for 7 days)
  3. Get your API key from the dashboard
  4. Replace YOUR_API_KEY in the examples above

For developers — especially those building side projects, doing open source work, or contributing to codebases like the Linux kernel — $2/month flat rate is hard to beat.

Check out the full developer docs at simplylouie.com/developers.


SimplyLouie is a flat-rate Claude API proxy. $2/month. 50% to animal rescue.

Top comments (0)