I run 30+ APIs in production and pay $0/month in infrastructure. Here's the exact setup.
The Free Tier Stack
Cloudflare Workers Free Plan:
- 100,000 requests/day
- 10ms CPU time per request
- Global edge network
- KV storage: 100k reads/day free
For most side projects, this never runs out.
Deploying Your First API in 5 Minutes
# Install Wrangler
npm install -g wrangler
wrangler login
# Create a new worker
wrangler init my-api
cd my-api
// src/index.js — your entire API
export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname === '/calculate') {
const n = parseInt(url.searchParams.get('n') || '0');
return Response.json({ result: n * n, timestamp: Date.now() });
}
return Response.json({ error: 'Not found' }, { status: 404 });
}
};
wrangler deploy
# ✅ Deployed to: https://my-api.YOUR_SUBDOMAIN.workers.dev
The Revenue Model
- Deploy API to Cloudflare Workers (free)
- List on Gumroad as a digital product with API key delivery
- List on RapidAPI for marketplace discovery
- Write one Dev.to tutorial targeting the exact search query your buyer types
My first API made $29 in month 2. Nothing changed except the Dev.to article.
The Numbers
- Infrastructure: $0
- Domain (api.lazy-mac.com): $12/year
- Time to first deployment: ~1 hour
- Time to first sale: 2-4 weeks (content dependent)
Top comments (0)