AI

What is Cost Per Inference?

Cost Per Inference is the average cost of running an AI model one time to generate a single response or prediction, accounting for compute, tokens, and any API fees involved. It's the core unit economics metric for any product built on top of AI models, since inference costs scale directly with usage.

TL;DR

Cost per inference is what it costs, on average, to get one answer out of an AI model. It's the unit economics number that determines whether an AI feature is profitable at scale.

Formula

Cost Per Inference = Total AI Compute or API Spend / Number of Inference Requests

Why It Matters

Unlike traditional software, where serving one more user costs almost nothing, AI features carry a real marginal cost every single time a model runs. That makes cost per inference the number that decides whether a product's AI features are actually profitable as usage grows, not just impressive in a demo. A team that ignores it can end up in a position where the more successful and widely used a feature becomes, the more money it loses. Tracking it also exposes which requests are expensive relative to the value they deliver, which is what makes routing strategies, like using a cheaper model for simple queries, possible in the first place. It's typically watched alongside inference latency and prompt success rate, since the cheapest model is only a good choice if it's still fast and accurate enough to be useful.

Example

A company spends $8,000 in a month on model API calls and processes 400,000 requests. Cost per inference is $8,000 divided by 400,000, which equals $0.02 per request. Switching to a smaller, faster model for simpler requests and reserving the larger, more expensive model only for complex queries is a common way to lower blended cost per inference without sacrificing quality on the requests that actually need the stronger model.

Frequently Asked Questions

  • It typically includes model API fees or compute costs, token consumption for both the prompt and the response, and any infrastructure overhead directly tied to serving that request. Fixed costs like model fine-tuning are usually tracked separately.

  • Cost per token measures the price of individual input or output tokens, while cost per inference is the fully loaded cost of one complete request, which can involve many tokens plus any fixed per-call fees. Cost per inference is the more useful number for judging whether a feature is economically viable.

  • Longer prompts and responses consume more tokens, and more complex requests often get routed to larger, costlier models. A short factual query and a long multi-step reasoning task can have very different costs even on the same model.

  • Most teams track it continuously through billing dashboards and review it at least monthly, since usage patterns and model pricing both shift over time. A sudden spike often signals a change in usage volume, prompt length, or model routing.

  • Routing simple requests to smaller, cheaper models while reserving larger models for complex queries is the most common approach. Caching repeated responses, shortening prompts, and negotiating volume pricing with the model provider also lower the blended average.