How to track AI API spend

Tracking AI API spend means recording what each OpenAI and Anthropic project costs, from usage dashboards and cost APIs 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?

Each provider has a usage dashboard in its developer console. OpenAI’s is the Usage Dashboard in the API Platform, and Anthropic’s are the Usage and Cost pages in the Claude Console.

OpenAI Usage Dashboard (OpenAI Help Center):

  • Only organization owners and members with the Usage Dashboard permission can open it.
  • Data is shown in UTC, so compare it with your logs in the same time zone.
  • Its own project selector shows one project, several projects or the whole organization.
  • You can filter Responses and Chat Completions usage by user.
  • Exports have no date-range limit. Long ranges may be split into several files.
  • Each organization is reported separately, including sub-organizations.

Anthropic Console (Anthropic Usage and Cost API):

  • The Usage page is at platform.claude.com/usage and the Cost page is at platform.claude.com/cost.
  • Usage and cost data typically appears within 5 minutes of a request finishing, though delays can occasionally be longer.

How do you pull spend data with an API?

Both providers expose spend through admin APIs, which suit finance reports and custom dashboards.

OpenAI Costs endpoint. GET /organization/costs returns cost details for the organization. The OpenAI API reference lists it with the admin endpoints.

  • Results come in daily buckets. 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 Usage and Cost Admin API (Anthropic Usage and Cost API):

  • /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. Set up an organization in the Console first.
  • Priority Tier costs aren’t in the cost endpoint. Track Priority Tier through the usage endpoint.

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 dashboards and cost APIs.

OpenAI projects. Usage can be broken 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, and recommends setting an expiration date on project API keys and rotating them (production best practices).

Anthropic workspaces. 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.
  • API responses carry an anthropic-workspace-id header that shows which workspace a request counted toward.

To tag spend, keep one key per service and give keys names your finance team can read. You can 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 with alerts below it on each provider. An alert sends a notification, and a hard limit stops traffic.

OpenAI (spend limits, managing projects):

  • Set a monthly limit for the organization on the Organization limits page, or for one project under its Limits.
  • “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 project spend limit creates an alert at 100% of the limit by default. Add alerts at other 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.

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.
  • Set your own lower limit in the Spend limits section of the Billing page.
  • Set spend limits and alerts per workspace from the Workspaces page. Anthropic notes you can’t set spend limits on the Default Workspace.

How do OpenAI and Anthropic tracking tools compare?

Both providers cover dashboards, cost APIs, spend limits and receipts. They differ in how they group spend and how they deliver 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?

The documents you get depend on how you pay each provider.

OpenAI (invoice dates, prepaid billing):

  • Enterprise API customers are billed at the end of each calendar month, unless a different arrangement is agreed in writing. 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. 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.

Anthropic (Understanding your Claude API invoices):

  • Organizations on a paid usage contract get a monthly invoice from Stripe for that calendar month.
  • Organizations on prepaid billing get a receipt for each credit purchase, including auto-reload purchases.
  • Anthropic emails each invoice to the registered billing email address after each charge. Search for the subject “Your receipt from Anthropic.”
  • Users with the Admin or Billing role can 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.

  • OpenAI. Export cost data from the Usage page grouped by line item for 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.
  • Anthropic. Anthropic names cost reconciliation, matching internal records with Anthropic billing, as a use of the Usage and Cost API (Anthropic Usage and Cost API).
  • Prepaid credits. On prepaid billing, a receipt records a credit purchase, and usage draws that balance down later. Track purchases and usage separately so the two don’t get counted twice.

For how each provider charges, 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 charge 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 charge card for US companies, with partners across the AI stack built in.

Request your card