How I automated my freelance invoicing with Claude API for $2/month
As a freelance developer, I was spending 2-3 hours every week writing client invoices, project summaries, and status emails. It was the work I hated most — tedious, repetitive, but important.
Then I automated it with the Claude API for less than the cost of a coffee.
The problem with freelance admin work
Every freelance developer knows the drill:
- Write a project summary from your git commits
- Convert that into a client-readable status update
- Draft the invoice description
- Follow up on unpaid invoices (the awkward one)
- Respond to scope creep requests professionally
Each of these tasks takes 15-30 minutes. Combined, that's 2+ hours every week of low-value work that doesn't pay.
The solution: a $2/month API + 50 lines of Node.js
I built a simple automation that:
- Reads my git log for the week
- Sends it to Claude API
- Returns a professional project summary + invoice line items
- Emails it to me for review
Here's the core script:
const https = require('https');
const { execSync } = require('child_process');
// Get git commits from the past week
function getWeeklyCommits() {
return execSync(
'git log --since="7 days ago" --pretty=format:"%h %s" --all'
).toString();
}
// Generate invoice description from commits
async function generateInvoiceDescription(commits, projectName, hourlyRate) {
const prompt = `You are a professional freelance developer.
Here are my git commits from this week for project "${projectName}":
${commits}
Hourly rate: $${hourlyRate}/hour
Please write:
1. A professional 2-3 sentence project summary for the client
2. Invoice line items (task description + estimated hours)
3. A brief "what's next" paragraph
Keep it professional but friendly. The client is non-technical.`;
const response = await fetch('https://simplylouie.com/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
message: prompt
})
});
const data = await response.json();
return data.response;
}
// Main function
async function generateWeeklyInvoice() {
const commits = getWeeklyCommits();
if (!commits) {
console.log('No commits this week');
return;
}
const description = await generateInvoiceDescription(
commits,
'Client Project Name',
75 // hourly rate
);
console.log('=== INVOICE CONTENT ===');
console.log(description);
console.log('======================');
// You can extend this to email the invoice, post to Stripe, etc.
}
generateWeeklyInvoice();
Setting up the API key
I use SimplyLouie for API access — it's $2/month and gives direct Claude API access without the $20/month ChatGPT tax or the complex Anthropic API billing setup.
To get your API key:
- Sign up at simplylouie.com
- Go to /developers
- Generate your key
- Replace
YOUR_API_KEYin the script above
The scope creep handler
This one saves the most painful conversations:
async function handleScopeCreep(clientRequest, originalScope) {
const prompt = `I'm a freelance developer. A client just sent me this request:
"${clientRequest}"
The original project scope was:
"${originalScope}"
Write a professional, friendly response that:
1. Acknowledges their request warmly
2. Clarifies this is outside the original scope
3. Provides an estimated additional cost/timeline
4. Keeps the relationship positive
Don't be defensive. Be helpful but firm about scope.`;
const response = await fetch('https://simplylouie.com/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({ message: prompt })
});
const data = await response.json();
return data.response;
}
// Example usage
const reply = await handleScopeCreep(
"Can you also add a mobile app version?",
"Build a web dashboard for inventory tracking"
);
console.log(reply);
The follow-up email generator
Chasing unpaid invoices is awkward. This makes it less so:
async function generateFollowUp(invoiceAmount, daysPastDue, clientName) {
const prompt = `Write a professional follow-up email for an unpaid invoice:
- Client: ${clientName}
- Amount: $${invoiceAmount}
- Days past due: ${daysPastDue}
Tone: Professional but friendly for <7 days, firmer for 7-14 days, very direct for 14+ days.
Keep it under 100 words.
Don't be passive-aggressive.`;
const response = await fetch('https://simplylouie.com/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({ message: prompt })
});
const data = await response.json();
return data.response;
}
The cost math
My freelance automation runs roughly:
- 52 weeks × 5 API calls per week = 260 calls/year
- At $2/month = $24/year
- Time saved: ~100 hours/year at $75/hour = $7,500 in recovered productive time
That's a 312x return on the API cost.
What I'd build next
- Automated project proposals from brief calls
- Contract review to flag unusual clauses
- Client onboarding emails based on project type
- Weekly digest of what I accomplished for long-term clients
The whole thing took me an afternoon to build. The API is simple REST — no SDKs, no complex setup.
If you're a freelance developer spending hours on admin work, this is worth 30 minutes to set up.
Get API access at simplylouie.com — $2/month, no annual contract, cancel anytime.
Built this for myself and figured other freelancers would find it useful. If you try it, let me know what you automate first.
Top comments (0)