OCXLY
AI Labs · Free Tool

LLM API Cost Calculator

Enter your input and output token counts, then compare the cost across model price tiers — GPT, Claude, Gemini and more, side by side. Every price is editable, so when the rate cards change you can keep this accurate in seconds.

Your usage (per call)
≈ 0 tokens (BPE approximation)
≈ 0 tokens (BPE approximation)
Model price tiers — per 1M tokens (editable)
ModelInput $/1MOutput $/1MCost

On the prices: the defaults are seed figures gathered around April–May 2026 and are approximate. Model line-ups and rates change often — always confirm against each provider's official pricing page, and edit any cell here to match. This tool does the maths; you keep it current.

§ 01

How API pricing works

Almost every large-language-model API bills per token, quoted per million tokens (often written /1M or /MTok), and crucially it bills input and output separately. Input tokens are everything you send — your system prompt, the conversation history, retrieved documents, the user's message. Output tokens are what the model generates back.

LLM API Cost Calculator infographic — how per-token pricing works, why output costs more, and how to match the right model to the task.

Output is almost always the more expensive of the two, frequently by a factor of three to five. That single fact is the biggest lever on your bill: a verbose model that pads every answer can cost far more than its headline rate suggests, while a terse one punches above its price tier. When you compare models here, watch the output column.

Why the spread between models is so wide

The cheapest capable models and the premium flagships can differ by 30–50× per token. A high-volume, simple task — classification, extraction, routing, formatting — rarely needs a flagship reasoning model; sending it to a small, cheap tier can cut the bill by the better part of two orders of magnitude with no real loss in quality. The skill is matching the model to the task, and this calculator makes that trade-off visible in dollars.

Discounts this tool doesn't assume

The estimate here is the standard, list-price, real-time cost. Most providers offer levers that cut it substantially: batch processing (typically around 50% off for non-urgent work), prompt caching (up to ~90% off repeated input such as a fixed system prompt), and tiered or committed-use discounts. If you use these, your real cost will be lower than shown — treat this figure as the unoptimised ceiling.

Reasoning tokens and a caveat on counts

Reasoning models that "think" before answering bill those internal thinking tokens as output, so a short visible answer can carry a large hidden output cost. And remember the token counts you enter are themselves estimates unless they come from a real tokeniser or an API usage field — pair this with a token counter for the input side. The goal is a fast, private, defensible ballpark for choosing a model and sizing a budget, not an invoice.

Privacy

Everything is computed in your browser. No usage figures, prices, or pasted text leave your device.