OpenAI API Usage API and Dashboard Guide

Last reviewed: June 25, 2026

Quick Answer

OpenAI provides two ways to view usage: the Usage Dashboard in the browser and the organization Usage and Costs APIs for programmatic access. Both use UTC. The capability-specific Usage endpoints (completions, embeddings, images, and so on) return token and request counts. The Costs endpoint returns spend amounts for financial reconciliation. Admin API keys — not ordinary application keys — are required for all organization administration endpoints. Token usage alone does not equal the final billed amount; use the Costs endpoint for spend totals.

NeedUse
View usage in browser Usage Dashboard
Analyze tokens and requests programmatically Organization Usage endpoints
Retrieve spend amounts Organization Costs endpoint
Reconcile monthly bill Cost CSV export
Analyze model or project activity Activity CSV or grouped Usage query
Check prepaid balance Billing / credit grants page

Usage vs Billing vs Credits

OpenAI separates usage monitoring, billing administration and credit management into three distinct areas:

  • Usage — tokens, requests, images, audio and other consumption quantities; tracked via the Usage Dashboard and Usage APIs
  • Billing — payment arrangements, invoices, Tax ID, project budgets and payment methods; see the OpenAI API Billing guide
  • Credits — prepaid credit balance, purchases, auto recharge and expiry; see the OpenAI API Credits guide

Who Can View Usage

The Usage Dashboard and organization Usage APIs are part of the Administration API. Only Organization Owners or users explicitly granted Usage Dashboard permission can access them.

If the dashboard is not visible, check:

  • The correct organization is selected in the top-right selector
  • The account role is Organization Owner or has Usage Dashboard permission
  • The project filter within the Usage page itself is not restricting the view
  • The browser is logged into the correct account

Ordinary project members and API key holders do not automatically have access. Use the AI API Cost Benchmark to turn usage assumptions into an estimated monthly budget.

Dashboard Time Zone and Filters

The Usage Dashboard uses UTC for all time ranges. Always confirm the UTC range when reconciling against local logs, invoices or support requests.

  • The date-range selector applies to the currently selected project and filter set
  • The project selector within the Usage page is independent of the top-right organization selector — clearing it shows organization-level aggregates
  • The dashboard does not automatically consolidate usage across multiple organizations

Activity Data vs Cost Data

The Usage Dashboard provides two distinct export types:

  • Activity export — granular usage data filterable by project, user, API key, model, batch and service tier; suited for investigating usage patterns and debugging cost anomalies
  • Cost export — spend data grouped by line item; the preferred source for monthly spend reporting, invoice reconciliation and financial totals

For financial purposes, use the Costs endpoint or Cost tab. Token counts alone do not equal the final billed amount.

OpenAI Organization Usage and Costs Endpoints

OpenAI provides a set of organization-level administration endpoints for programmatic usage and cost retrieval. All require an Admin API key. The following endpoints are selected examples; additional endpoints may exist — check the current OpenAI API reference for the full list.

EndpointReturns
GET /v1/organization/usage/completions Text/completion model usage (tokens, requests)
GET /v1/organization/usage/embeddings Embedding usage (tokens, requests)
GET /v1/organization/usage/images Image usage counts with optional grouping by model, size and source
GET /v1/organization/usage/audio_speeches Audio speech usage (characters, requests)
GET /v1/organization/usage/audio_transcriptions Audio transcription usage (seconds, requests)
GET /v1/organization/usage/moderations Moderation usage (requests)
GET /v1/organization/usage/vector_stores Vector store usage (bytes, requests)
GET /v1/organization/usage/file_search_calls File search call counts
GET /v1/organization/usage/web_search_calls Web search call counts
GET /v1/organization/usage/code_interpreter_sessions Code interpreter session counts
GET /v1/organization/costs Spend amounts (USD) grouped by line item

Check the current OpenAI API reference to confirm which endpoints are available, as the surface may expand over time.

Admin API Key and Authorization

Organization Usage and Costs endpoints require an Admin API key — distinct from application API keys used for model inference.

  • Admin API keys cannot be used for model inference endpoints
  • Application API keys do not grant access to administration endpoints
  • Admin keys must be stored in environment variables, never in source code, browser code or support tickets
  • Never paste admin keys into screenshots shared with support

