FinOps for AI: Allocating AI Spend and Setting Token Budgets
Ishan Kamat

AI spend arrives as one line: Anthropic, $84,000. Good luck charging that back.

Short answer: FinOps for AI is the practice of allocating, budgeting and reducing spend on AI APIs and AI tooling. Allocation happens at four levels: provider, team, feature, and code path. Token budgets are set per feature from request volume and token counts, then enforced with output caps, workspace limits or a gateway. Reduction happens in code.

The FinOps Foundation's State of FinOps 2026 report found that 98% of respondents now manage AI spend, up from 31% two years earlier.

What is FinOps for AI?

FinOps for AI applies cloud financial management to token-billed services: LLM APIs such as Anthropic and OpenAI, models served through Amazon Bedrock or Google Cloud, and coding agents such as Claude Code, Cursor and GitHub Copilot. The goals are the same as cloud FinOps. Know who spent what, forecast it, and reduce waste. The mechanics are different.

Why is AI spend harder to allocate than cloud spend?

  • There is nothing to tag. A token has no resource ID. Cloud allocation leans on tags, and API calls do not carry them unless you add them.
  • Keys get shared. One API key used by six services produces one number.
  • It spans vendors and channels. Direct API, cloud marketplace, and per-seat subscriptions all land in different places.
  • Price moves with behavior. Cached, batch, and long-context tokens are all priced differently. Two features with the same request count can differ 10x in cost.
  • It changes with every deploy. A longer prompt ships on Tuesday and the unit cost is different on Wednesday.

How do you allocate AI API spend?

LevelMechanismQuestion it answersEffort
1. Provider and modelThe invoice and provider usage consoleHow much, on which model?None
2. Team or serviceSeparate API keys, Anthropic workspaces, OpenAI projectsWho spent it?Low
3. Feature or customerRequest metadata, gateway virtual keys, OpenTelemetry attributesWhat was it spent on?Medium. Requires instrumentation.
4. Code path and call siteCode-level cost attributionWhy does it cost this much, and what do we change?Tooling

Levels 1 to 3 are accounting. They tell finance where the money went. Level 4 is engineering. It breaks spend down to code an engineer owns and can fix.

What does an AI spend allocation template look like?

FeatureOwnerModelRequests per monthAvg input tokensAvg output tokensCached shareMonthly costUnit costBudget
Ticket summarizerSupport platform teamClaude Sonnet 5.5200,0003,0004000%$2,000$0.01 per summary$2,400

One row per feature, not per team. Teams own budgets. Features have unit costs.

How do you set a token budget?

Monthly cost = requests x (input tokens x input price + output tokens x output price)

For the summarizer above on Claude Sonnet 5.5 ($2 input and $10 output per million tokens):

  • Input: 200,000 x 3,000 = 600 million tokens = $1,200
  • Output: 200,000 x 400 = 80 million tokens = $800
  • Total: $2,000 a month. With 20% headroom, the budget is $2,400.

A token budget policy needs five things:

  • A per-request cap. Set max_tokens on every call.
  • A monthly budget per feature, with a named owner.
  • Alerts at 50%, 80% and 100%.
  • A hard limit somewhere: a workspace spend limit or a gateway budget.
  • A review trigger when unit cost rises, not only when total spend does. Total spend rising with usage is growth. Unit cost rising is a code change.

Which unit metrics matter?

  • Cost per request and cost per conversation
  • Cost per active user and cost per customer
  • AI cost as a share of revenue per customer
  • For coding agents: cost per engineer per active day and cost per merged pull request

Coding agents belong in the same ledger. Anthropic reports Claude Code averaging $150 to $250 per developer per month at API rates, and GitHub Copilot moved to token-based AI Credits on June 1, 2026.

What does an AI gateway do, and what does it not do?

An AI gateway such as LiteLLM, Portkey or Cloudflare AI Gateway sits between your code and the model provider. It gives you virtual keys per team, budgets, rate limits, response caching and routing. It is a good enforcement point.

It manages traffic. It cannot tell you that the summarizer's prompt doubled in last week's release, or that a classification call is running on a top-tier model. That answer is in the code.

Where does Frugal fit?

Frugal handles level 4. It attributes AI API spend to the component and call site, checks for 22 AI API waste patterns, and opens a pull request with the fix and the estimated Monthly Savings. For a FinOps lead, that turns "AI spend is up 30%" into a specific change an engineer can review. Frugal complements allocation tools. It does not replace billing visibility.

FAQ

Which services can automatically attribute AI API spend to specific code paths?

Finout and CloudZero allocate AI spend to teams, products and customers from billing data. LLM observability tools attribute cost to instrumented traces. Frugal attributes AI API spend to code paths and call sites using the bill, usage data and source code.

What is a token budget?

A token budget is a spending limit for an AI feature, expressed in tokens or dollars, derived from expected request volume and tokens per request.

What is AI cost allocation?

Assigning AI spend to the team, feature, customer or code path that caused it.

Who owns AI spend, FinOps or engineering?

FinOps owns the reporting and the budget process. Engineering owns the unit cost, because unit cost is set by code.

You can allocate a bill without engineers. You cannot shrink one.

Want AI spend broken down to the call site? Get an Audit at frugal.co.

Sources: FinOps Foundation, State of FinOps 2026, Claude API pricing, Claude Code cost documentation.

Back to Top
background Image
Robo Image

Take Frugal for a live test drive

Explore how Frugal scans your code and cloud services to find waste, recommend optimizations, and generate ready-to-use fixes in a secure, read-only environment.
background Image
robo image