DEV Community

brian austin
brian austin

Posted on

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

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

Last month I was paying $20/month for ChatGPT Plus. Doing the math, that's roughly:

  • 7 days of work for a developer in Nigeria
  • 3 days of work for a developer in the Philippines
  • 1.5 days of work for a developer in India

For an API wrapper.

So I built my own. Here's everything you need to know, including the actual curl command.

The API endpoint

Base URL: https://simplylouie.com/api

Authentication: Bearer token (get yours at simplylouie.com/developers)

Cost: $2/month flat. No per-token billing. No rate limit anxiety.

The curl command

curl -X POST https://simplylouie.com/api/chat \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Explain async/await in Python in 3 sentences"
  }'
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "response": "Async/await in Python allows you to write asynchronous code that looks synchronous, making it easier to read and maintain. The `async` keyword defines a coroutine function, while `await` pauses execution until an awaitable object completes. This is especially useful for I/O-bound operations like API calls or database queries, where waiting for a response shouldn't block the entire program.",
  "model": "claude-3-5-sonnet",
  "tokens": 74
}
Enter fullscreen mode Exit fullscreen mode

Python example

import requests

API_KEY = "your_key_here"
BASE_URL = "https://simplylouie.com/api"

def ask_louie(message: str) -> str:
    response = requests.post(
        f"{BASE_URL}/chat",
        headers={
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        },
        json={"message": message}
    )
    return response.json()["response"]

# Usage
answer = ask_louie("Write a Python function to parse JSON from a string")
print(answer)
Enter fullscreen mode Exit fullscreen mode

Node.js example

const axios = require('axios');

const API_KEY = 'your_key_here';
const BASE_URL = 'https://simplylouie.com/api';

async function askLouie(message) {
  const response = await axios.post(
    `${BASE_URL}/chat`,
    { message },
    {
      headers: {
        Authorization: `Bearer ${API_KEY}`,
        'Content-Type': 'application/json'
      }
    }
  );
  return response.data.response;
}

// Usage
askLouie('Generate a regex to validate email addresses')
  .then(console.log);
Enter fullscreen mode Exit fullscreen mode

What I use it for

1. Code review automation

git diff HEAD~1 | curl -X POST https://simplylouie.com/api/chat \
  -H "Authorization: Bearer $LOUIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"message\": \"Review this git diff for bugs and security issues: $(git diff HEAD~1 | head -100)\"}"
Enter fullscreen mode Exit fullscreen mode

2. Commit message generation

# Add to your .bashrc or .zshrc
function ai-commit() {
  local diff=$(git diff --staged)
  local message=$(curl -s -X POST https://simplylouie.com/api/chat \
    -H "Authorization: Bearer $LOUIE_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"message\": \"Write a concise git commit message for this diff: $diff\"}" \
    | python3 -c "import sys,json; print(json.load(sys.stdin)['response'])")
  git commit -m "$message"
}
Enter fullscreen mode Exit fullscreen mode

3. README generation

cat src/main.py | curl -X POST https://simplylouie.com/api/chat \
  -H "Authorization: Bearer $LOUIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"message\": \"Generate a README.md for this Python script: $(cat src/main.py)\"}"
Enter fullscreen mode Exit fullscreen mode

4. Telegram bot integration

from telegram.ext import ApplicationBuilder, MessageHandler, filters
import requests

API_KEY = "your_louie_key"

async def handle_message(update, context):
    user_message = update.message.text

    response = requests.post(
        "https://simplylouie.com/api/chat",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={"message": user_message}
    ).json()

    await update.message.reply_text(response["response"])

app = ApplicationBuilder().token("TELEGRAM_BOT_TOKEN").build()
app.add_handler(MessageHandler(filters.TEXT, handle_message))
app.run_polling()
Enter fullscreen mode Exit fullscreen mode

Why $2/month and not per-token billing?

Because per-token billing creates anxiety.

Every time you fire a request, you're doing mental math: how many tokens is this? am I over budget?

Flat pricing means you just... use it. Build things. Experiment. Break stuff and retry.

I use the API probably 40-50 times a day across different scripts. At $20/month (ChatGPT Plus), that's fine. At Anthropic's direct API rates, a heavy day would cost $3-5 in tokens alone.

At $2/month flat, I stopped thinking about it.

The global pricing reality

Country SimplyLouie ChatGPT Plus Difference
🇳🇬 Nigeria N3,200/month N32,000+/month 10x cheaper
🇵🇭 Philippines P112/month P1,120+/month 10x cheaper
🇮🇳 India Rs165/month Rs1,600+/month 10x cheaper
🇰🇪 Kenya KSh260/month KSh2,600+/month 10x cheaper
🇬🇭 Ghana GH¢25/month GH¢250+/month 10x cheaper
🇮🇩 Indonesia Rp32,000/month Rp320,000+/month 10x cheaper
🇧🇷 Brazil R$10/month R$100+/month 10x cheaper
🇲🇽 Mexico MX$35/month MX$350+/month 10x cheaper

One more thing

This project started because of a rescue dog named Louie. He didn't make it. 50% of every subscription goes to animal rescue organizations.

So every API call you make is also funding dogs that need homes.

Get API access: simplylouie.com/developers

7-day free trial. No credit card required until day 7. Cancel anytime.


Building something with the API? Drop a comment — I'd love to see what you make.

Top comments (0)