Guide · Updated October 8, 2026
How to track OpenAI and Anthropic API usage and costs
OpenAI's Usage page and the Anthropic Console's Usage and Cost pages show your API usage and costs, and both providers have a cost API. Give each feature its own API key, set limits before the first surprise bill, and take 15 minutes a week to compare the last 7 days with the 7 before (our suggestion).
On this page
Check the OpenAI Usage page and Anthropic Console
Start with OpenAI's Usage page and filter by project. You'll need to be an organization owner or have the Usage Dashboard permission, and times are in UTC (OpenAI help).
Then open the Anthropic Console. Its Usage page splits by model, date and API key, and its Cost page by model, with web search and code execution counted. Either one filters by workspace and exports to CSV, but neither shows cost by user (Anthropic support).
The dashboards won't warn you or say which feature caused a jump, so use separate keys and limits. Our AWS cost monitoring guide has the same routine for AWS.
Split spend by project and API key
Give each feature its own named API key, and each environment its own project at OpenAI or workspace at Anthropic. Neither provider's reports group by a tag of your own, so the key is how you see which feature spent the money (OpenAI Costs, OpenAI Usage, Anthropic guide, Anthropic reference).
| Report | OpenAI | Anthropic |
|---|---|---|
| Usage report | Project, user, API key, model, batch, service tier | API key, workspace, user, model, service tier, context window |
| Cost report | Project, user, line item, API key | Workspace or description. No API key |
Know who owns every key. OpenAI advises one key per person, an expiry on project keys, and no keys in browsers, mobile apps or repositories (OpenAI help).
Log cost per request
Neither provider's reports know your customers, so log cost yourself. Every response carries token counts in a usage object, like usage.input_tokens_details.cached_tokens at OpenAI (OpenAI). Anthropic's input_tokens leaves out cached tokens, so add the cache fields for total input (Anthropic). Multiply each kind by its price (OpenAI pricing, Anthropic pricing) and save the total with the feature and customer ID.
Our example, with made-up prices: 12,000 input tokens at $2 per million plus 800 output tokens at $10 per million is $0.032 a request. We'd skip a logging proxy until several services call the providers.
Set limits and alerts before you need them
An alert tells you, and a hard limit stops the spend. OpenAI keeps them as separate settings: an alert sends a notification while traffic continues. A hard limit makes requests fail with HTTP 429 and the code organization_spend_limit_exceeded, or project_spend_limit_exceeded for a project. Requests keep failing until the next monthly cycle unless you raise the limit, and spend can run slightly past it (OpenAI spend limits).
Anthropic has two kinds of limit, and they fail differently. You set your own under Settings, Billing, Spend limits (Anthropic rate limits).
| Limit | Amount | What you get at the limit |
|---|---|---|
| Limit you set | Below the tier cap | HTTP 400, invalid_request_error |
| Tier cap | Start $500, Build $1,000, Scale $200,000 a month. Custom has none (rate limits) | HTTP 429, enforced_spend_limit_reached, no retry-after |
The tier cap is the one to watch. Once you hit it, requests keep failing, SDK retries included, until 00:00 UTC on the 1st unless you move up a tier (rate limits). Workspace limits can alert too: pick the workspace under Settings, Workspaces and open Spend limits. They can't go above the organization's limit, and the Default Workspace can't have one (workspaces).
We'd set alerts at 50%, 80% and 100% of your expected monthly spend. Put hard limits on development and staging first and production last, since in production a hard limit is a broken feature.
Pull the numbers with the usage and cost APIs
Most teams don't need this on day one. Once a few people share keys, or two dashboards get tedious, pull the numbers from the API. Each provider has a cost report in dollars and a usage report in tokens, and both need an admin key.
OpenAI admin keys come from the Admin API keys page in organization settings and only work on administration endpoints (OpenAI admin APIs). Anthropic admin keys start with sk-ant-admin01-. An organization admin creates them under Settings, Admin keys, and each has full access to every endpoint that accepts one (Anthropic docs). Keep admin keys in a secrets manager, and make a separate one just for reporting.
Two examples, both for the week of Monday, September 28, 2026 (UTC): OpenAI cost by line item and Anthropic cost by workspace.
curl -G https://api.openai.com/v1/organization/costs \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-d start_time=1790553600 \
-d end_time=1791158400 \
-d group_by=line_itemBASE=https://api.anthropic.com/v1/organizations
curl -G $BASE/cost_report \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY" \
-d starting_at=2026-09-28T00:00:00Z \
-d ending_at=2026-10-05T00:00:00Z \
-d "group_by[]=workspace_id"OpenAI takes start_time in Unix seconds and repeats group_by to add groupings. Anthropic takes ISO dates and group_by[]. Token counts are in the usage reports (usage/completions at OpenAI, usage_report/messages at Anthropic). Check parameter names against the references first.
Anthropic's cost report leaves out Priority Tier, so read that from the usage report grouped by service tier. A null workspace ID means the Default Workspace (Anthropic).
The 15-minute weekly review
Pick a day and have whoever holds the admin key own it. Don't trust the most recent day's numbers yet, since they're still coming in. Our suggested split of the 15 minutes:
- 3 minutes: cost for the last 7 days against the 7 before, by project or workspace.
- 3 minutes: for whatever moved, group usage by model, then by API key.
- 2 minutes: check the cache. Compare cached input tokens with total input (
input_cached_tokensin OpenAI's usage report,cache_read_input_tokensin Anthropic's). - 4 minutes: do the limits and alerts still fit this month's spend? Search your logs for spend-limit errors and retry counts.
- 3 minutes: write one line per change with the amount, the likely cause and your call (expected, investigate or fix). Every fix gets an owner and a date.
Take the fix lines to your weekly operations review.
Once a month, reconcile against the invoice. In OpenAI's export, pick Cost data, group by line item, set a 1-day interval and cover the whole calendar month in UTC (OpenAI help). For Anthropic, add up the month's cost report.
Where the money goes to waste
We'd go through these once a month, or sooner when the weekly review points at a row.
| Waste | How to spot it | Usual fix |
|---|---|---|
| Retries and loops | One key spikes, request counts jump | Cap retries, and never retry a spend-limit error |
| Long contexts, no caching | Large input per request, cached tokens at zero | Trim history, put fixed content first |
| Big model, small calls | One expensive model, short requests | Test a smaller tier on your own examples |
| Reasoning tokens | reasoning_tokens high, replies short | Lower the effort, set an output cap |
| Work that can wait | Nightly jobs on the normal API | Use the Batch API |
Prices and defaults behind the table
- Batch is 50% off at both providers, and results can take up to 24 hours (OpenAI, Anthropic).
- Anthropic cache reads cost 0.1x the base input price on most models, and a 5-minute write costs 1.25x (prompt caching), so caching pays for itself after one read (pricing). A prompt under the model's minimum length isn't cached, and nothing tells you.
- OpenAI caches by default and discounts cached input by up to 95% (OpenAI).
- Reasoning tokens are billed as output tokens, and
max_output_tokenscaps reasoning and the visible reply together (OpenAI).
What Liz reads

