Skip to content

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 an admin key, and then attribute, budget, and alert on that spend beside your cloud bill. The OpenAI key is read-only; Anthropic admin keys can’t be permission-scoped, so CloudQuell uses yours only for read-only calls: the usage and cost reports, plus workspace and API-key names to label them. Nothing is added to your application code.

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.

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’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.

  1. 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.
  2. 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.
  3. 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’s cost report attributes spend per workspace, and CloudQuell ingests it at that grain, with display names, archived workspaces included.

  1. In the Claude Console at platform.claude.com, go to Settings → Workspaces and create a workspace per team.
  2. 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.
  3. 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.

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.

  1. 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.
  2. 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.

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.
Tag — by key or person api_key_id = the key’s id, or user_email = the key owner’s email. api_key_id = the key’s id, or user_email = the person Anthropic attributes the request to.
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.
  1. On Cost centers, select New cost center for each team (or reuse the centers your cloud spend already uses — that’s the point).
  2. On the team’s row, select + Add rule.
  3. Scope — pick Single integration and choose your OpenAI integration. This keeps the rule from matching a project_id tag on any other provider.
  4. 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_id is 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.
  5. 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.

  1. On Cost centers, reuse the team’s center (or select New cost center).
  2. On the team’s row, select + Add rule.
  3. Scope — pick Single integration and choose your Anthropic integration. This keeps the rule from matching a workspace_id tag on any other provider, and keeps the Tag key list short enough to show every Anthropic key.
  4. Match by — Tag. Pick workspace_id as the Tag key. The selector reads keys from spend already ingested, so workspace_id is 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.
  5. Leave Priority at the default and Active on. Save.

Repeat for each workspace. Spend from workspaces with no rule 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.

When teams share a project or workspace, allocate by key or by person instead. On Cost centers, the AI API keys card lists each key’s spend for the last 30 days, its owner, and the cost center it lands in today — Unallocated if no rule claims it. Select Assign to route it:

  • Every key owned by a person — one user_email rule covers all of their keys, including ones they create later. Prefer this.
  • This key — one api_key_id rule for a shared or service key.

Assignments are ordinary tag rules: they show under the cost center and in the resolution order, and you can also create them by hand — when the tag key is api_key_id, user_email, workspace_id or project_id, the rule form suggests values from the last 90 days of AI spend. Spend tied to no key (older history, non-token charges) can’t be matched this way and stays with your workspace or project rules.

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.

Models you call through a cloud provider are billed by that cloud, and CloudQuell follows the bill. Three cloud-billed sources appear in the AI Spend view beside your direct Anthropic and OpenAI usage:

  • Amazon Bedrock, from the AWS integration — by model, token type, service tier, routing, linked account, region, and tag.
  • Azure AI Foundry, from the Azure integration — Azure OpenAI plus the other models Microsoft sells through Foundry (DeepSeek, Grok, Llama, Mistral, Phi, Microsoft MAI) and Claude bought through Azure Marketplace. Break it down by model, model developer, token type, deployment type, service tier, subscription, region, and day. Provisioned throughput (PTU) and Marketplace Claude show as their own buckets, not per model.
  • Gemini / Vertex AI, from the Google Cloud integration — Gemini, Claude and other Model Garden models, Imagen, Veo, embeddings, grounding, and provisioned throughput, from Vertex AI and the Gemini API. Same breakdowns, by project and serving scope. Gemini 1.x / PaLM-era usage is billed by characters, so it shows dollars but no token counts.

Each is counted once, inside cloud spend; the AI Spend view is a read-only lens over those same cloud rows. There is nothing to connect: each button appears on its own once your bill carries that spend. The All AI total is an analytical figure and is never added to cloud totals. Non-model services — Azure Speech, Translator, and Vision, or Vertex AI training, notebooks, and Vector Search — stay in cloud spend only. To attribute cloud-billed AI to teams, use the same allocation and tag rules you use for the rest of that cloud — a team tag on the Bedrock rows, for example, routes them like any other AWS line.

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.

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, or workspace_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.

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.

The MCP server exposes the same data to any connected agent. Two tools cover this page:

get_ai_spend returns direct provider spend — Anthropic and OpenAI together by default, or one of them with provider: "anthropic" or "openai" — grouped by workspace (Anthropic workspaces; OpenAI projects), model, token_type, api_key, service_tier, cost_type, provider, or day. Cloud-billed sources are off by default here, because an agent adds numbers unsupervised and they are already inside cloud spend. Ask for one with provider: "bedrock", "azure_openai" (Azure AI Foundry), or "vertex" (Gemini / Vertex AI) — which adds group_by values account, region, routing, and model_developer (Azure and Vertex). include_cross_billed: true adds all three to the direct providers (include_bedrock: true adds Bedrock only). The response then separates directTotal (provider-billed, not in cloud totals) from crossBilledTotal (cloud-billed, already in cloud totals) and allAiTotal; never add any of them to a cloud figure.

{
"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 the cloud-billed ones, drop provider and set the flag:

{
"include_cross_billed": 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.

No. CloudQuell reads each provider’s own billing and usage reports through an admin key: a read-only one for OpenAI, and for Anthropic (whose admin keys can’t be permission-scoped) a key CloudQuell uses only for read-only calls to the usage and cost reports and to workspace and key names. 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, Azure AI Foundry, or Vertex AI?

Section titled “What if we also use Bedrock, Azure AI Foundry, or Vertex AI?”

Models bought through a cloud are billed by that cloud, so Bedrock arrives through the AWS integration, Azure AI Foundry (including Azure OpenAI) through the Azure integration, and Gemini / Vertex AI through the Google Cloud integration — each counted once, inside cloud spend. The AI Spend view shows them beside your direct OpenAI and Anthropic usage with nothing extra to connect, and the All AI total is never added to cloud totals. Allocate them to teams with the same allocation and tag rules as the rest of that cloud. See Bedrock, Azure AI Foundry, and Vertex AI.

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.

Yes. Spend by API key in AI Spend shows dollars and tokens per key, named from each provider console, and Spend by user shows them per key owner (group_by: "api_key" and "user" in the MCP tool). Spend a provider ties to no key — older history and non-token charges — shows as Unattributed, so the rows always add up to the total.

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.

  • 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 Anthropic wrkspc_… ID; renaming a project or workspace in the provider console doesn’t affect the rule.
  • Per-key dollars start where the providers report them: OpenAI from December 2025, Anthropic from January 2026. Older spend, and charges tied to no key, show as Unattributed.
  • Azure AI Foundry and Vertex AI arrive only through the Azure and Google Cloud connectors. They show in the AI Spend view, but they’re counted in cloud spend, and the Scope picker is disabled while one is selected — use the Subscription or Project filter instead.
  • 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_spend has no cost-center grouping. For the per-team roll-up from an agent, use get_allocation_breakdown; for the per-project or per-workspace split, use group_by: "workspace".