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 AI APIs charge you per token. That's fine if you're running batch jobs or know exactly how many tokens you'll use. But for personal projects, side projects, and freelance tools? Token counting is a tax on your attention.

I wanted a flat-rate Claude API. No token anxiety. No surprise bills. Here's what I built and how to use it.


The problem with token-based pricing

Here's what a real Claude API session costs on the official Anthropic API:

  • Claude 3.5 Sonnet: $3 per million input tokens, $15 per million output tokens
  • A typical 1,000-token conversation = ~$0.015
  • 100 conversations/day = $1.50/day = $45/month
  • A productive developer doing 300 conversations/day = $135/month

For a US developer, $135/month is annoying. For a developer in Indonesia, Nigeria, or Bangladesh, it's a dealbreaker.


The flat-rate alternative

SimplyLouie exposes a Claude API proxy at a fixed monthly rate. $10/month gets you developer API access with no per-token billing.

Here's the curl command:

curl -X POST https://simplylouie.com/api/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "message": "Explain async/await in JavaScript",
    "conversationId": "my-project-001"
  }'
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "response": "Async/await is syntactic sugar over Promises...",
  "conversationId": "my-project-001",
  "model": "claude-3-5-sonnet"
}
Enter fullscreen mode Exit fullscreen mode

No token counts. No rate-limit tiers based on usage. Flat monthly fee.


Python integration

import requests

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

def ask_claude(message: str, conversation_id: str = None) -> dict:
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }
    payload = {
        "message": message,
        "conversationId": conversation_id or "default"
    }
    response = requests.post(
        f"{BASE_URL}/chat",
        headers=headers,
        json=payload
    )
    return response.json()

# Use it
result = ask_claude("Write a unit test for this function", "project-alpha")
print(result["response"])
Enter fullscreen mode Exit fullscreen mode

JavaScript / Node.js

const axios = require('axios');

const API_KEY = process.env.SIMPLYLOUIE_API_KEY;
const BASE_URL = 'https://simplylouie.com/api';

async function askClaude(message, conversationId = 'default') {
  const response = await axios.post(
    `${BASE_URL}/chat`,
    { message, conversationId },
    { headers: { Authorization: `Bearer ${API_KEY}` } }
  );
  return response.data.response;
}

// Use it
const explanation = await askClaude(
  'What is the time complexity of quicksort?',
  'cs-study-session'
);
console.log(explanation);
Enter fullscreen mode Exit fullscreen mode

Bash script for CI/CD pipelines

#!/bin/bash
# Generate commit message from git diff

GIT_DIFF=$(git diff --staged --stat)
API_KEY="your_api_key_here"

RESPONSE=$(curl -s -X POST https://simplylouie.com/api/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d "{
    \"message\": \"Write a concise git commit message for these changes: $GIT_DIFF\",
    \"conversationId\": \"git-helper\"
  }")

echo $RESPONSE | jq -r '.response'
Enter fullscreen mode Exit fullscreen mode

What you can build with this

Flat-rate Claude API access unlocks projects that wouldn't be economically viable at token-based pricing:

Development tools:

  • Commit message generator (example above)
  • Code review bot for your team's PRs
  • Automated documentation writer
  • Test case generator from function signatures

Personal productivity:

  • Email drafting assistant
  • Meeting notes summarizer
  • Research assistant with conversation memory

Freelance/client tools:

  • Proposal writer with client context
  • Invoice description generator
  • Client communication templates

All of these are viable at $10/month flat. Most of them become expensive at token rates once you're actively using them.


The math for emerging market developers

For developers in markets where $20/month ChatGPT represents 10-20% of income, this matters even more:

Country Token-rate API (heavy use) SimplyLouie Dev API
Nigeria N60,000+/month N8,000/month
Philippines P5,000+/month P560/month
India Rs8,000+/month Rs825/month
Indonesia Rp600,000+/month Rp160,000/month

Fixed cost means you can actually budget for it.


Get API access

The developer API is at simplylouie.com/developers.

Starts at $10/month. No token counting. No surprise bills. The curl command above works the same on day 1 as it does on day 300.


What are you building? Drop your use case in the comments — I'm curious what kinds of projects become viable when the cost is flat.

Top comments (0)