Artificial Intelligence

5 Steps to Cost per Request for Shared Cloud AI Spend

Engineer reviewing a cloud cost dashboard on a laptop beside racks of GPU servers in a data center
Christina Morillo

Cost per request is the total cost of running an AI feature, shared infrastructure included, divided by the number of requests it serves. A unit cost built only from the metered part, such as tokens or GPU-seconds, leaves out idle capacity, committed spend, networking and observability, and then looks healthy while the bill does not. The fix is a five-step worksheet: normalize the billing data, split fixed cost from variable cost, choose allocation drivers for shared resources, compute the number, and gate releases on it.

The worksheet starts from raw billing exports rather than from provider dashboards, because dashboards aggregate and each provider names the same things differently. FOCUS is an open specification that normalizes billing datasets across AI, cloud, SaaS, data center and other technology vendors, so one query can run against exports from different providers. This article covers the meter, not the levers: it does not discuss model choice, quantization or discount plans, only how to measure what a feature costs.

Step 1: Normalize the billing data

Export the raw cost and usage data for every account that touches the workload: the model endpoint, the GPU fleet, the vector store, network egress and the observability stack. Keep three facts attached to every row: who owns the resource, which service produced the charge, and how the charge behaves over time.

Before any calculation, choose one cost basis and keep it for the whole period. The cash view shows what the invoice charged this month, so an annual commitment appears as a single large line in the month it was bought. The amortized view spreads that commitment over its term. It is the right basis for a unit cost, because a request served in July should not look free just because its capacity was paid for in January. If invoices arrive in dollars while budgets run in euros, record the exchange rate and its date next to the export instead of converting ad hoc.

Treat credits and refunds as a separate layer. The unit cost should describe what the workload consumed. Subtract discounts afterwards if a net figure is needed, and label which of the two is being shown.

Step 2: Separate fixed from variable

Every cost line is fixed, variable or shared. Fixed lines do not move with traffic: provisioned throughput, reserved GPU hours, minimum replicas that keep an endpoint warm, standby regions. Variable lines move with traffic: on-demand tokens, GPU-seconds billed beyond the baseline, bytes transferred. Shared lines serve several products at once: a NAT gateway, a tracing backend, a vector database.

Ownership starts with how resources are organized. Microsoft’s cost management guidance says that you should “organize your resources to maximize insight into cost attribution”, and that people must be accountable for their team’s spending. In practice that means a resource ID maps to exactly one owner, and that the mapping lives in code, not in a spreadsheet someone updates by hand.

The table below assigns a default driver to each kind of line. Treat it as a starting point to review against the workload, not as a rule that fits every bill.

Cost lineBehaviourAllocation driver
Provisioned throughput or reserved GPU hoursFixedRequests served
Minimum-replica instances keeping an endpoint warmFixedRequests served
On-demand tokens and GPU-secondsVariableMetered usage per product
Vector database and storageMostly fixedRequests for retrieval products
NAT gateway and egressSemi-variableBytes transferred
Tracing and evaluation storageGrows with trafficSpans or tokens ingested

Step 3: Pick allocation drivers

AWS describes awareness as “knowing where spend goes, which team or product owns it, and whether the resources behind it are still needed”. That sentence is the test for every allocation driver: after the split, each product should be able to point at its own share and explain it.

Apply drivers in order of precision. Direct metering comes first: if a product’s traffic can be separated in the gateway logs, charge its variable cost straight from the logs. Dedicated capacity comes second: a reserved pool assigned to one team belongs to that team even when its usage is low. The remainder is spread by a driver that is measurable per product, proportional to consumption and stable from month to month. Request counts work for latency-bound endpoints. Input tokens work better for prompt-heavy products. Weighted tokens, with output tokens counted more heavily because each one needs its own pass through the model, come closest to real GPU time for most LLM workloads.

Write each rule down and version it. When the rule changes, the unit cost jumps for reasons that have nothing to do with engineering, and the only defence is a changelog that says why.

Step 4: Compute unit cost

The formula is short: allocated fixed cost plus variable cost plus shared overhead, divided by the request count chosen in step three.

