LLM Pricing Calculator — Token Cost Estimator
Estimate per-call USD costs from input and output token counts. Paste a prompt to derive input tokens live, or enter counts from logs. Batch API, prompt caching, and monthly projections are included, all in your browser.
How pricing works
Rates come from a manually maintained table in llm-models.json, reviewed at least monthly. The verified date on this page reflects the last review, not your invoice.
Per-million input and output rates are applied locally: (tokens / 1,000,000) × $/1M. This tool is an indicative planner, not a billing authority. For disputes, use your provider dashboard.
Token inputs
Use the number fields when you already have counts from logs or our LLM token counter. Optionally paste a prompt in Monaco. Input tokens are derived via the same countTokensAsync path as the token counter (Exact for OpenAI encodings, Estimate for Claude/Gemini).
Output tokens are not auto-derived in v1. Set them manually when you expect completion tokens.
Batch API & prompt caching
Batch API (−50 %) applies a flat 50 % discount on the subtotal, a simplified v1 stand-in for provider batch pricing tiers. Cached input bills the cached slice at 10 % of the input rate (90 % savings on that portion). Enter how many input tokens you expect to be served from prompt cache on repeat calls.
Privacy
All math runs in your browser. FastMinify does not call provider pricing APIs, scrape live tariffs, or upload your prompts. Token derivation uses the same local tokenizer/heuristic stack as the token counter.
Limitations
USD only in v1. Rates change without notice on provider sites, so verify before large spend. Derived input counts on Estimate-tier models are heuristic (±5–15 %). Embeddings, images, and tool-call token rules are out of scope.
Related tools
Count tokens with the LLM token counter, check context fit with the context window calculator, or format message JSON with the JSON formatter.
Options that change the estimate
- Model
- Switches per-million input and output rates from the registry table. Models without input pricing show unavailable in compare view.
- Input format
- When deriving input tokens from pasted text: Auto-detect treats valid [{role, content}] arrays as Chat API messages with per-message overhead.
- Batch API (−50 %)
- Applies a flat 50 % discount on the subtotal (input + output USD before discount). Simplified v1 model of provider batch pricing.
- Custom rates
- Ignore the model table and use your own $/1M input and output rates. Useful for enterprise deals or private endpoints.
- Compare all models
- Lists every registry model with Fresh, Cached, Output, and Total USD columns for the same token counts. Copy the table with token fields and per-model costs. Batch and custom options apply uniformly. Select a row to choose that model.
FAQ
Pricing estimates, accuracy, and assumptions
Will this match my invoice exactly?
Usually not down to the cent. We apply published list rates from our table; your account may have discounts, cached-token billing nuances, or regional pricing. Use this for planning, and reconcile spend on the provider dashboard.
Who qualifies for Batch API pricing?
Providers offer batch endpoints with delayed processing and lower per-token rates. The −50 % toggle models a simplified flat discount on the subtotal. Confirm eligibility and actual batch tariffs on the provider site before relying on it for budgets.
How is prompt caching modeled?
Enter cached input tokens separately. That slice is billed at 10 % of the input rate (90 % savings versus input that is not cached). Real cache hit rates depend on your application, so this is a what-if lever, not a guarantee of cache behavior.
How is the monthly projection calculated?
When calls per day is greater than zero: daily USD = total per call × calls per day; monthly USD = daily × 30. It is a straight 30-day extrapolation with no weekend or seasonality adjustment.
Can I compare models by cost?
Yes. Toggle Compare all models to see total USD for every registry model with the same token counts and options. Select a row to return to single-model view with that model selected.
AI & LLM
Count tokens, estimate API costs, check context-window fit, convert JSON to TOON and analyze prompts, all in your browser.
Explore other tool categories
- Minify
Minify JavaScript, CSS, HTML, JSON, XML, SVG and other formats to cut the bytes you ship, before gzip or a CDN.
- Unminify
Make minified code readable again to debug or review it. Unminify JavaScript, CSS, TypeScript, SCSS, LESS, SQL, YAML and other formats.
- Conversion
Convert data between JSON, YAML, XML, CSV, TOML and other formats locally, with no upload to a server.
- Encoding
Encode or decode Base64, URLs, HTML entities and JWTs, and generate hashes and HMACs in your browser.
- Serialization
Serialize and deserialize PHP data structures beside JSON workflows.
- JSON Tools
Validate, format, repair, compare and explore JSON in your browser, alongside the JSON minifier and converters.
- SVG Tools
Preview, optimize with SVGO, export as a data URI, resize, beautify, convert to JSX and validate SVG in your browser.
- Beautify
Make code readable with consistent indentation. Beautify JavaScript, CSS, TypeScript, SCSS, LESS, Markdown, GraphQL, SQL, YAML and more in your browser.
- CSS preprocessors
Compile SCSS or LESS to standard CSS in your browser. Pair it with beautify or minify to handle a whole stylesheet.
- Color & CSS Tools
Check WCAG contrast, convert CSS colors and units, and generate shades, border-radius and box-shadow code in your browser.
- DevOps & Infra
Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.
- CI/CD
Format GitHub Actions and GitLab CI YAML and check the structure of workflows and jobs in your browser.
- Logs & observability
Format, filter and validate JSON and NDJSON logs, and turn Nginx or Apache access logs into CSV or TSV.
- Kubernetes
Multi-doc manifests, structural validate, Ingress/Deployment starters, and Helm values formatting.
- Networking / IP
Subnet calculator, IP converter, range to CIDR, CIDR summarize and IP-in-subnet checks for IPv4 and IPv6, in your browser.
- Security & tokens
Inspect JWKS, verify JWTs, decode X.509 certificates, convert PEM and JWK, scan text for secrets and hash with bcrypt in your browser.
- API & schemas
Format, validate, lint and convert OpenAPI, JSON Schema and GraphQL SDL in your browser.
- HTTP Tools
Paste cURL commands, HTTP messages, URLs, HAR files and Cookie or Set-Cookie headers to format and inspect them. Nothing is sent.
- SEO / Web Tools
Generate meta tags, Open Graph, Twitter Card, robots.txt, sitemap.xml and JSON-LD in your browser. Previews come from your input, and your site is never fetched.
- Developer utilities
Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugs, number bases, letter case, text diff, chmod and Lorem Ipsum, all in your browser.
- Text & Markdown
Count words, build Markdown tables of contents, turn CSV into Markdown tables and sort or deduplicate lines in your browser.
- Test Data
Dummy names, emails, phone numbers, addresses, dates, IBANs, card numbers and JSON, CSV or SQL rows for fixtures and database seeds. Everything is generated in your browser.
- Barcode labels
Draw Code 128, EAN-13 and UPC-A labels and static QR codes in your browser, then download PNG or SVG. This is not a GS1 lookup.