Liz handles costs on Grant's team. On Studio and Enterprise, she reads your OpenAI and Anthropic spend from an admin key the owner adds to a project (Costs in the docs). She sees costs and token usage by model, project or workspace, and API key ID (privacy policy). Ask Grant "How much are we spending on OpenAI and Anthropic?" from the dashboard, Slack or MCP. On Free and Pro she doesn't read this spend, so you'd run the weekly review by hand.
- Every dollar figure comes from your provider. Liz only adds them up and compares them.
- If she spots an idle key or a big model answering short requests, she flags it for you to check. She won't call it waste on her own.
- If the admin key is revoked or refused, the report says its figures are missing and never shows them as zero spend.
Liz is one of Since's AI agents, and her part here is reading and reporting. She won't rotate a key, change a limit or stop traffic, and nothing merges or deploys from a cost check, so keep your own spend limits on.
Since uses AI too, and every plan includes an allowance, counted in credits (pricing). On a paid plan, if you switch on your own Anthropic or OpenAI key, that work goes on the provider's bill and shows up in the spend this guide tracks. More in our AI credits guide and BYOK vs hosted AI guide.
Questions
How do I check my OpenAI API usage and costs?
Open the Usage page in OpenAI's platform dashboard and use Export for usage or cost data (OpenAI help).
How do I check my Anthropic API usage and costs?
Open the Usage and Cost pages in the Anthropic Console, filter by workspace and export to CSV (Anthropic support). For repeat pulls, use the Usage and Cost Admin API (guide).
Do OpenAI and Anthropic have usage and cost APIs?
Yes, both, with admin credentials such as an admin key. OpenAI has a Costs API and a Usage API. Anthropic has a cost report and a usage report (guide), which individual accounts and workspace keys can't use.
How do I set a spending limit on the OpenAI API?
Under Organization limits, open Spend, choose Edit spend limit and enforce a hard limit. For one project, use its Limits settings. Requests then fail with HTTP 429 (OpenAI spend limits).
What happens when I reach my Anthropic spend limit?
A limit you set returns HTTP 400. The tier cap returns HTTP 429, and retries fail until 00:00 UTC on the 1st of next month unless you move up a tier (Anthropic rate limits).
Can I track LLM API cost by feature or customer?
Not directly. Neither provider's reports group by a tag of your own. Use one API key per feature and group by key, and log each response's token counts next to the customer ID.
How do I know if prompt caching is working?
Check the usage in each response. OpenAI reports cached_tokens (OpenAI). Anthropic reports cache_read_input_tokens and cache_creation_input_tokens, and if both are 0, the prompt wasn't cached (Anthropic).
Why doesn't my token usage match my invoice?
Tokens and dollars come from different reports, so only take dollars from the cost report. Anthropic's cost report leaves out Priority Tier (Anthropic). OpenAI's dashboard and exports use UTC (OpenAI help), so reconcile whole calendar months in UTC (export guide).
Related guides
- Bring your own key (BYOK) vs hosted AI: which to chooseBring your own key (BYOK) means an AI tool runs on your own OpenAI or Anthropic LLM API key. When it beats hosted AI, and how to set it up safely.
- AI credits: what one costs and how to budgetAI credits are each vendor's own unit for AI use. Learn how credits differ from tokens, turn one into dollars and budget a month before you buy.