
Who Pays for the Token? AI Showback vs Chargeback
We asked whether teams should be invoiced for their AI tokens. Here is the model we chose, the data behind it, and the exact queries that run it on AWS.
In a nutshell: the platform stays central, tokens are shown weekly, stable features are charged per business outcome.
This is the file our finance team receives at the end of every month:
team | feature | outcome | count | price_usd | charge_usd |
|---|---|---|---|---|---|
support | ticket-drafting | resolved_ticket | 11,842 | 0.35 | 4,144.70 |
legal | contract-review | reviewed_doc | 612 | 1.10 | 673.20 |
sales | email-drafting | — | — | — | showback only |
(Demo data. The shape is real, the numbers are not ours to publish.)
Look at what is missing. There is not a single token in it. No model IDs, no input and output counts, no "Claude vs Nova". Finance gets three lines: what the team produced, what one unit of it cost, and the total. The sales team is not on the invoice at all, and that is deliberate.
This post is about how we got from "who spent this?" to that file. In "A Token Without a Name" we traced every Amazon Bedrock token to a user, a team and a feature. The article ended with a question: would you charge your teams for their tokens today, or wait until you can measure what those tokens earn? The discussion under it was longer than the article itself.
Here is our answer. I'll explain why per-token chargeback fails, which model we chose instead, and then show the Python and SQL that run it with Amazon Bedrock, CUR 2.0 and Amazon Athena.
Let's jump in!
Why this question suddenly matters
Two years ago, AI spend was a side topic for FinOps teams. Today it is the main one. In the FinOps Foundation's State of FinOps 2026, 98% of practitioners said they manage AI spend, up from 31% two years earlier [1].

Share of FinOps practitioners managing each technology scope, earlier years vs 2026
The same survey shows FinOps work moving earlier in the lifecycle: teams want cost context before they deploy, not after the bill arrives [1]. That is exactly where the showback vs chargeback decision lives. It decides what engineers see while they build, and what they are held accountable for afterwards.
Showback and chargeback in 60 seconds
Both use the same allocated cost data. The difference is what happens next.
| Showback | Chargeback |
|---|---|---|
What the team gets | A report | An entry in its budget |
Does money move? | No | Yes |
Can it use estimates? | Yes, if clearly labelled | Only with a reconciliation process |
Main risk | Nobody acts on it | Disputes when allocation is weak |
The FinOps Framework puts it plainly: showback is required in every FinOps practice, chargeback depends on the organisation's accounting policy, and the primary difference between them is the formality of booking cost into official budgets [2]. Showback is a mirror. Chargeback is an invoice.
So the real question is not "showback or chargeback?". It is: what exactly should a team be invoiced for?
Why tokens make a bad invoice
Tokens are the obvious unit. That is the trap. Here are three reasons we stopped considering them.
1. A token bill punishes success
Imagine two teams. The support assistant resolved 12,000 tickets last month and spent $4,200. The sales team ran a pilot that drafted 300 emails and spent $900.

The same two teams viewed per token and per outcome lead to opposite conclusions
Charge them per token and support looks 4.7 times more expensive. Charge them per outcome and the pilot is 8.6 times more expensive per unit of work. Same data, opposite conclusions. A token invoice tells the most-used feature in the company that it is the problem.
2. Teams do not control the price of a token
The expensive decisions often happen far from the team that pays. Output tokens cost several times more than input tokens, so the length of an answer is a cost decision. In AWS's own example of a chatbot on Claude 4.6 Sonnet, output tokens were 62% of the volume and 89% of the bill [3].

