How to track AI API spend

Tracking AI API spend means recording what each OpenAI and Anthropic project costs, from the usage dashboards and cost APIs through to the receipts your finance team files.

Updated 6 min read Facts checked against the official pages

On this page

Where can you see OpenAI and Anthropic API spend?

In each provider’s developer console. OpenAI has the Usage Dashboard in the API Platform, and Anthropic has the Usage and Cost pages in the Claude Console.

Not everyone at your company can open OpenAI’s Usage Dashboard. It’s limited to organization owners and members with the Usage Dashboard permission, according to the OpenAI Help Center. Data is shown in UTC, so compare it with your logs in the same time zone. The dashboard has its own project selector, which shows one project, several or the whole organization, and you can filter Responses and Chat Completions usage by user. Exports have no date-range limit, though a long range may be split into several files. Each organization is reported separately, sub-organizations included.

Anthropic’s Usage page is at platform.claude.com/usage and its Cost page is at platform.claude.com/cost. Data typically appears within 5 minutes of a request finishing, though delays can occasionally be longer, per the Anthropic Usage and Cost API docs.

How do you pull spend data with an API?

Both providers expose spend through admin APIs. That’s the route for finance reports and custom dashboards.

OpenAI’s is GET /organization/costs, which returns cost details for the organization. The OpenAI API reference lists it with the admin endpoints. Results come in daily buckets, and 1d is the only bucket width it supports.

  • Group costs by project_id, user_id, line_item, api_key_id or api_source.
  • Filter by project IDs, API key IDs or exact line item names.

Anthropic’s is the Usage and Cost Admin API (Anthropic Usage and Cost API). It has two endpoints.

  • /v1/organizations/usage_report/messages returns token usage in 1m, 1h or 1d buckets, grouped by model, workspace or service tier and filtered by API key or workspace.
  • /v1/organizations/cost_report returns costs in USD, as decimal strings in cents, and can group by workspace_id and description.

Calls need an Admin API key (sk-ant-admin01-...) or another Admin API credential. The Admin API isn’t available to individual accounts, so set up an organization in the Console first. One gap to know about: Priority Tier costs aren’t in the cost endpoint. Track Priority Tier through the usage endpoint instead.

How do you split spend by project or team?

Give each product, team or environment its own OpenAI project or Anthropic workspace, with its own API keys. Spend then groups cleanly in the dashboards and the cost APIs.

OpenAI can break usage down by project, and each project can have its own billing view and spend limit (OpenAI Help Center). OpenAI suggests separate projects for staging and production. It also recommends setting an expiration date on project API keys and rotating them (production best practices).

Anthropic’s workspaces separate projects, environments or teams while billing stays central (Anthropic workspaces). Every organization has a Default Workspace that can’t be renamed or deleted. API keys can be scoped to one workspace, and API responses carry an anthropic-workspace-id header that shows which workspace a request counted toward.

For tagging, keep one key per service and give keys names your finance team can read. Then group OpenAI costs by project_id or api_key_id, and Anthropic costs by workspace_id.

How do you set budgets and alerts?

Set a monthly spend limit on each provider, with alerts below it. An alert sends a notification. A hard limit stops traffic.

On OpenAI (spend limits, managing projects), you set a monthly limit for the organization on the Organization limits page, or for one project under its Limits. Turning on “Enforce a hard limit” makes affected requests return a 429 error. Enforcement isn’t instantaneous, so recorded spend can slightly exceed the limit.

A new OpenAI project spend limit creates an alert at 100% of the limit by default. By then you’ve reached the limit, so add alerts at lower thresholds. Organization and project owners receive project spend alerts, and you can add other recipients. OpenAI also assigns an approved monthly usage limit by usage tier, which is separate from the limits you set.

On Anthropic (rate limits, workspaces), each usage tier carries a monthly spend cap. At the cap, API usage pauses until 00:00 UTC on the first day of the next month unless you get a higher limit sooner. You can set your own lower limit in the Spend limits section of the Billing page, and set spend limits and alerts per workspace from the Workspaces page. Anthropic notes you can’t set spend limits on the Default Workspace, so keep production traffic in workspaces you can cap.

