DEV Community

Odd_Background_328
Odd_Background_328

Posted on

Attribute Shared AI Inference Cost Before You Split Keys

An illustrative scenario

(This is a hypothetical setup, not a reported incident.)

Your platform team issues one inference gateway key to six squads. Finance asks which squad drove last month's spend. You have one invoice line and no attribution.

Two options: split keys now, or attribute usage first. The order matters.

Why the shared key hides the cost

A shared key collapses many workloads into one billing dimension. That is fine for routing. It is useless for chargeback.

FOCUS 1.2 keeps the unit attached: a usage quantity only compares to another quantity when its unit of measure and resource travel with it (FOCUS resource usage). A bare tokens=412000 is not a usage record. 412000 input_tokens, model=X, squad=payments is.

NIST AI RMF 1.0 is voluntary. Govern 2.1 still gives you a useful test: can you name who is responsible and how that responsibility is communicated? (NIST AI RMF Core)

If the answer is "the shared key", you cannot answer a cost question either.

Steps

  1. Choose exactly one attribution key: squad, workload, or environment.
  2. Make the gateway log quantity, unit, model, and owner label per request. (Illustrative field list, not a required schema.)
  3. Write an ownership register: one accountable person per key and route.
  4. Price those records with a rate table, then sum per owner.
  5. Reconcile the sum against the invoice before touching credentials.
  6. Split keys last. Keep the shared key as rollback until one cycle reconciles clean.

Test

Run a reconciliation drill on the last closed invoice:

  • Sum usage units per owner from gateway logs.
  • Multiply by your rate table.
  • Subtract that total from the invoice total.
  • The difference is unattributed spend.

Expected observations: each owner shows a nonzero total, and the remainder sits under a threshold you set in advance. If the remainder is large, your labels are missing or the unit is wrong. Fix attribution first, and do not split keys yet.

If a split key later bills spend with no owner, revert to the shared key and re-run the drill. Unit discipline and a named owner are cheap to restore early. Reconstructing attribution after quota is spent is not.

When this does not apply

A single-team deployment with one budget owner needs no chargeback. Splitting keys there adds rotation work for no decision.

This article was created with AI assistance.

Top comments (0)