AI API Pricing Explained: Tokens, Cached Input, Credits and Tool Fees
Quick answer: AI API pricing usually depends on what your application processes and generates, not simply how many users you have. For text models, calculate input tokens, cached input tokens, output tokens and any additional tool or processing charges. A subscription to a consumer AI chat app is not necessarily an API allowance. The cheapest advertised input-token rate may not be the cheapest option for a workflow that generates long responses or uses paid tools.
Reviewed 1 November 2026: This article uses the current official OpenAI API pricing and token documentation as an example of metered AI billing. Rates change, so all worked calculations below use explicitly hypothetical prices unless otherwise stated. DealFlick has not run paid API load tests for this guide.
What does AI API token pricing mean?
An API lets a developer send a request to an AI service from software, a website or an automated workflow. A text model receives input such as instructions, documents or conversation history, then produces output. Providers commonly meter this activity in tokens, which are units of text representation rather than exact words or characters.
The input may include far more than the visible question. A customer support assistant might send a system instruction, product knowledge excerpts, conversation history, a customer question and tool results. The model’s response generates output tokens. Some models also use internal reasoning tokens that affect metering according to their documentation.
The result is a bill that depends on workload design. Two applications serving the same number of customers may have very different costs because one sends a short prompt and the other repeatedly attaches lengthy documents.
AI API pricing components compared
| Cost component | What it means | Buyer check |
|---|---|---|
| Input tokens | New prompt and context sent for processing | Average and peak request size |
| Cached input tokens | Eligible reused input processed at a separate rate | Actual cache-hit behavior and retention |
| Cache writes | Some modes charge for preparing cached content | Whether write premiums offset later savings |
| Output tokens | Text or other metered output produced | Typical completion length and model behavior |
| Tool calls | Search, code execution or other integrated services | Per-call and associated token charges |
| Audio and images | Separate modality-specific units or rates | Minutes, images, resolution or modality tokens |
| Processing tier | Standard, batch, flexible or fast service modes | Latency and rate differences |
| Regional processing | Optional location-specific processing arrangements | Eligibility and possible uplifts |
The core formula for estimating text-model costs
For a simple text-only workload, estimate cost as (uncached input tokens ÷ 1,000,000 × input rate) + (cached input tokens ÷ 1,000,000 × cached rate) + (output tokens ÷ 1,000,000 × output rate), then add any cache-write, tool, regional or processing-tier charges that apply. Rates must all refer to the same currency, model and billing mode.
As a hypothetical example, suppose a model costs $2 per million uncached input tokens, $0.20 per million cached input tokens and $10 per million output tokens. A workload with 2 million uncached input tokens, 1 million cached input tokens and 500,000 output tokens would cost $4 + $0.20 + $5 = $9.20 before other charges.
Those numbers illustrate the calculation and are not a promise that a particular model has those prices today. Check the current provider rate card and your account’s usage dashboard before building a financial forecast.
Why output tokens can dominate a budget
Some developers focus on input pricing because the model receives long documents. But output tokens can have a higher unit rate. A service that generates detailed reports, long-form explanations or code can spend a substantial share of its budget on completions. Short answers, constrained formats and a suitable model can help manage cost without automatically reducing usefulness.
Imagine two customer-support workflows. One returns a concise answer with a link to documentation. Another produces a 1,500-word explanation for every question, including simple password-reset queries. The second may consume far more output tokens without improving customer satisfaction. Cost optimization should follow the actual information need.
However, do not blindly cap output so aggressively that answers become incomplete. Test representative tasks, measure quality and identify the minimum sufficient response for each workflow.
Prompt caching: useful but not guaranteed savings
Prompt caching can reduce the price of eligible repeated input. It is most useful when requests reuse substantial shared instructions or reference material. The provider’s cache rules determine which prefixes qualify, how long entries persist and whether there are additional cache-write costs.
For example, a support bot may reuse the same product policy instructions across thousands of conversations. If that repeated context qualifies for caching, the application may pay less for the reused portion. But user-specific questions and changing conversation history can remain uncached, so the entire request should not be priced at the cached rate.
OpenAI’s current pricing documentation distinguishes input, cached input and, for some modes, cache writes. It also notes that processing modes and regional options can affect the rate. Review the live rate card instead of copying a discount percentage from a 2024 announcement into a 2026 cost forecast.
AI subscription vs API: a frequent buying mistake
A monthly subscription to a consumer AI chat application typically provides access through that application’s interface and usage rules. API access is a separate developer product with its own billing, quotas and terms unless the provider explicitly says otherwise. Do not assume a paid chat plan includes unlimited programmatic calls.
This distinction matters for founders building SaaS products. A human may use a chat app to draft a report, but an automated product generating reports for customers needs an API or other authorized integration. The product’s cost scales with usage and should be modeled per customer, per task or per unit of business value.
Review our seat-based vs usage-based SaaS pricing guide for a broader discussion of billing models. API consumption is one common driver of variable software cost.
Worked scenario: AI support chatbot
Imagine a small ecommerce store handles 5,000 AI-assisted questions per month. Each conversation averages 3,000 input tokens and 400 output tokens across the requests involved. The monthly estimate is 15 million input tokens and 2 million output tokens. Multiply those totals by the actual selected model rates, then add any tool or storage charges.
Suppose the hypothetical rates are $1 per million input tokens and $5 per million output tokens, with no caching. The model-token cost would be $15 + $10 = $25 before tool calls and infrastructure. If the same bot also performs paid searches or uses a knowledge-retrieval service, those charges must be included.
The important insight is not the illustrative dollar amount. It is the need to measure real conversations, including repeated messages, failed attempts and long contexts, before extrapolating cost.
Worked scenario: AI blog outline assistant
A writing assistant may receive a topic brief, brand instructions and several source summaries, then return an outline. If the tool sends 12,000 input tokens and produces 2,000 output tokens per request, 1,000 requests represent 12 million input and 2 million output tokens. That is a different cost profile from a support bot with short answers.
Some applications repeatedly send the same brand guidelines. Eligible caching could help. Another approach is to shorten redundant context and retrieve only relevant source excerpts. But aggressive truncation can cause factual omissions or poor recommendations. Compare cost and quality on the same representative evaluation set.
Do not assume generated content automatically satisfies search-engine quality requirements. Human editorial checks, source verification and originality remain necessary for a publishing business.
Tool charges and hidden variable costs
API features such as web search, file retrieval, code execution, audio transcription and image generation may use different billing units. Some charge per call plus tokens; others charge by minute, storage or modality-specific usage. A simple text token estimate can materially understate the total cost of an agent that invokes several tools.
For a workflow that searches the web twice, analyzes a document and writes a report, model output is only part of the expense. Add tool calls, file storage, application hosting, monitoring, retries and any third-party service charges. Track them separately so you know which part of the workflow is expensive.
Also distinguish direct API billing from prices charged by a reseller, cloud marketplace or integrated SaaS platform. A tool offering “AI credits” may bundle infrastructure and features in ways that do not translate directly into provider tokens.
How to compare AI credits with token-based billing
Credits are a product-specific accounting unit. One credit might represent a fixed number of generated images, a minute of audio or an internal bundle of model calls. There is no universal conversion from one platform’s credit to another platform’s token. Ask the vendor what actions consume credits and how the rate changes by model or feature.
Build a comparison around a real task: for example, generating 100 customer-support responses or transcribing ten hours of audio. Estimate the number of tasks supported by the credit bundle, not merely the number of credits displayed. Include expiry, rollover, overages and whether failed requests are charged.
Cost controls for a small SaaS team
- Set a monthly budget and alerts in the provider dashboard.
- Log tokens and tool calls by product feature, not just by API key.
- Use separate environments and credentials for testing and production.
- Measure average and high-percentile cost per successful task.
- Limit unnecessary conversation history and repeated context.
- Evaluate caching on realistic repeated prompts.
- Choose a smaller model for tasks where quality tests show it is sufficient.
- Set sensible output limits and retry policies.
- Protect API keys and rate-limit abusive requests.
- Recalculate unit economics after model or pricing changes.
How to compare models without relying on a single benchmark
Start with twenty to fifty representative tasks, including difficult edge cases. Record accuracy, completeness, response time, output length and estimated cost. A model with a lower token rate may need more retries or produce more tokens, making it more expensive per successful result. Conversely, a more expensive model may save time on complex tasks.
Use a quality threshold that reflects the business. A customer-support assistant must avoid inventing refund rules; a coding assistant must produce correct behavior; a content assistant must preserve factual sources. Cost should be evaluated only after the model meets the required standard.
Choosing between real-time and batch processing
Some workloads require an answer immediately, such as a customer chat. Others, like overnight categorization or document processing, can tolerate delayed completion. Providers may offer different processing tiers or batch rates. Check availability, latency expectations and whether all desired tools and models support the tier.
A discount is not valuable if the workflow misses a customer-facing deadline. Likewise, paying for low latency to process nonurgent reports overnight may waste budget. Match service level to the user experience rather than selecting a tier only by price.
Security and data-handling costs
Review retention, training controls, regional processing, access management and audit needs. Some enterprise or regional options may carry additional charges or require eligibility. Do not assume the cheapest API endpoint automatically meets contractual requirements for client data.
Before sending sensitive information, establish what the application actually needs. Redact unnecessary identifiers, manage API keys securely and document the data flow. Privacy and security should be included in the product’s total cost, not treated as optional extras after launch.
FAQ
Is API pricing charged per question?
Often not directly. Text API billing commonly depends on input and output tokens, with possible additional tool and processing charges.
Are cached tokens always cheaper?
Eligible cached input can have a lower read rate, but cache-write fees, eligibility and retention rules affect actual savings.
Does a ChatGPT subscription include API credits?
Do not assume it does. Consumer chat subscriptions and developer API billing are distinct unless an offer explicitly states otherwise.
Are AI credits the same as tokens?
No. Credits are defined by the platform and may represent a bundle of actions, calls or usage units.
How do I estimate monthly AI SaaS costs?
Measure realistic task counts, input/output tokens, cache hits, tool calls and retries; then apply the current rate card and add infrastructure costs.
Sources, authorship and disclosure
Prepared by the DealFlick editorial team with AI-assisted drafting, source checks and illustrative calculations on 1 November 2026. Official references: OpenAI API pricing and OpenAI token-counting guidance. No live vendor quote is represented by the hypothetical examples. Some DealFlick merchant links may earn commissions.