Track AI spend from any source
Send the AI spend no connection collects, from a gateway, a self-hosted model or a vendor without a connector, to a custom provider, so it lands in the AI spend dashboard by model, token type and team.
Planned: uploads to a custom provider
Some of what a team pays for AI never reaches a cloud bill or a connection: an AI gateway or router that reports its own daily totals, the GPU cost of a model you host yourself, an AI vendor Costfluent does not connect to, or the seat fees of an AI coding tool. This guide sends that spend to a custom provider in the shape the AI spend dashboard reads, so it sits beside your connected providers by model, token type and team. Each step links to the page that owns the detail.
Before you start
- A custom provider for the source; see Upload cost to a custom provider.
- For the Public API, a token holding Sync integrations; for a CSV upload, Manage integrations. See Upload cost to a custom provider.
1. Map the source's fields
Send one line per day, model and token type, and fill these fields on each line, in the batch's camelCase or as the CSV columns of the same name:
| Field | What to send |
|---|---|
ServiceCategory | AI and Machine Learning. The AI spend dashboard and its two reports read only lines in this category. |
ServiceSubcategory | Generative AI for a language model. |
ConsumedQuantity, ConsumedUnit | The tokens, counted one by one, with the unit Tokens. A line in any other unit, such as 1K tokens, keeps the unit you sent and stays out of the "AI tokens" report. |
Tags | ai:model with the model id as its maker names it, such as gemini-2.5-flash, ai:model_provider with the maker, such as Google, and ai:token_type with input, output, cache_read or cache_write. Costfluent keeps these values exactly as sent. |
ResourceId | The API key or deployment the spend belongs to, so Resource splits it by key. |
SubAccountId, SubAccountName | The app or team the source bills, so Sub-account splits it. |
Tags | Any key of your own for a customer, a feature or a team, such as {"team":"search"}, so Tag splits it. |
A model id spelled as your connected providers' lines spell it groups with them under one ai:model. The tags Costfluent derives on its own connections are listed under Explore cost data.
2. Send a day's totals
Through the Public API, send each day's lines once the source has closed the day. Give each line a lineItemId that names the source's day, model and token type, so a day sent again corrects its lines instead of adding to them.
Code
A source that exports files instead uploads them to the same provider with the same columns.
A seat fee has no tokens: send it as one line in the category with no ConsumedQuantity. It counts in the "AI spend" report and not in "AI tokens".
3. Read it in the AI spend dashboard
Let the workspace see the custom provider's cost, as for any connection (Choose which workspaces see the cost). When a workspace first reads AI lines, from this provider or any other connection, Costfluent adds the "AI spend" dashboard with its "AI spend" and "AI tokens" reports, once per workspace. The tokens table prices each model and token type in Cost per 1M tokens. See Overview and dashboards and Usage and count.
To see who spent it, group the "AI spend" report by Tag and your own key, or by Sub-account or Resource. See Showback for teams.
Keep it true
Never send spend a connection already collects, such as a gateway's totals for calls it passed on to Amazon Bedrock in an AWS account you have connected. It then counts twice in every report, and in the tracked spend on Plans and billing. Send only what no connection reads: the self-hosted models, the vendors without a connector and the seats.
- A new model, key or team appears with its first line and needs no change to the reports.
- A day sent again corrects the lines it repeats, by the rules under Use the Public API.