AI API Budget Calculator — how many tokens and requests your money buys
Enter a dollar budget, pick a model, and describe an average request. This tool inverts the usual cost formula to show how many API requests, tokens, words, and pages you can afford — how long it lasts, and what it's worth in rupees. No signup, no network calls.
How it works
Every large-language-model API prices two things separately: the input tokens you send (your prompt, system message, and any context) and the outputtokens the model writes back. Prices are quoted in US dollars per 1,000,000 tokens, and output is almost always dearer than input because the model spends compute generating each token. This calculator reads those published per-million prices from the same shared table used by the site's AI API Cost Calculator, so the two tools never disagree.
Most cost calculators go usage → cost. This one runs the arithmetic backwards — budget → capacity — in six steps:
- Cost per request.
Creq = (Tin ÷ 1,000,000 × Pin) + (Tout ÷ 1,000,000 × Pout)whereTin/Toutare your average input/output tokens andPin/Poutare the model's per-million prices. - Requests affordable.
Nreq = floor(Budget ÷ Creq). We floor to whole requests — you can't buy a fraction of a call — with a tiny epsilon guard so exact-multiple budgets (say a budget that divides evenly into 100 requests) don't drop to 99 through floating-point rounding. - Total tokens.
Ttot = Nreq × (Tin + Tout), split back into input and output shares. - Words. Using OpenAI's rule of thumb of about 1.33 tokens per English word,
Words = round(Ttot ÷ 1.33). - Pages. At roughly 500 words per A4 page,
Pages = round(Words ÷ 500). - Runway. If you enter requests per day
R,Days = floor(Nreq ÷ R). Any dollar figure is multiplied by your USD→LKR rate for the rupee lines.
There is no opinion or estimation model here — just arithmetic over authoritative published prices. As an independent check, the tool re-derives the cost per request through a per-1,000-token unit instead of the per-1,000,000-token path and confirms both produce the same number of affordable requests, the same way the site's tax calculator cross-checks itself against the IRD's monthly formula. The words and pages figures are approximations for human-scale framing; the request, token, and dollar numbers are exact.
Worked examples
Frequently asked questions
Sources & references
- OpenAI — API pricing (per-1M input/output token prices)
- Anthropic — Claude API pricing
- Google — Gemini API pricing
- OpenAI Help — What are tokens and how to count them (words ≈ tokens ÷ 1.33)
- Central Bank of Sri Lanka — daily indicative USD/LKR rate
Prices were last cross-checked against the vendor pricing pages on 2026-07-01. The shared price table is reviewed roughly quarterly and whenever a vendor moves a tier.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.