Count attempts, not user actions. A request that was retried three times consumed three runs of the model, and a response that was cut off and regenerated consumed two. If the denominator counts only what the user sees, every reliability problem becomes invisible in the unit cost. Keep the success rate next to it, so that a falling unit cost caused by fewer retries shows up as the reliability gain it is. The decision of when to retry a truncated response has its own trade-offs, covered in LLM Output Truncation: A Safe Recovery Decision Guide.

Report two numbers side by side: cost per request and cost per million tokens. The first is what a product owner can act on. The second is comparable across products and survives changes in prompt length. When they move in opposite directions, the workload mix changed, and that is worth knowing before anyone claims a win.

Step 5: Gate releases on it

A unit cost computed monthly arrives too late to change a release. Compute it per deployment window, compare it with the previous release and treat a regression as a signal with the same standing as a latency or error-budget breach. The mechanics match any other release gate for model deployments: a threshold, an owner and a written exception path.

The FinOps Framework states it plainly: “The FinOps journey consists of Inform, Optimize and Operate”. The unit cost is the Inform step. Without it, Optimize has nothing to measure and Operate has nothing to track.

Set the threshold on the absolute number, not on the percentage change of a small base. A product with a few hundred requests a month swings wildly from random variation. Wait for a volume floor before enforcing anything.

Worked example, hypothetical

The numbers below are an illustration, not a benchmark. One inference endpoint serves two products from the same provisioned GPU pool.

Fixed cost: $4,800 a month for provisioned capacity. Variable cost: $2,700 for on-demand tokens beyond the pool. Shared overhead: $500 for NAT, storage and tracing. Total: $8,000. Attempts served: 2,000,000.

Cost per request is $8,000 divided by 2,000,000, or $0.004. The metered-only view, the one most dashboards show by default, reports $2,700 divided by 2,000,000, or $0.00135: roughly a third of the real cost. Both figures are arithmetically correct. Only one can be compared with revenue.

Product AProduct B
Share of requests60%40%
Allocated fixed and shared cost$3,180$2,120
Direct variable cost$900$1,800
Total cost$4,080$3,920
Attempts1,200,000800,000
Cost per request$0.0034$0.0049

Product B sends fewer requests with longer prompts, so it carries less of the fixed pool and more of the variable cost. Per request it is the more expensive product, even though it is the smaller one by traffic. An allocation by tokens alone would have hidden that. An allocation by requests alone would have exaggerated it.

Where the number misleads

  • Volume growth: fixed cost spread over more requests lowers the unit cost with no engineering change. Compare at similar volumes, or report the fixed and variable terms separately.
  • Cash-view spikes: a commitment purchase month distorts the unit cost. Use the amortized basis.
  • Cache hits: prompt caching makes cost depend on prefix reuse, so the same request count can cost different amounts in two different weeks. Segment by cache behaviour.
  • Interruptions: a preempted GPU job reruns, doubling attempts for the same output. Keep reruns in both the numerator and the denominator.

None of these limits argues against the metric. They argue for publishing the method with the number, the same way a benchmark is published with its hardware and settings.

About this article: written by the CloudAI editorial desk in a technical analysis role; no individual author is attributed. First published 25 November 2026, revised the same day. Method: desk review of primary documentation from the FOCUS project, the FinOps Foundation, Microsoft and AWS, accessed 25 November 2026. The worked example is hypothetical. Limits: the worksheet does not cover licence negotiations, on-premises depreciation or the cost of engineering time.

Sources

  • FOCUS project, “FinOps Open Cost & Usage Specification” (homepage), focus.finops.org, accessed 25 November 2026.
  • FOCUS project, “What is FOCUS?”, focus.finops.org/what-is-focus/, accessed 25 November 2026.
  • Microsoft, “Optimize your cloud investment with Cost Management”, learn.microsoft.com, accessed 25 November 2026.
  • Amazon Web Services, “Cost optimization”, AWS Well-Architected Framework, docs.aws.amazon.com, accessed 25 November 2026.
  • FinOps Foundation, “FinOps Framework Overview”, finops.org, accessed 25 November 2026.

Keep exploring