Example monthly cost of input vs output tokens for one chatbot
Add conversation length, retries, prompt caching and the model choice made in a shared configuration, and you get a number that moves for reasons the paying team often cannot see.
3. We cannot invoice an estimate
Bedrock gives us two numbers, and neither one alone is invoice-ready per feature.
The bill (CUR 2.0) is invoice-accurate and, with IAM principal data, knows which user or team made the call. But it aggregates cost by usage type over an hour or a day and never contains a per-request row [4].
The invocation logs know every prompt, every feature and every ticket ID. But cost calculated from logs is tokens multiplied by a rate card you maintain, and it ignores discounts, commitments and batch pricing unless you model them [5].
Finance books the first number. Teams understand the second. A good chargeback model needs both.
The decision: three layers, three rules
We split AI spend into three layers and gave each one exactly one rule.
Layer | Examples | Rule | Cadence |
|---|---|---|---|
Platform | Gateway, logging, guardrails, dashboards | Stays a central cost | Yearly budget |
Tokens | Every Bedrock call | Every Bedrock call | Weekly showback |
Outcomes | Resolved ticket, reviewed contract | Charged at a fixed price per outcome | Monthly invoice, quarterly price |
The platform stays central because no single team chooses it. Charging it back would only create arguments about allocation keys.
Tokens are shown to everyone, every week. This is where engineers learn, and nobody is punished for learning.
Outcomes are charged, but only for stable features, and at a price that is set once per quarter from the real, invoice-reconciled cost of the previous quarter.
That last detail does most of the work. A team that makes its feature cheaper this quarter, with a smaller model or prompt caching, sees a lower price next quarter. Finance gets a rate it can put into a budget. The FinOps Framework explicitly allows estimates during a period as long as they are reconciled once invoicing is complete [2]. Our quarterly true-up is exactly that.
Actual cost per resolved ticket vs the price charged to the team, quarter by quarter

How a feature graduates to chargeback
Nothing starts on an invoice. A feature moves from showback to chargeback only when three things are true: it has a named owner, every request carries an outcome ID we can count, and it ran stable for a full quarter so its price reflects behaviour rather than a pilot.

Lifecycle: every feature starts in showback, becomes a candidate with an owner and outcome ID, and is charged after a stable quarter
The way back matters too. If a team changes what its outcome means, the feature drops back to showback for a quarter. More on why in the production section.
This is how both camps from the comments got what they asked for. New features get a quarter of free visibility, which is the experimentation budget the "wait" camp wanted. Stable features get an invoice, which is the accountability the "charge now" camp wanted.
How the pieces fit together on AWS
Here is how one support ticket travels through the system, from left to right.
A support agent asks the assistant for a draft. The LLM gateway, running on Amazon ECS on Fargate, calls Amazon Bedrock under a role assumed for that user and tagged with team and cost center. It also stamps the feature name and the ticket ID on the request. Bedrock writes one invocation log entry per request and records the caller on the CUR 2.0 billing export, which lands in Amazon S3 next to the list of resolved tickets from the ticketing system. Amazon Athena joins all three. Amazon Managed Grafana shows team leads their tokens per feature every week, and once a month Athena produces the chargeback file you saw at the top.

