Track OpenAI and Anthropic API spend across teams
This guide answers the account-level question — what did each team spend on the OpenAI and Anthropic APIs this month? — from the providers’ own billing reports, not from request logs. You draw a boundary per team on the provider side (an OpenAI project, an Anthropic workspace), connect each provider to CloudQuell with a read-only admin key, and then attribute, budget, and alert on that spend beside your cloud bill. Nothing is added to your application code.
What you’ll end up with
Section titled “What you’ll end up with”A month-to-date Allocation page where each team’s OpenAI and Anthropic spend sits in its own cost center next to that team’s cloud spend; an AI Spend view that lists Anthropic spend per workspace and OpenAI spend per project; and, for each team, a budget that pages a Slack, Teams, or email channel when the team crosses its threshold.
The pages you’ll work in, all in the CloudQuell dashboard:
| Where | What it shows for teams |
|---|---|
| Dashboards → AI Spend | Spend by workspace (Anthropic) and Spend by project (OpenAI); with both connected it opens on All AI with a Spend by workspace / project card. |
| Manage → Cost centers | The team taxonomy and the allocation rules that fill it. |
| Manage → Allocation | The By cost center table — each team’s share, plus Unallocated. |
| Manage → Budgets | One budget per team, scoped to its cost center, project, or workspace. |
| Insights → Reports | A per-workspace or per-project table you can export or schedule by email. |
Before you start
Section titled “Before you start”Team attribution is only as good as the boundary the provider records on each charge. Both providers give you one, and both let you keep a team-per-boundary convention without touching code — you issue each team its own keys inside its own project or workspace.
OpenAI: one project per team
Section titled “OpenAI: one project per team”OpenAI’s Costs API reports spend per project, and CloudQuell ingests it at that grain. Give every team its own project, and issue that team’s API keys inside it.
- In the OpenAI platform, go to platform.openai.com
→ Settings → Organization → Projects and create a project per team (for example
search-team,support-assistant,data-platform). Keep production and non-production in separate projects — a load test should read as a load test, not as product spend. - Issue each team’s API keys inside its project. Keys that already exist in the wrong project are rotated by creating a new key in the right project and retiring the old one; spend follows the project the key belongs to.
- Note each project’s project ID (it starts with
proj_; open the project under Settings → Organization → Projects to see it). You’ll need the ID, not the display name, when you write allocation rules in step 4.
You also need an Organization Owner to create the read-only Admin API key in
step 3. Details, including why a sk-proj-… key won’t work, are in
Connect OpenAI.
Anthropic: one workspace per team
Section titled “Anthropic: one workspace per team”Anthropic’s cost report attributes spend per workspace, and CloudQuell ingests it at that grain, with display names, archived workspaces included.
- In the Claude Console at platform.claude.com, go to Settings → Workspaces and create a workspace per team.
- Create each team’s API keys inside its workspace. As with OpenAI, a key created in the wrong workspace is fixed by rotating it, not by moving it.
- Anthropic admin keys are an organization feature — an individual Console account can’t create one. If you don’t have an organization yet, create it first under Settings → Organization. Claude Enterprise (claude.ai) organizations can’t be connected.
You need an org admin to create the admin key in step 3. See Connect Anthropic.
Connect the providers to CloudQuell
Section titled “Connect the providers to CloudQuell”Both connectors are read-only: CloudQuell reads cost and usage reports and writes
nothing back. Creating an integration requires the CloudQuell super_admin or
admin role.
- OpenAI — as an Organization Owner, create an admin key with Read Only
permissions at platform.openai.com → Settings → Organization → Admin Keys
(it starts with
sk-admin-). In the CloudQuell admin, open Integrations, choose the OpenAI tile, select Connect, and paste the key. CloudQuell validates it live against OpenAI before saving. Full steps: Connect OpenAI. - Anthropic — as an org admin, create an admin key at Settings → Admin keys
in the Claude Console (it starts with
sk-ant-admin01-). In the CloudQuell admin, open Integrations, choose the Anthropic tile, select Connect, and paste the key. Full steps: Connect Anthropic.
Keys are stored in AWS Secrets Manager, never in the database. The first ingest starts right away and backfills up to 12 months of history; after that each provider syncs daily and re-pulls a trailing 3-day window so late billing corrections settle. Once data lands, Dashboards offers the AI Spend view — with both providers connected it opens on All AI with a per-source split, and the OpenAI and Anthropic buttons narrow it to one.
Confirm the boundary you set up is visible before going further: in AI Spend, the Spend by workspace (Anthropic) or Spend by project (OpenAI) card should list one entry per team, using the display names from the provider console.
Map spend to teams
Section titled “Map spend to teams”CloudQuell attributes spend to teams through cost centers — named buckets that can form a hierarchy — filled by allocation rules. Rules span every connected provider in one taxonomy, so a team’s OpenAI spend and its AWS spend can land in the same center. You create both on the Cost centers page under Manage.
A rule matches on one of three things: a tag (key + value carried on the cost row), a service, or an entire integration. What those mean for the two AI providers:
| Rule type | OpenAI rows | Anthropic rows |
|---|---|---|
| Tag | The cost rows carry a project_id tag, so project_id = proj_… routes one project to a cost center. |
The cost rows carry a workspace_id tag, so workspace_id = wrkspc_… routes one workspace to a cost center. |
| Service | The model name (for example gpt-5.4). Useful for a per-model bucket, not for teams. |
The model name (for example claude-sonnet-5). Same. |
| Entire integration | All OpenAI spend → one center. | All Anthropic spend → one center. |
OpenAI: one rule per team
Section titled “OpenAI: one rule per team”- On Cost centers, select New cost center for each team (or reuse the centers your cloud spend already uses — that’s the point).
- On the team’s row, select + Add rule.
- Scope — pick Single integration and choose your OpenAI integration.
This keeps the rule from matching a
project_idtag on any other provider. - Match by — Tag. The Tag key selector lists the raw keys present in
your spend; pick
project_id. Because those keys come from spend already ingested,project_idis listed after the first sync following connection — it appears once the integration’s cost data has finished syncing. In Tag value, enter the project’s ID (proj_…) from the OpenAI console. Values match exactly; display names do not match. - Leave Priority at the default and Active on. Save.
Repeat for each project. Spend from projects with no rule reports as Unallocated on the Allocation page, which is your signal that a new project appeared.
Anthropic: one rule per team
Section titled “Anthropic: one rule per team”- On Cost centers, reuse the team’s center (or select New cost center).
- On the team’s row, select + Add rule.
- Scope — pick Single integration and choose your Anthropic integration.
This keeps the rule from matching a
workspace_idtag on any other provider, and keeps the Tag key list short enough to show every Anthropic key. - Match by — Tag. Pick
workspace_idas the Tag key. The selector reads keys from spend already ingested, soworkspace_idis listed after the first sync following connection — it appears once the integration’s cost data has finished syncing. In Tag value, enter the workspace’s ID (wrkspc_…) — the Workspace filter in AI Spend → Anthropic lists each workspace by ID. Values match exactly; display names do not match. - Leave Priority at the default and Active on. Save.
Repeat for each workspace. Spend from workspaces with no rule, and all spend in the Default workspace, reports as Unallocated.
Per-workspace numbers are also available without a cost center:
- AI Spend → Anthropic — the Spend by workspace card, and the Workspace filter to isolate one team.
- Insights → Reports — with the scope picker set to your Anthropic integration, group by Account (which maps to the Anthropic workspace at that scope), then export it to CSV or schedule it by email.
- Budgets and alert rules can be scoped to specific workspaces — see below.
Reading the result
Section titled “Reading the result”Manage → Allocation shows the current calendar month to date. The By cost center table lists each team’s spend; a parent row rolls up its children. Use the scope picker at the top to narrow it to just your OpenAI or Anthropic integration when you want the AI-only split, or leave it org-wide to see each team’s AI and cloud spend together. Unallocated is the spend no rule claimed — for the AI providers, that’s usually a new project or workspace, or spend in the Default project or Default workspace.
Cost center is also a report dimension: in Reports, group by Cost Center at any scope to build a team breakdown you can save, export, or schedule.
Bedrock and Azure OpenAI
Section titled “Bedrock and Azure OpenAI”Models you call through a cloud provider are billed by that cloud, and CloudQuell follows the bill.
- Amazon Bedrock is billed by AWS, so its rows arrive through the
AWS integration and are counted once, inside
cloud spend. Since 2026-09-06 the AI Spend view also shows Bedrock beside your
direct Anthropic and OpenAI usage — by model, token type, service tier, routing,
linked account, region, and tag — as a read-only lens over those same AWS rows.
There is nothing to connect: the Bedrock button appears on its own once your
AWS bill carries Bedrock charges. The All AI total is an analytical figure
and is never added to cloud totals. To attribute Bedrock to teams, use the same
tag rules you use for the rest of AWS — a
teamtag on the Bedrock rows routes them like any other AWS line. - Azure OpenAI is billed by Microsoft. It appears in cloud spend through the Azure integration, which is available on request (limited availability) — not through the OpenAI connector, and not in the AI Spend view.
- Claude on Google Vertex AI is billed by Google Cloud and is covered by the Google Cloud integration, also available on request.
Budgets and alerts per team
Section titled “Budgets and alerts per team”Both budgets and alert rules can be scoped to the boundaries you set up above, so each team gets its own threshold. Both are paid features.
A budget per team
Section titled “A budget per team”On Manage → Budgets, select Create budget. Set the target, period, and thresholds (default 80% and 100%), then choose a Scope:
- Cost center — the team’s center from step 4. This covers everything the center’s rules route there (its OpenAI project or Anthropic workspace plus its cloud spend, if you reused the center). A budget on a parent center measures its whole subtree, using the same allocation engine as the Allocation page, so the two reconcile.
- Integration / account — pick your Anthropic integration and then one or more Workspaces, or your OpenAI integration and one or more Projects. This is an AI-only budget for one team.
- Tag —
project_id=proj_…on the OpenAI rows, orworkspace_id=wrkspc_…on the Anthropic rows, if you’d rather not create a cost center.
Add Recipients — any of your notification channels (email, Slack, or Teams) plus up to five email addresses — and threshold crossings are delivered there and recorded in the alert history. See Creating a budget.
An alert rule per team
Section titled “An alert rule per team”On Insights → Alerting, select + New Alert Rule. Under Applies to, pick the OpenAI or Anthropic integration; then under Scope, pick the team’s Projects or Workspaces (the account picker uses the provider’s own noun). The rule types that matter for a team’s AI bill:
- Spend Threshold — fires when the scope’s spend for the analysis period reaches a fixed amount.
- Trend Spike — fires when the scope’s spend rises by at least your percentage versus the previous period.
- Anomaly Scan — compares each model (the service dimension for these providers) to its own baseline, so a runaway loop on one model shows up even when the team’s total looks ordinary.
Rules are evaluated daily, weekly, or monthly, not in real time. See Alert rules.
Read it from an agent
Section titled “Read it from an agent”The MCP server exposes the same data to any connected agent. Two tools cover this page:
get_ai_spend returns direct provider spend — Anthropic by default, OpenAI with
provider: "openai" — grouped by workspace (Anthropic workspaces; OpenAI
projects), model, token_type, api_key, service_tier, cost_type,
provider, or day. Bedrock is off by default here, because an agent adds
numbers unsupervised and Bedrock is already inside cloud spend; include_bedrock: true adds it and the response then separates directTotal (provider-billed, not
in cloud totals) from crossBilledTotal (Bedrock, already in cloud totals) and
allAiTotal.
{ "provider": "openai", "group_by": "workspace", "start_date": "2026-09-01", "end_date": "2026-09-22"}returns month-to-date OpenAI spend per project. For every AI source in one answer,
including Bedrock, drop provider and set the flag:
{ "include_bedrock": true, "group_by": "provider", "start_date": "2026-09-01", "end_date": "2026-09-22"}Each row carries cost, tokens, requests, and tokenMeteredCost — the part of
cost that bought tokens, which is the right denominator for an effective $/1M
rate. Filter to one team with workspace: ["<workspace or project id>"].
get_allocation_breakdown returns the current period’s spend per cost center —
own spend, rolled-up spend, share of total, and the Unallocated bucket. Pass
integration_id for your OpenAI or Anthropic integration to get that provider’s
per-team split; leave it off for each team’s total across every provider.
In plain language, the prompts that map to these calls are “OpenAI spend by
project this month”, “Claude spend per workspace, last 30 days”, and “how is
this month’s spend allocated across cost centers?”. Cost data is ingested daily,
so ask the agent to quote the completeThrough or lastUpdated value with the
numbers. Tool details: tool reference.
Can I see OpenAI and Anthropic spend together?
Section titled “Can I see OpenAI and Anthropic spend together?”Yes. With both integrations connected, the AI Spend view opens on All AI with a per-source split, and the Overview dashboard’s Source breakdown table lists each provider’s month-to-date spend and share of the total alongside your cloud and Snowflake sources. Both providers also land in the same cost centers, budgets, and alert rules as your cloud spend.
Does this need code changes?
Section titled “Does this need code changes?”No. CloudQuell reads each provider’s own billing and usage reports through a read-only admin key. Team attribution comes from OpenAI projects and Anthropic workspaces, which you set up in the provider console; nothing is added to your application code, and no SDK or proxy is involved.
What if we also use Bedrock?
Section titled “What if we also use Bedrock?”Bedrock is billed by AWS, so it arrives through the AWS integration and is counted once, inside cloud spend. The AI Spend view shows it beside your direct OpenAI and Anthropic usage as a read-only lens, and the All AI total is never added to cloud totals. Allocate Bedrock rows to teams with tag rules like any other AWS spend. See Bedrock and Azure OpenAI.
Does the OpenAI dashboard already do this?
Section titled “Does the OpenAI dashboard already do this?”The OpenAI usage page shows OpenAI spend by project and model for one organization. This guide is for the step after that: OpenAI and Anthropic on one ledger with your cloud bill, routed to the same cost centers, with budgets and alerts per team, and readable by an agent.
Can I get cost per API key?
Section titled “Can I get cost per API key?”Not in dollars. OpenAI and Anthropic report token and request counts per API key
but no per-key cost, so CloudQuell shows key-level usage (Top API keys by
tokens in AI Spend, group_by: "api_key" in the MCP tool) without inventing a
dollar figure. Dollars attribute by model and by project or workspace.
How fresh is the data?
Section titled “How fresh is the data?”Both providers sync daily, and each sync re-pulls a trailing three-day window so late billing corrections are absorbed. Up to 12 months of history is backfilled when you connect. It is not real-time — for a runaway loop in the last hour, the provider’s own hard spend limit is the backstop.
Limits
Section titled “Limits”- No request tracing. CloudQuell reads billing and usage reports, not requests. Cost per prompt, per feature, per end customer, or per trace is finer than either provider’s billing API reaches; an application-level observability tool that instruments the call site does that job.
- Allocation rules match project and workspace IDs, not names. The tag value
is the OpenAI
proj_…or Anthropicwrkspc_…ID; renaming a project or workspace in the provider console doesn’t affect the rule. - The Default project and Default workspace can’t be attributed to a team by rule, budget, or alert scope — their spend carries no ID.
- No per-key dollars. Both providers expose token and request counts per API key only.
- Azure OpenAI and Vertex AI arrive only through the Azure and Google Cloud connectors, which are available on request (limited availability), and they appear in cloud spend rather than the AI Spend view.
- Seat subscriptions are out of scope — ChatGPT Plus, Team, and Enterprise and Claude Pro, Max, Team, and Enterprise are not billed per API call and don’t appear in either provider’s cost report.
- Not real-time. Data syncs daily with a trailing 3-day re-pull, and alert rules run daily, weekly, or monthly.
get_ai_spendhas no cost-center grouping. For the per-team roll-up from an agent, useget_allocation_breakdown; for the per-project or per-workspace split, usegroup_by: "workspace".
Related
Section titled “Related”- Connect OpenAI
- Connect Anthropic
- Cost centers and allocation rules
- Budgets overview and alert rules
- The dashboard tour — where the AI Spend view fits
- MCP tool reference