October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

AI API Pricing Explained: Input Tokens, Output Tokens, and Caching

AI API costs depend on more than a price per million tokens. Learn how input, output, reasoning, caching, and storage charges fit together—and how to estimate a representative request.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

AI API bills usually separate the tokens you send from the tokens a model generates. Eligible repeated input may be charged at a cached-input rate, while some caching features also charge for writes or storage. To estimate a request, use the exact model, usage mode, and rate categories on the provider’s current pricing page, then check the usage reported by the API.

What you pay for in an AI API request

Providers generally meter input and output separately. Input tokens are the material sent to the model; output tokens are generated by it. A provider’s pricing table may split these further into uncached input, cached input, cache writes, and output. The categories and billing rules are provider-specific, so do not assume a rate or cache rule from one API applies to another. OpenAI’s current pricing page, for example, lists distinct token categories and may show separate rates for context lengths or other configurations.

As an Amazon Associate I earn from qualifying purchases.

Generated reasoning tokens can count as output even if they are not visible in the final answer. As a result, visible response length alone may not tell you how much output was billed. Check the model’s usage reporting and pricing definitions; OpenAI’s token guidance explains this distinction.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical cost equation

Use this as a planning framework, then confirm the provider’s definitions and billing records:

Estimated token charge = uncached input tokens × uncached-input rate + cached input tokens × cached-input rate + output tokens × output rate + applicable cache-write, cache-storage, or feature charges.

If a price is listed per million tokens, divide the token count by 1,000,000 before multiplying by that rate. Do not automatically add a separate cache-write fee: OpenAI’s current guide presents cache-write pricing as an alternative input-token rate, not an additive fee.

For a hypothetical request with 10,000 input tokens and 1,000 output tokens, multiply each count by the selected model’s respective per-token rate. For an actual estimate, split eligible cached input from uncached input and include any applicable storage or non-token charges. The example shows the arithmetic only; it is not a quoted bill.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why tokens do not map neatly to words

Tokens are the units an API uses to process text, not a fixed word count. OpenAI’s rough English-language estimates are about 4 characters per token, three-quarters of a word per token, or 75 words per 100 tokens. These are approximate examples, not conversion constants: language, spelling, capitalization, spaces, and the model’s tokenizer all affect the count.

A plain-text estimate can also miss message structure, tool definitions, schemas, images, and files. For a more dependable estimate, use model-specific tokenization where available and compare it with the usage figures returned by the API.

How caching changes the calculation

Caching can lower the rate for eligible repeated prompt content, but the mechanics matter: what must repeat, how much content qualifies, how long it remains cached, and whether writes or storage incur charges. Do not treat “cached” as synonymous with free.

OpenAI prompt caching

OpenAI says the rendered prompt prefix must match for cache reuse, and eligible lengths and breakpoints depend on the model. Its current guide specifies a minimum cacheable prompt length of 1,024 tokens for GPT-5.6 and later models; thresholds vary for earlier models. These are model-specific rules and can change, so check the current prompt-caching guide for the model you intend to use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

As an illustration of the rates documented for the named GPT-5.6-and-later models, OpenAI says cache writes cost 1.25 times the standard uncached-input rate; cache reads cost 0.1 times that rate for most of those models and 0.05 times for GPT-6.1 Sol. At a 0.1-times read rate, one write plus nine full reads would cost 2.15 times the ordinary input cost of one processing pass, rather than 10 times for ten uncached passes. This comparison assumes those published rates and full eligible reuse; it is not a universal caching result.

Google Gemini caching

Google describes implicit caching for Gemini 2.5 and newer models, alongside explicit caching as a separate feature. For explicit caching, cost depends on token count and time-to-live (TTL); the documented default TTL is one hour when unset, and storage duration can contribute to cost. Cached-token, uncached-input, and output charges may all apply. Google’s caching guide labels explicit caching Beta and describes endpoints and SDK methods under v1beta; check the current documentation for availability and implementation details.

Google notes that “At certain volumes, using cached tokens is lower cost than passing in the same corpus of tokens repeatedly.” The qualification matters: savings depend on volume, reuse, and the applicable cache and storage charges.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to compare API prices without misleading yourself

A price per million tokens is only one input to the total. Compare the model and configuration you would actually use, with a representative workload, rather than comparing provider averages or a single headline rate.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Match the task to a model. Compare options capable of doing the same work, not just models with similar names or advertised rates.
  2. Estimate the input and output mix. Include prompt size, expected completion size, and reported reasoning usage where available. Do not infer billed output from the visible answer alone.
  3. Check caching rules. Establish whether caching is implicit or explicit, what content must match, minimum-size and lifetime rules, read and write rates, and any storage fees.
  4. Match configuration and modality. Verify the service tier, context length, and whether the request uses text, image, audio, video, batch, priority, grounding, or another separately priced feature.
  5. Measure representative requests. Run sample tasks, inspect API-reported usage, and calculate cost per completed task at your expected volume. Repeat for different prompt shapes if your workload varies.

OpenAI’s Help Center cautions that “A lower price per million tokens does not necessarily produce a lower total cost: models can tokenize the same text differently and generate different amounts of output or reasoning.” It recommends: “Test representative tasks rather than comparing only the visible response length.”

Official price examples are snapshots, not market rates

Provider prices change, and a listed rate is specific to a model, tier, modality, and effective period. Recheck the relevant row before budgeting or deployment. OpenAI’s pricing page presents rates per one million tokens and distinguishes input, cached input, cache writes, and output; some models also have short- and long-context columns.

As one dated Google example, its pricing page listed Gemini 3.1 Flash-Lite Standard at $0.25 per 1 million text, image, or video input tokens; $0.50 per 1 million audio input tokens; $1.50 per 1 million output tokens; and $0.025 per 1 million text, image, or video cached tokens, plus $1.00 per 1 million tokens per hour for storage. These are Google AI for Developers figures accessed on October 7, 2026, not a general rate or a promise of current pricing. The same page lists different rates for Batch, Flex, and Priority tiers. See the current Gemini API pricing for the live model and configuration details.

Some Google listings also show scheduled rate changes. If a price is marked “through December 31, 2026” or “starting January 1, 2027,” keep the model, tier, modality, and effective date attached to the rate; prices from different periods are not interchangeable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.