Measure AI cost per request, user or customer
Read what each AI model costs per million tokens, upload a count of requests, users or customers, and chart AI spend per unit by model and by owner.
By the end of this guide, you have a saved report that charts your AI spend per request, per active user or per customer, period by period, the price per million tokens of each model beside it, and the same figure for one model or one owner. It is for the product or engineering lead who has to say whether an AI feature still pays for itself as its use grows. The path starts on the "AI spend" dashboard Costfluent creates, adds a business metric you upload, and charts the unit cost on a copy of the "AI spend" report. Each step links to the page that owns the detail.
Before you start
- A connection with cost in the service category AI and Machine Learning, such as Amazon Bedrock, Vertex AI, Anthropic, OpenAI or Cursor; see The AI spend dashboard, which names the connect pages.
- A count of the unit from your own systems: the requests your application sends to a model, the active users of an AI feature, or the customers using it.
- Edit access to the workspace, to create the business metric, upload its values and save the reports; see Access model.
- For a figure per team, app or customer: AI spend that carries its owner, as AI spend by team, app or customer sets up.
- Steps 1 to 4 work on the sample data a new organization starts with: its OpenAI, Anthropic and Amazon Bedrock rows fill the "AI spend" dashboard, and you upload counts of your own for its days in step 3. Its AI rows carry no owner tag, so step 5 reads them by model only.
1. Open the AI spend dashboard
Open Dashboards under Reporting and choose "AI spend". Costfluent adds it, with the saved reports "AI spend" and "AI tokens", when the workspace first reads AI cost. "AI spend" groups every cost line in the service category AI and Machine Learning by the tag ai:model, one model whoever sold it, then by seller; "AI tokens" counts the tokens of those lines by ai:model and ai:token_type. Cost whose model Costfluent does not recognize groups under an empty model. If the dashboard was deleted, start a new report filtered on Service category AI and Machine Learning and grouped by Tag ai:model instead. See The AI spend dashboard and Explore cost data.
2. Read what each model costs per token
In the "AI tokens" report, the table gives each model and token type its Cost per 1M tokens: the cost of its lines over their tokens, in the report's currency. That is the per-token figure, and it needs no metric. It exists only for the lines whose usage counts in Tokens; which sources state their usage that way is under Usage and count. A model missing from "AI tokens" is billed in another unit: on the "AI spend" report, set Measure to Usage and group by Usage unit to see which. A seat plan entered as a recurring cost counts in "AI spend" and never in "AI tokens".
3. Upload the business metric
Open Business metrics under Reporting and select New metric. Enter a Name, such as "AI requests", and a Unit in the singular, such as request, user or customer. To divide each owner's cost by its own requests later, enter the owner's tag key, such as team, under Label columns, then select Create metric. In Upload values, which opens next, Download a sample file saves a file with the metric's own columns; fill it in, choose it as the CSV file and select Upload. See Create a business metric and Upload values from CSV.
A period adds up the daily amounts it holds. Requests add up, so they go in every day, with the label values spelled as the owner tag spells them:
Code
A count such as active users or customers goes in once a month, on the month's first day, and is read on a monthly report. The metric stays when the sample data leaves, so delete it once your real counts are ready to upload.
4. Chart the unit cost
Open the saved report "AI spend", open More actions and choose Unit cost. Choose the metric and Cost per unit under Calculation; for a figure per thousand requests, choose Per 1,000 units under Scale. Select Apply, then Save as new, give the report a Title such as "AI cost per 1,000 requests" and select Save report, so the dashboard's "AI spend" keeps its own definition. The chart draws a "Cost per" line on its own axis on the right, and an "Average cost per" card gives the range's figure. See Chart a unit cost and Save as a new report.
For the tokens a request uses, do the same on "AI tokens" with Usage per unit under Calculation: it draws a "Usage per" line in tokens, since that report counts tokens alone.
5. Read it by model and by owner
The unit cost divides the report's whole cost, so a figure for one model or one owner is a report of its own. On the saved unit-cost report, select Add filter, choose Tag, enter ai:model as its Tag key and pick the model; for an owner, filter by the owner's tag, or by the virtual tag of AI spend by team, app or customer. Then open Unit cost again and enter the same owner under Count only these labels, so its cost divides by its own requests rather than everyone's; a model's cost divided by every request is that model's share of the cost per request. Keep each with Save as new. See Filter the cost.
Turn on Compare to previous period under Options and select Save changes: the card then states how the cost and the metric changed over the same days. Measure cost per customer or per unit says how to read a line that rises, falls or stays flat. A gap in the line is a period without a metric value, never a cost of zero; see How it behaves.
Check the result
- Business metrics shows the metric's Values: how many it holds, and its first and last day.
- The "AI tokens" report lists each model and token type with its Cost per 1M tokens.
- The saved report "AI cost per 1,000 requests" draws the "Cost per" line beside the AI spend, and its "Average cost per" card gives the range's figure.
- A report filtered to one owner draws a line of its own that differs from the whole spend's.
Keep it true
Costfluent recommends sending each day's requests from your application through the Public API, and adding each month's count of users or customers as soon as the month closes, so the newest period is never read without its metric. A new model appears under ai:model with its first day of cost and needs no change to the reports.
From your assistant
With the Costfluent MCP server connected, your assistant answers these with list_cost_reports and get_cost_report_data.
Code
Code
Related
- Unit costs and Overview and dashboards
- Usage and count
- AI cost per outcome and per task, for choosing the denominator
- AI spend by team, app or customer