cURL example

curl "https://api.openai.com/v1/organization/costs?start_time=<unix-seconds>&end_time=<unix-seconds>" \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

JavaScript example (Node.js / backend only)

const https = require('https');

async function getOrgCosts(startTime, endTime) {
  const adminKey = process.env.OPENAI_ADMIN_KEY;
  if (!adminKey) throw new Error('OPENAI_ADMIN_KEY environment variable is not set');

  const params = new URLSearchParams({ start_time: startTime, end_time: endTime });
  const options = {
    hostname: 'api.openai.com',
    path: `/v1/organization/costs?${params}`,
    method: 'GET',
    headers: { 'Authorization': `Bearer ${adminKey}` }
  };

  return new Promise((resolve, reject) => {
    const req = https.request(options, (res) => {
      let data = '';
      res.on('data', (chunk) => { data += chunk; });
      res.on('end', () => {
        if (res.statusCode >= 400) {
          console.error('API error:', res.statusCode, data);
          // Inspect error body for error.type and error.code
          return reject(new Error(`HTTP ${res.statusCode}: ${data}`));
        }
        resolve(JSON.parse(data));
      });
    });
    req.on('error', reject);
    req.end();
  });
}

This code runs in a Node.js backend environment. Do not place Admin API keys in browser-facing code.

Parameters

ParameterDescription
start_time Required. Inclusive Unix timestamp (seconds) marking the beginning of the reporting range.
end_time Exclusive Unix timestamp (seconds). Defaults to the current time.
group_by Supported by capability endpoints (completions, etc.). Values vary by endpoint. Common values include model, project_id, user_id and api_key_id; the completions endpoint may also support batch and service_tier. Supported values differ per endpoint — check the current OpenAI API reference, especially when sending multiple group_by values.
bucket_width Time-bucket granularity for the completions endpoint. Supported values include 1m (one minute), 1h (one hour), 1d (one day).
page Cursor for the next page. Read the next_page value from the response body, then pass it as the page query parameter in the next request.

Pagination

// Fetch all pages of usage data
let page = null;
let allData = [];

do {
  const params = new URLSearchParams({
    start_time: String(startTime),
    end_time: String(endTime)
  });
  if (page) {
    params.set('page', page);
  }

  const response = await getOrgUsage(params);
  allData = allData.concat(response.data ?? []);
  page = response.next_page ?? null;
} while (page);

Usage API vs Costs API

Usage endpointsCosts endpoint
Returns Usage quantities (tokens, images, seconds) Monetary amounts (USD)
Use for Token analysis, debugging, anomaly detection Financial reconciliation, invoice matching
Financial total Do not use for billing totals Preferred for billing totals

Exporting Cost Data from the Dashboard

Steps to download a Cost CSV from the Usage Dashboard:

  1. Navigate to the Usage Dashboard in the API Platform
  2. Select the target organization and project (or leave blank for organization-level data)
  3. Choose the calendar-month or custom UTC date range
  4. Switch to the Cost tab
  5. Download the CSV and note the export timestamp

The Cost export provides aggregated spend grouped by line item. For partial-month data, export month-to-date and compare carefully with the full-month export when it becomes available.

Troubleshooting

401 or 403 on administration endpoints

Verify the key is an Admin API key, not a project API key. Check that the Authorization: Bearer header is correctly formatted. Admin keys are distinct from keys used for model inference.

Empty results or zero totals

Confirm the UTC date range covers the period with actual usage. Verify the correct organization is selected. Check whether the project filter within the Usage page is narrowing the results. Ensure the Admin key has access to the target organization.

Data mismatch between local logs and API response

Common causes: incomplete pagination (missing next_page results), UTC boundary mismatch at month ends, project filter set differently in dashboard vs API, automatic retries adding usage not in application logs, or cached-token pricing differences.

Why Usage Does Not Equal Final Cost

Token usage and billed cost are related but not identical. Common discrepancies:

  • Cached tokens — context caching results in lower effective cost than raw token counts suggest
  • Reasoning tokens — some models bill reasoning tokens as output tokens even if not visible in response text
  • Batch vs standard pricing — batch-mode usage has different rates
  • UTC boundary mismatch — local logs and the dashboard may use different UTC ranges
  • Incomplete paginationnext_page tokens not followed result in partial totals
  • Automatic retries — retries may generate additional usage not in application logs

