How to attribute AI spend to features

Sam Russell, Product Lead

Connect the provider, then attribute the spend through the same relationships that attribute the rest of the estate. What makes this harder than cloud is that an inference call is an event rather than a resource, so there is no object for anyone to label.

Why the usual method does not reach it

Tagging is a provisioning-time concept. A resource is created, somebody applies a label, and the label travels with the resource for as long as it exists. Every allocation method built on tags inherits that assumption, including the ones that read tags indirectly.

An inference call exists for the duration of the call. There is no resource to label, no provisioning event to attach a convention to, and nothing that persists afterwards except a line in a usage report.

The handles that are available are the API key and the workspace. Both are weaker than they look. Keys get shared between features because that was easier at the time, reused across environments, and rotated by people who have no idea a cost model depends on them. A mapping from key to feature is accurate until the first time somebody reuses a key, and nothing announces that moment.

So the fastest-growing line on most technology bills is the one the conventional method reaches least well.

What has to be true first

Attribution comes before this, and the order is not a preference.

AI attributed to a feature, sitting next to cloud infrastructure that is not attributed, produces a feature cost that is still an estimate. The assisted call carries model inference, retrieval, the application, the database, the storage and the logging, and if only the first of those is traced then the number describes a fraction of what the feature actually costs.

Which means the honest answer to "how do I attribute AI spend to a feature" starts one step earlier: attribute the estate, then the AI spend has somewhere to land.

Where the spend comes in

Two routes, and knowing which is which saves a conversation.

Spend with an AI provider arrives through a provider connection. OPTIMAZE ingests token-level usage and cost from the Anthropic Admin API, the OpenAI Costs API and the Cursor Admin API, so the spend lands at the resolution the provider bills at rather than as a monthly figure that has to be broken apart afterwards.

AI running on cloud infrastructure arrives through the cloud billing connection instead. Managed model services, inference on your own compute, vector stores running as cloud resources, all of it comes in with the rest of the cloud bill rather than as a separate AI source. Two routes, one attributed model underneath.

What attributing it to a feature actually gives you

Cost per feature stops being a monthly total and becomes a figure attached to a specific product behaviour. That distinction sounds small and changes three conversations.

Pricing, because the assisted call and the plain call cost different amounts and a single blended average describes neither. Forecasting, because AI spend is forecast on the relationship between usage and cost rather than on last month's invoice, which matters when usage is the thing that moved. And prioritisation, because a feature whose cost per call is ten times the median is visible while the roadmap is still being argued about rather than after the quarter closed.

Token-level detail is what makes the pricing conversation possible at all. Output length varies widely between calls of the same type, so a single average cost per assisted call describes the typical one accurately and the expensive one not at all, and the gap between those two is where a margin quietly goes. A blended figure is enough to negotiate a contract on. It is not enough to work out which usage pattern is the one costing money.

The pattern worth watching for is concentration. When AI spend is first attributed, the distribution is usually narrower than anyone expected, and some of it sits behind functionality nobody would have funded at that price had the price been visible when the decision was made.

When you do not need any of this

One product, one API key, one feature calling it, and the answer is arithmetic. Take the provider invoice, divide by the calls, and the number is right.

That stops being true the moment a second feature shares the key, a batch job starts using the same workspace, or somebody adds retrieval that runs on infrastructure billed somewhere else. The method does not gradually degrade, it stops being correct and carries on producing a number.

Common questions

Can AI spend be attributed without tags?

Yes, and it generally has to be. There is no resource for a tag to attach to, so attribution has to be derived from how accounts, keys, workloads and services relate rather than from a label applied at provisioning time.

Which AI providers does OPTIMAZE ingest directly?

Anthropic, OpenAI and Cursor, through their admin and cost APIs, at token level. Model spend running on cloud infrastructure arrives through the cloud billing connection rather than as a separate AI source.

Can AI cost be broken down to the token?

Yes. Usage and cost arrive from the provider APIs at token level, which is the resolution the provider bills at, so the detail is available rather than reconstructed from a monthly total.

Why is AI cost harder to attribute than cloud cost?

Cloud spend attaches to resources that exist over time and can be inspected. AI spend attaches to events that have already finished. The cost is real and the object it belongs to is gone, so the relationship has to be established from context rather than read off the resource.

What do I need before attributing AI spend to a feature?

Attributed spend across the rest of the estate. Otherwise the feature's AI cost is precise and the rest of its cost is an estimate, which produces a total nobody can defend.

Read next

How do I get unit economics for technology spend?

What is attribution?

What is Technology Capital Performance?

Technology Capital Performance is the measurement of whether technology spend is producing a proportionate, attributable return.

© 2026 Optimaze Services Pty Ltd

Technology Capital Performance is the measurement of whether technology spend is producing a proportionate, attributable return.

Technology Capital Performance is the measurement of whether technology spend is producing a proportionate, attributable return.