How do OpenAI and Anthropic tracking tools compare?

They cover the same ground. The differences are in how each one groups spend and how it delivers billing documents.

NeedOpenAIAnthropic
DashboardUsage Dashboard, in UTC, with a project selectorUsage and Cost pages in the Claude Console
Spend data by APIGET /organization/costs, an admin endpoint, daily bucketsUsage and Cost Admin API, with 1m, 1h or 1d usage buckets and costs in USD
Unit for splitting spendProjects, plus API key and user groupingWorkspaces, plus API key and model grouping
Budget controlsOrganization and project spend limits, optional hard limitTier spend cap, organization spend limit, workspace spend limits
AlertsSpend alerts by email, 100% alert on new project limitsWorkspace spend alerts
ExportsCSV export of activity or cost dataCost data through the Admin API
Invoices and receiptsEnterprise invoices in Billing; others use Billing historyEmailed to the billing address after each charge, also in Invoice history

Sources for each row are in the sections above.

Where do API invoices and receipts come from?

It depends on how you pay each provider.

OpenAI bills Enterprise API customers at the end of each calendar month, unless a different arrangement is agreed in writing (invoice dates). Those invoices typically arrive within 2 weeks of the cycle ending and download from the Billing section of the API Platform. Individual and team customers pay by prepaid credits or automatic card charges, and their payment history and available invoices or receipts are in Billing history. New API accounts use prepaid billing. Purchased credits expire after 1 year, and free credits are used before purchased ones (prepaid billing).

Anthropic sends organizations on a paid usage contract a monthly invoice from Stripe for that calendar month (Understanding your Claude API invoices). Organizations on prepaid billing get a receipt for each credit purchase, auto-reload purchases included. Anthropic emails each invoice to the registered billing email address after each charge, so search your inbox for the subject “Your receipt from Anthropic.” Users with the Admin or Billing role can also download invoices from Invoice history on the Billing page in the Console.

How do you reconcile API spend with your accounting?

Match each provider’s cost export to its invoices or receipts for the same organization and period. Then book the receipts against the projects or teams in your cost data.

For OpenAI, export cost data from the Usage page grouped by line item. That gives you an invoice-like breakdown in CSV, for a full month or month to date (OpenAI export guide). If totals don’t match, OpenAI says to check that you’re reconciling the same organization and the same calendar-month period, in UTC.

For Anthropic, cost reconciliation (matching internal records with Anthropic billing) is one of the uses Anthropic names for the Usage and Cost API (Anthropic Usage and Cost API).

Prepaid credits need one extra step. On prepaid billing a receipt records a credit purchase, and usage draws that balance down later. Track purchases and usage separately, or the same money gets counted twice.

For how each provider charges in the first place, read how OpenAI and Anthropic API billing works. More notes on billing are on the ernd blog.

Questions

Can I see OpenAI or Anthropic spend per project?

Yes. OpenAI breaks usage down by project and can group costs by project ID or API key. Anthropic groups usage and costs by workspace, and API keys can be scoped to one workspace.

Is there an API for AI spend data?

Yes. OpenAI has a Costs endpoint, listed with its admin endpoints. Anthropic has the Usage and Cost Admin API, which isn't available to individual accounts.

Where do Anthropic API receipts go?

Anthropic emails each invoice to your registered billing email address after each charge, with the subject "Your receipt from Anthropic." Admin and Billing roles can also download them from Invoice history in the Console.

Do OpenAI API customers get invoices?

Enterprise API customers get monthly invoices, typically within 2 weeks of the billing cycle ending. Individual and team customers pay by prepaid credits or card charges and find payment history and receipts in Billing history.

Where ernd fits

The ernd card is a credit card for US companies, with partners across the AI stack built in. Request your card .

Read next

Sources

Checked . Providers change prices and terms, so the linked page is the final word.

ernd is run by Provenance Research Inc.

The ernd card

The ernd card is a credit card for US companies, with partners across the AI stack built in.

Request your card