Track OpenAI and Anthropic API spend
Connect both providers, see spend by provider, project and workspace, put a budget and an alert on it, and schedule the report.
API spend on OpenAI and Anthropic lands on a card or an invoice, not in a cloud bill, and it moves with every new model a team tries. This guide brings both into the workspace, breaks the spend down by provider, project and workspace, puts a budget and an alert on it, and delivers a report. Each step links to the page that owns the detail.
Before you start
- An Admin key for each OpenAI organization and each Anthropic organization you want to see; see Connect OpenAI and Connect Anthropic.
- An organization role in Costfluent that can add connections and notification channels; see Access model.
1. Connect both providers
Connect each OpenAI organization and each Anthropic organization as its own connection. Both import cost by day, with the calendar month as the billing period. Anthropic's Admin API key cannot be scoped down, so create one for Costfluent alone and revoke it without touching anything else. See Connect OpenAI and Connect Anthropic.
2. Break the spend down
In the explorer, filter Provider to OpenAI and Anthropic, and group by Provider, then Sub-account: for OpenAI the sub-account is the project, for Anthropic the workspace. Group by Service to see Anthropic's cost per model; OpenAI reports one service and keeps the model in the line item. See Explore cost data, and the reporting dimensions of OpenAI and Anthropic.
3. Save the report and budget it
Save that report, then create a monthly budget and choose the report under Measures: a budget on a report counts exactly what the report shows, so the two always agree. Pick the channel under Send to. See Save and manage reports and Budgets.
4. Alert on a jump
A budget speaks up at 50, 80 and 100 percent of the month. For a jump between two days, create a cost alert through the Public API with the two connections as providerIds, percentageIncrease against previousWeek as the threshold, and the channel as appIds; it then appears under Configured alerts beside the budget's thresholds. See Alerts.
5. Deliver it
Schedule the saved report weekly to the people who pay for the keys. See Share and schedule reports.
Keep it true
- A new project or workspace appears under Sub-account with its first day of cost and needs no change to the report.
- When a key is rotated, update the connection's credentials rather than adding a connection, so the history stays on one identity; the provider pages say when a new key is a new identity instead.