100% Free Developer Utility
AI API Cost & Token Burn Calculator
Launching on Product Hunt without rate limits is like leaving a credit card on a sidewalk. Calculate your estimated monthly API spend across major LLMs and generate rate-limit guards before launch day.
Select Foundation Model
Daily Active Users (DAU)500
50 users10,000 users
Prompts / Messages per User / Day6
1 prompt50 prompts
Average Input Tokens (Prompt + History)800 tokens
100 tokens (~75 words)4,000 tokens (~3,000 words)
Average Output Tokens (AI Completion)600 tokens
100 tokens4,000 tokens
The Runaway Bot Hazard
If a single scraper or malicious bot hits your unthrottled endpoint 30,000 times in 2 hours, it will cost you approx $342.00 before you notice.
Estimated Monthly Spend
$1026.00
$34.20 / day
Monthly API Calls
90,000
3,000 calls / day
Avg Cost / Active User
$0.068
Per month per user
Next.js 15 Rate Limiter (Upstash Redis)
// lib/ratelimit.ts: Upstash Redis sliding window limiter
import { Ratelimit } from '@upstash/ratelimit';
import { Redis } from '@upstash/redis';
export const aiRatelimit = new Ratelimit({
redis: Redis.fromEnv(),
limiter: Ratelimit.slidingWindow(10, '1 m'), // 10 requests per minute per IP
analytics: true,
prefix: 'ai_ratelimit',
});
// In app/api/chat/route.ts:
export async function POST(req: Request) {
const ip = req.headers.get('x-forwarded-for') ?? '127.0.0.1';
const { success, limit, remaining } = await aiRatelimit.limit(ip);
if (!success) {
return Response.json(
{ error: 'Too many requests. Please slow down.' },
{ status: 429, headers: { 'Retry-After': '60' } }
);
}
// Proceed with LLM call safely
}1-Click Cursor Prompt to Cap Burn
Add IP-based and user-based rate limiting to our AI route in app/api/chat/route.ts: 1. Use @upstash/ratelimit to restrict unauthenticated IPs to a maximum of 10 requests per minute. 2. Return a clean HTTP 429 status code with a user-friendly message when rate limits are exceeded. 3. Add a maximum completion token limit of 600 tokens on all LLM completions to prevent runaway token bills. 4. Ensure errors fail gracefully without crashing the UI.
Want to verify that all your LLM routes are guarded?
Token burn loops are checked in Pillar 8 of our 108 launch criteria. The Founder Pass ($15 one-time) scans your entire repository for unthrottled streaming endpoints and missing circuit breakers.