Usage Reconciliation Checklist

  • Confirm correct organization and Usage Dashboard permission
  • Clear or select the intended project filter within the Usage page
  • Normalize time range to UTC — confirm both dashboard and API use the same UTC boundaries
  • Use inclusive start_time and exclusive end_time for API queries
  • Export Activity data for usage investigation
  • Export Cost data for spend reconciliation
  • Follow all next_page cursors and pass them as the page query parameter
  • Use Costs endpoint for financial totals, not token estimates
  • Compare with the API Billing Mismatch guide when totals still differ

Security Checklist

  • Store Admin API keys in environment variables, never in source code
  • Never paste API keys into browser tools, chat interfaces or support tickets
  • Redact keys from screenshots before sharing evidence with support
  • Rotate Admin API keys regularly and immediately upon suspected exposure
  • Apply least privilege — grant Usage Dashboard access only to users who need it
  • Save request_id, timestamp, model, project, input/output usage and retry count for every request

Official Sources Reviewed

Information on this page is based on OpenAI official documentation reviewed as of June 25, 2026. OpenAI API usage features may change; verify current behavior in the API Platform and API reference.

  • OpenAI Help: Understanding your API usage
  • OpenAI Help: How do I export monthly usage details from the API Usage Dashboard
  • OpenAI API Reference: Organization Usage — Costs endpoint
  • OpenAI API Reference: Administration overview
  • OpenAI API Docs: Pricing

Related Guides

AI Summary

The OpenAI Usage Dashboard and organization Usage APIs provide usage quantities (tokens, requests, images, seconds) scoped to a single organization and UTC time range. Only Organization Owners or explicitly authorized users can access them. Admin API keys — distinct from application keys — are required for all organization administration endpoints. Activity exports support granular breakdowns by project, user, API key, model and service tier. Cost exports and the Costs endpoint are the preferred source for financial reconciliation. Token usage alone does not equal final billed cost; use the Costs endpoint for spend totals. Apply inclusive start_time and exclusive end_time, follow all next_page tokens, and always normalize to UTC when comparing records. Use the 2026 AI API Cost Benchmark to estimate costs before scaling. AICostPlanner is an independent educational site and is not affiliated with OpenAI.

Frequently Asked Questions

How do I group OpenAI API usage by model?

Use the organization Usage endpoint for the relevant capability (such as completions) with the group_by parameter set to model. For example: GET /v1/organization/usage/completions?start_time=...&group_by=model. Different endpoints support different group_by values — check the current API reference for the specific endpoint.

What is the difference between the Usage API and Costs API?

The organization Usage endpoints return usage quantities (tokens, images, seconds) broken down by API capability. The Costs endpoint (GET /v1/organization/costs) returns spend amounts in USD grouped by line item. Use Usage for investigating token and request patterns; use Costs for financial reconciliation.

Does the Usage API return the final billed amount?

No. The organization Usage endpoints return usage quantities, not monetary amounts. Token counts alone do not equal final billed cost because of cached tokens, reasoning tokens, batch pricing and other factors. Use the Costs endpoint or Cost tab for financial totals.

Which API key is required for organization usage endpoints?

An Admin API key is required for organization Usage and Costs endpoints. An ordinary application API key used for model inference does not grant access to administration endpoints. Admin keys must be stored in environment variables and never placed in browser code or support tickets.

Why does the Usage Dashboard show no data?

Common causes: wrong organization selected, account lacks Usage Dashboard permission, project filter is restricting the view, date range is outside the period with usage, or the browser is logged into a different account. Confirm the organization, role, project filter and UTC date range.

What timezone does the OpenAI Usage Dashboard use?

The Usage Dashboard uses UTC for all time ranges and filters. When comparing usage data against local logs or invoices, always normalize both records to UTC to avoid boundary mismatches at month boundaries.

How do I export monthly OpenAI API costs as CSV?

Navigate to the Usage Dashboard in the API Platform, select the target organization and project, choose the calendar-month UTC date range, switch to the Cost tab, and download the CSV. The Cost export provides spend data grouped by line item, suitable for invoice reconciliation.

Estimate before you scale

Use a small prepaid test to measure real API cost before committing a larger budget.