How to track OpenAI API costs per team, project and person
Your OpenAI invoice tells you how much you spent, not who spent it. Here is how to split every dollar of API spend between the teams and people behind it.
By RootSpend Team. Updated
Your OpenAI invoice answers one question: how much did we spend? The questions people actually ask you are different.
- Which team is behind last month's 40% jump?
- What does the support bot cost us each month?
- Is the experiment the data team started in March still running?
To answer those, you need to turn raw API usage into cost with a name on it. Here's how to do it.
1. Pull costs and usage from the Admin API
Two endpoints at the organization level matter.
| Endpoint | What it gives you |
|---|---|
GET /v1/organization/costs | Daily cost in dollars, grouped by project |
GET /v1/organization/usage/completions | Tokens and requests, grouped by model, project, API key and user |
The first has dollars but only per project. The second has detail but no prices. You need both. One tells you how much, the other tells you who.
2. Map users and projects to teams
Usage data points at a user or a key, not a team. So you build the mapping yourself.
Person to team. Each OpenAI user belongs to one team at a time. Keep start and end dates on that membership. When someone moves from Data to Growth in June, their May costs should stay with Data.
Project to owner. If a project is used by one product or one team, give the whole project to that team. This is the easiest win, so set up your projects that way where you can.
3. Split each project's cost by usage
Now combine the two. Say a project cost $300 on Tuesday, and Sara made 30% of that project's requests that day. Then $90 of Tuesday's cost is Sara's, and it rolls up to her team.
One rule keeps finance on your side: every dollar gets counted once. Add up all the teams and you should get the invoice. If you can't place some cost, don't spread it around quietly. Put it in an Unassigned bucket and go find its owner.
4. Set budgets per team
A split you only look at once a quarter won't change anything. Give each team a monthly AI budget and send an alert at 80% and when the forecast says you'll go over. Send it to the team's own Slack channel, not to a finance inbox nobody reads.
Let RootSpend do the splitting
Once RootSpend opens, connecting an OpenAI Admin key gives you cost by project, team and person in a few minutes.
Doing it yourself vs. using a tool
You can build all of this with a script, a spreadsheet and a cron job. Plenty of teams start that way. The trouble starts later. Keys rotate, people change teams, someone adds Anthropic, and the script quietly breaks.
RootSpend's OpenAI connector handles steps 1 to 4 for you, next to Anthropic and Snowflake, in one view.
Frequently asked questions
You can see usage per API key. OpenAI's Usage API groups tokens and requests by key, project, user and model. Dollars come from the Costs endpoint, which groups by project. To put a dollar figure on a key, split each project's cost by each key's share of its usage.
Yes. Cost and usage data is only available to an organization Admin API key, which an organization owner creates under Settings, then Admin keys. A regular project key can't read it.
No. RootSpend only reads costs, usage, projects and members. It never creates keys, changes limits or makes model calls.