Reference architecture: support assistant → LLM gateway → Amazon Bedrock → CUR 2.0, invocation logs and resolved tickets → Athena → weekly showback in Grafana and monthly chargeback to the ledger
Now let's build the four pieces that matter.
Step 1: Give every call a name and an outcome
Behind a shared gateway, Bedrock records the gateway's role as the caller. To keep user and team attribution on the bill, the gateway assumes its Bedrock role per user, caches the credentials for the session lifetime, and passes the team as a session tag [4]. Request metadata then carries the per-call details into the invocation logs.
import hashlib, time, boto3
sts = boto3.client("sts")_cache = {} # user -> (credentials, expiry)
BEDROCK_ROLE = "arn:aws:iam::123456789012:role/bedrock-gateway-user"
def bedrock_for(user_id: str, team: str, cost_center: str): """One Bedrock client per user session, so CUR 2.0 sees the user, not the gateway.""" uid = hashlib.sha256(user_id.encode()).hexdigest()[:16] # no emails in billing data creds, exp = _cache.get(uid, (None, 0)) if time.time() > exp - 300: resp = sts.assume_role( RoleArn=BEDROCK_ROLE, RoleSessionName=f"u-{uid}", Tags=[{"Key": "team", "Value": team}, {"Key": "costcenter", "Value": cost_center}], DurationSeconds=3600, ) creds = resp["Credentials"] exp = creds["Expiration"].timestamp() _cache[uid] = (creds, exp) return boto3.client( "bedrock-runtime", aws_access_key_id=creds["AccessKeyId"], aws_secret_access_key=creds["SecretAccessKey"], aws_session_token=creds["SessionToken"], ), uid
def draft_reply(user_id, team, cost_center, ticket_id, model_id, messages): client, uid = bedrock_for(user_id, team, cost_center) return client.converse( modelId=model_id, messages=messages, requestMetadata={ # lands in invocation logs, never on the bill "team": team, "feature": "ticket-drafting", "outcome_type": "resolved_ticket", "outcome_id": ticket_id, "user": uid, }, )
Three details are easy to miss:
- Cache the credentials. AWS recommends caching them for the session lifetime instead of calling STS on every request [4].
- The role's trust policy must allow
sts:TagSession, otherwise the session tags are rejected.
- Keep metadata small and boring. Bedrock allows at most 16 entries per request, 256 characters per key and value, and AWS advises against putting PII in it, because the values live in your logs [5]. That is why the user is a hash.
Step 2: Turn on the bill side
Two switches in the AWS Billing console make the money side work:
- Create a CUR 2.0 export in AWS Data Exports and select Include caller identity (IAM principal) allocation data. This populates the
line_item_iam_principalcolumn and adds principal tags with theiamPrincipal/prefix [3].
- Activate
teamandcostcenteras cost allocation tags, so they appear in CUR and Cost Explorer.
Expect bigger CUR files: usage that used to be one row is now split into one row per principal [3]. Enable model invocation logging to S3 in every Region you use, too. Request metadata is only kept when logging is on [5].
A quick sanity check in Athena:
SELECT tags['iamPrincipal/team'] AS team, SUM(line_item_unblended_cost) AS invoice_usdFROM cur2WHERE line_item_product_code IN ('AmazonBedrock', 'AmazonBedrockService') AND billing_period = '2026-09' AND line_item_iam_principal IS NOT NULLGROUP BY 1ORDER BY invoice_usd DESC;
If this returns your teams with dollar amounts, the bill knows who made the calls.
Step 3: Set the quarterly price per outcome
This is the heart of the model. The bill knows dollars per team but not per feature. The logs know features and outcomes but only estimated dollars. So we use the logs to split each team's invoice-accurate dollars across its features, then divide by the number of real outcomes.
WITH invoice AS ( -- money truth: invoice-accurate dollars per team SELECT tags['iamPrincipal/team'] AS team, SUM(line_item_unblended_cost) AS invoice_usd FROM cur2 WHERE line_item_product_code IN ('AmazonBedrock', 'AmazonBedrockService') AND billing_period BETWEEN '2026-07' AND '2026-09' AND line_item_iam_principal IS NOT NULL GROUP BY 1),usage AS ( -- behaviour truth: estimated cost per feature from logs SELECT l.requestmetadata['team'] AS team, l.requestmetadata['feature'] AS feature, SUM(l.input.inputtokencount * r.usd_per_input_token + l.output.outputtokencount * r.usd_per_output_token) AS est_usd FROM bedrock_invocation_logs l JOIN rate_card r ON r.model_id = l.modelid WHERE l.timestamp >= '2026-07-01' AND l.timestamp < '2026-10-01' GROUP BY 1, 2),allocated AS ( -- each feature gets its share of the real invoice SELECT u.team, u.feature, u.est_usd, i.invoice_usd * u.est_usd / SUM(u.est_usd) OVER (PARTITION BY u.team) AS allocated_usd FROM usage u JOIN invoice i ON i.team = u.team),outcomes AS ( -- only outcomes that actually happened SELECT l.requestmetadata['feature'] AS feature, COUNT(DISTINCT l.requestmetadata['outcome_id']) AS outcome_count FROM bedrock_invocation_logs l JOIN resolved_tickets t ON t.ticket_id = l.requestmetadata['outcome_id'] WHERE t.resolved_at >= DATE '2026-07-01' AND t.resolved_at < DATE '2026-10-01' GROUP BY 1)SELECT a.team, a.feature, o.outcome_count, ROUND(a.allocated_usd, 2) AS quarter_cost_usd, ROUND(a.allocated_usd / o.outcome_count, 4) AS next_quarter_price_usd, ROUND(a.est_usd / a.allocated_usd, 3) AS estimate_to_invoice_ratioFROM allocated a JOIN outcomes o ON o.feature = a.featureORDER BY quarter_cost_usd DESC;
The column names for the logs depend on your AWS Glue table definition, so adjust them to match yours [5]. Two outputs matter:
-
next_quarter_price_usdgoes into a smalloutcome_pricestable. That is the price finance will use for the next three months.
-
estimate_to_invoice_ratiois our health check. If it drifts far from 1.0, either the rate card is outdated or traffic is reaching Bedrock outside the gateway.
Step 4: Produce the monthly chargeback file
Once the price is fixed, the monthly run is almost boring, which is exactly what finance wants:
SELECT p.team, p.feature, p.outcome_type, COUNT(DISTINCT t.ticket_id) AS outcome_count, p.price_usd, ROUND(COUNT(DISTINCT t.ticket_id) * p.price_usd, 2) AS charge_usdFROM outcome_prices pJOIN bedrock_invocation_logs l ON l.requestmetadata['feature'] = p.featureJOIN resolved_tickets t ON t.ticket_id = l.requestmetadata['outcome_id']WHERE p.quarter = '2026-Q4' AND t.resolved_at >= DATE '2026-10-01' AND t.resolved_at < DATE '2026-11-01'GROUP BY p.team, p.feature, p.outcome_type, p.price_usd;
The cost of running all of this is close to zero. Athena charges $5 per TB scanned with a 10 MB minimum per query, and a CUR query scoped to one billing period typically scans well under that minimum [3].
Before you put this in production
I skipped a few things to keep the build readable. You will want them before the first invoice goes out.
Outcome definitions need an owner. A team can lower its price without saving a cent by quietly redefining its outcome, for example by counting tickets the customer closed on their own. We store the outcome definition next to the price and send any change back to showback for a quarter.
Audit a sample. Every month we pull a random sample of charged outcomes and check that a human or a system actually confirmed them.
Cap the surprise. If a feature's real cost per outcome jumps far above its price within a quarter, the platform absorbs it and alerts the owner. Teams should never be surprised by an invoice. That is the whole point of a fixed price.
Close the side doors. The model only works if the gateway is the only way to reach Bedrock. A service control policy that denies Bedrock to every other role does more for chargeback than any tagging guideline.
Keep showback running. Chargeback replaces nothing. Teams on an invoice still need the weekly token view to know why their next price will go up or down.
The question we are arguing about now
Outcome pricing has one real weakness, and we have not fully solved it: whoever defines the outcome controls the price.
So who should own the definition of an outcome? The team that pays for it, finance, or the business that consumes it?
Let me know in the comments. And if you already charge for AI by outcome, I would love to hear what your unit is.
Charge teams for tokens and they will save tokens. Charge them for outcomes and they will save money.
Sources
- SD Times – "Report: FinOps priorities are shifting left and expanding" (FinOps Foundation, State of FinOps 2026): https://sdtimes.com/softwaredev/report-finops-priorities-are-shifting-left-and-expanding/
- FinOps Foundation – FinOps Framework, Invoicing & Chargeback capability: https://www.finops.org/framework/capabilities/invoicing-chargeback/
- AWS Machine Learning Blog – Part 2: Amazon Bedrock cost attribution with Amazon Athena and CUDOS: https://aws.amazon.com/blogs/machine-learning/part-2-amazon-bedrock-cost-attribution-with-amazon-athena-and-cudos/
- Amazon Bedrock User Guide – Cost attribution FAQ: https://docs.aws.amazon.com/bedrock/latest/userguide/cost-mgmt-faq.html
- Amazon Bedrock User Guide – Per-request metadata tagging: https://docs.aws.amazon.com/bedrock/latest/userguide/cost-mgmt-request-metadata.html
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article