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 — all in your browser.

Browser-local LLM cost estimates
Turn token counts into USD per-call estimates using our maintained per-model price table — no live scraping, no provider billing APIs.

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. Disputes → 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 — 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 cluster 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. Click a row to select 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 — 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 vs uncached input). Real cache hit rates depend on your application — 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. Click a row to return to single-model view with that model selected.

AI & LLM

Token counting, pricing estimates, and context-window fit — 100% browser-local.

Explore other tool categories

Minify

Shrink code and assets for production — minify JavaScript, CSS, HTML, JSON and XML before gzip or CDN deploy.

Unminify

Expand minified or compressed code — unminify JavaScript, CSS, TypeScript, SCSS, LESS, SQL, YAML and other formats when debugging or reviewing.

Conversion

Transform data between JSON, YAML, XML and CSV locally — no server uploads.

Encoding

Encode or decode Base64, URL components and HTML entities — client-side only.

Serialization

Serialize and deserialize PHP data structures beside JSON workflows.

JSON Tools

Validate, format, diff and explore JSON payloads — complementary to minifiers and converters.

SVG Tools

Preview, optimize with SVGO, export Data URI, resize, beautify, convert to JSX and validate SVG — all 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 the browser — pair with beautify or minify for a full stylesheet workflow.

Color & CSS Tools

Paste-local WCAG contrast checking with modern CSS color syntax — pair and matrix views, never uploaded.

DevOps & Infra

Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.

CI/CD

GitHub Actions and GitLab CI — format YAML and check workflow/job structure in your browser.

Logs & observability

Line-oriented JSON/NDJSON and Nginx/Apache access logs — format, filter, validate, and CSV/TSV.

Kubernetes

Multi-doc manifests, structural validate, Ingress/Deployment starters, and Helm values formatting.

Networking / IP

CIDR, subnets, and IPv4/IPv6 helpers — in your browser.

Security & tokens

JWKS, X.509 certificates, and secrets scan — browser-local.

API & schemas

OpenAPI tools to format, validate, and lint your specs.

HTTP Tools

Paste-local cURL, HTTP messages, URLs, HAR files, and Cookie / Set-Cookie headers — format and inspect in your browser, never sent.

Developer utilities

Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugify, number bases, case, text diff, and chmod — all client-side.

Text & Markdown

Count words, build Markdown TOCs, and clean line lists — all in your browser.

Test Data

Synthetic field values for fixtures and DB seed — reserved-range phone numbers first.