Skip to main content

Department Chargeback: Making AI Costs Visible to Every Budget Owner

Chargeback fails when every AI request flows through a shared provider account and finance receives one large invoice with no trustworthy explanation behind it. Keeptrusts changes that by attaching spend to user, team, wallet, model, and provider at runtime, then exposing the result in dashboards and exports that budget owners can actually use.

Use this page when

  • Finance or platform leadership wants each department to own its AI spend instead of treating AI as one shared overhead line.
  • You need team-level visibility before you can make sensible routing, caching, or budget decisions.
  • Your current month-end process still depends on spreadsheets and arguments rather than system-generated attribution.

Primary audience

  • Primary: Technical Leaders
  • Secondary: Finance owners, Technical Engineers

The problem

Most AI programs start with centralized procurement. One provider account is funded centrally. Teams are encouraged to experiment. That is a reasonable starting point, but it becomes a problem once usage scales.

The invoice tells you total spend, not ownership. Finance can see that the organization spent $62,000 on LLM usage in May, but not whether $28,000 came from engineering, $12,000 came from support, or $9,000 came from a single internal knowledge assistant. Without attribution, the budget conversation is structural nonsense. Nobody can be accountable for a shared number they did not control.

This creates three operational issues.

The first is slow finance close. Somebody has to reconstruct usage by application, environment, or provider key. That often means joining logs from several systems, none of which were designed for chargeback.

The second is bad behavior incentives. If departments do not see their own spend, they do not optimize it. The support team may keep paying for repeat questions that should be cached. Engineering may keep using a premium model for extraction work. No budget owner feels the tradeoff because the spend disappears into a central pool.

The third is weak governance. When teams share one budget line, nobody can decide rationally whether to add capacity, reduce premium usage, or shift simple work to a cheaper route. Dashboards become descriptive instead of actionable because the boundary between department behavior and department cost does not exist.

The solution

Keeptrusts makes chargeback a byproduct of execution instead of a separate accounting project.

The core mechanism is team-scoped attribution tied to wallets. A request enters the gateway with a team or consumer-group identity. The gateway reserves spend against the effective wallet scope, settles to actual cost when the response completes, and records model, provider, token usage, and cost metadata. That means the transaction already contains the information finance needs.

Billing budgets make the number meaningful to the budget owner. A department can receive alerts as spend approaches its target, while the wallet provides the hard cap if the organization wants strict enforcement.

Dashboards make ownership visible throughout the month, not just during finance close. Teams can see spend by model, provider, and trend line. Leadership can compare departments without hunting across multiple vendor consoles.

Exports make the chargeback package portable. A monthly events export gives finance or operations a clean artifact for cost allocation review, forecasting, or internal re-billing.

Implementation

The minimum viable setup is to assign each department a wallet and link its traffic to a consumer group. Then produce a monthly export for reconciliation.

version: '1'

providers:
targets:
- id: openai
provider: openai
secret_key_ref:
env: OPENAI_API_KEY

consumer_groups:
- name: engineering
api_key: kt_cg_engineering_prod
wallet_team_id: team_engineering
- name: support
api_key: kt_cg_support_prod
wallet_team_id: team_support
- name: legal
api_key: kt_cg_legal_prod
wallet_team_id: team_legal

cost_tracking:
enabled: true
wallet_enforcement: true

Now allocate the wallets and generate the monthly chargeback artifact:

curl -s -X POST "http://localhost:41002/v1/wallets/allocate" \
-H "Authorization: Bearer kt_admin_prod_token" \
-H "Content-Type: application/json" \
-d '{"team_id":"team_engineering","amount":20000.00,"currency":"USD","description":"Engineering May 2026"}'

curl -s -X POST "http://localhost:41002/v1/wallets/allocate" \
-H "Authorization: Bearer kt_admin_prod_token" \
-H "Content-Type: application/json" \
-d '{"team_id":"team_support","amount":8000.00,"currency":"USD","description":"Support May 2026"}'

kt export-jobs create --type events --format csv --date-from 2026-05-01 --date-to 2026-05-31

This pattern is what makes chargeback durable. The same identifier that determines which wallet pays for the request also determines how the request appears in the dashboard and export. Finance is no longer trying to infer departmental ownership after the fact.

Once that foundation exists, chargeback drives behavior change. A support leader who sees a high cacheable workload can justify caching. An engineering leader who sees too much premium-model usage can tighten routing. A legal team with low volume but high-value work can defend a higher-cost budget profile because the data is attached to a real department and use case.

Results and impact

Suppose four departments share a $62,000 monthly AI bill. Before chargeback, finance spends days reconstructing usage and still cannot prove which teams own the cost. Everyone agrees the number is too high, but nobody can act on it because the spend is not attached to the right boundary.

After Keeptrusts attribution is in place, the month-end view changes. Engineering is shown at $28,000, support at $12,000, legal at $3,000, and shared internal operations at $7,000, with the balance spread across smaller teams. That is immediately more useful than one invoice total because each budget owner can compare cost to output.

The ROI does not come only from accounting efficiency. It comes from local decision-making. Support sees that 30 percent of its volume is repetitive and can justify response caching. Engineering sees that a large fraction of spend comes from routine drafting and can justify stricter provider routing. Legal can defend premium usage because its workload is low-volume but high-stakes. Chargeback turns abstract optimization into department-level action.

The closing process improves too. Finance can use exports instead of assembling a report from several vendor portals and application logs. That reduces reconciliation effort and improves trust in the numbers because the same system that enforced spend also recorded it.

Key takeaways

  • Chargeback works only when spend attribution is attached to the request at runtime.
  • Team wallets create the cost boundary that dashboards and exports can report on consistently.
  • Department visibility improves behavior because budget owners finally see the tradeoffs between routing, caching, and model choice.
  • Exports matter because finance needs an auditable artifact, not just a screenshot of a dashboard.

Next steps