How to check your OpenAI API usage and cost
Short answer: in the OpenAI API Platform, open Analytics > Usage for tokens and requests and
Analytics > Spend for what it cost. For a single request, read the usage block in the
API response.
Below: who can see the dashboards, the filters that matter, how to export a month and match it to an invoice, and what to check when usage doesn't match your own logs.
Who can see it
OpenAI's help article says you must be an organization owner or have the Usage Dashboard permission. If a filter shows a permission error, OpenAI notes that this doesn't mean no usage was recorded, only that you can't see those options.
Usage: tokens and requests
Open Analytics and select Usage. It shows the current project; for the whole organization select Organization analytics. Three things to know before reading the numbers:
- Times are in UTC. Convert before comparing with your own logs.
- Recent usage can lag. If the last few minutes or hours are missing, check again later.
- "Unavailable" isn't zero. If a capability doesn't support the filters you chose, its values may show as unavailable even though usage happened.
Useful controls:
- Filters: API source (Agents API or direct API), API key, model, user and processing tier. A chart filter can also isolate Batch usage.
- Metrics: input tokens split into cached and uncached, cache-write input tokens, output tokens, and audio tokens, depending on the capability.
- Group by: project, user or model.
- Interval: 1 day, 1 hour, or 1 minute for tokens per minute. If 1 minute is greyed out, pick a shorter period or zoom into the chart first.
Spend: what it cost
Open Analytics and select Spend for the current project, or Organization analytics > Spend for everything. You can narrow it by API source, API key, model and line item, and break it down by line item, key, user, project and model.
OpenAI points out that Usage and Spend have different filters: one that exists on Usage may not apply on Spend. Check both pages are set the same way before comparing them.
Export a month and match it to the invoice
Select the Export icon in the Analytics toolbar. There are two kinds of export:
- Activity data for usage detail, grouped by project, user, API key, model, batch or service tier.
- Cost data for billed amounts. OpenAI's article says to use this one, not Activity data, for money.
For a breakdown that adds up to the invoice, OpenAI recommends these Cost data settings:
- Group by: Line item
- Projects: All
- Start and end: the invoice's service dates, in UTC
- Time interval: 1 day
Data goes back one calendar year from today; for anything older OpenAI asks you to contact support. Daily data comes in files covering 31 days each. If an Activity export contains negative rows, OpenAI says that on its own doesn't show your invoice was credited; check the Cost data.
One request at a time
Every response reports its own usage, but the field names depend on the endpoint:
Chat Completions Responses API
Input tokens usage.prompt_tokens usage.input_tokens
Output tokens usage.completion_tokens usage.output_tokens
Total tokens usage.total_tokens usage.total_tokens
Depending on the model, the usage block can also include cached-input and reasoning tokens. Reasoning tokens aren't shown as answer text but are billed as output, which is why a short answer can cost more than it looks.
Streaming needs one extra setting on Chat Completions: send
"stream_options": {"include_usage": true} and the last chunk before [DONE] carries the
usage for the whole request. OpenAI warns that if the stream is cut off you may never get that chunk, and a
missing chunk doesn't mean the request used no tokens.
To turn a usage block into dollars, see what each OpenAI API request costs, which has a tested Python function for both endpoints.
Usage you don't recognise
OpenAI's own checklist, in short:
- Confirm the organization, the project and the reporting period, all in UTC.
- Narrow to the affected project, then by API key and model, over a shorter period.
- Compare with your logs for the same period, project and key, and make sure your logs cover every app that uses that key.
- If several apps share one key or project, the dashboard total can't tell you which one sent a request. Compare each app's own records.
- If it still doesn't add up, contact OpenAI support with the UTC period, organization and project IDs, the API key's identifier (never the secret key), screenshots or logs, and request IDs if you have them.
For what to include in that message, see how to dispute an AI API charge. To find requests you sent twice, see how to spot duplicate AI API charges.
What the dashboards don't give you
- A record per request. The dashboards show totals by day, hour or minute. They don't list each request with its ID, tokens and cost.
- Which app sent it, when apps share a key.
- Repeats. The same request sent twice counts twice and nothing marks the second one.
- Other providers. The dashboard doesn't combine organizations, let alone other companies' APIs.
Free one-page checklist: AI API bill checklist (PDF), ten checks to print or share.
A receipt for every request, kept for you
NeverPayTwice is a small app we make. Its live meter runs on your own computer between your code and the API (OpenAI, Anthropic, Google Gemini and compatible APIs) and keeps a receipt for every request: time, model, request ID, tokens and cost. It flags requests you paid for twice and keeps a refund ledger. It never blocks or changes a request, nothing is uploaded, and API keys are never stored. Mac, Windows or Linux, $9 one time.
See the receipts with sample data first, no sign-up.