OpenAI Platform integration
The OpenAI Platform integration brings your OpenAI API usage and spend into Span, so you can see who uses the OpenAI API, which models they use, and what it costs, next to your other AI tools.
If you use the OpenAI API platform (your company pays for the OpenAI API through an organization on platform.openai.com), use this integration. That covers API keys used by apps, scripts, and internal tools, and Codex CLI or the Codex IDE extension when people sign in with an API key. If you have ChatGPT Enterprise and people sign in to ChatGPT or Codex with their ChatGPT account, use the ChatGPT & Codex Workspace integration instead. Many companies have both and connect both.
Why it matters
API spend is easy to lose track of: it's spread across projects and keys, and OpenAI's console doesn't show it by team. Connecting your OpenAI organization puts that usage next to Cursor, Claude Code, and GitHub Copilot.
For finance and platform owners: see OpenAI API cost by person, team, and model in AI Spend.
For engineering leaders: see who uses the OpenAI API, including Codex on API keys, in Tool utilization.
How it works
Span connects with an organization Admin API key and reads usage and billing data. It doesn't read prompts, completions, or any other content, and doesn't change anything in your OpenAI organization.
Data | What it includes |
|---|---|
Users | Members of the organization and their email addresses |
Projects | Projects, including archived ones, so older usage can still be attributed |
Project API keys | API keys in active projects and who owns each one (a user or a service account) |
Token usage | Daily input, cached input, cache write, and output tokens, and request counts, per user, API key, project, and model |
Costs | Daily cost in USD per user, API key, project, and line item (model and usage type) |
Costs cover everything OpenAI bills on the organization, including embeddings, images, and audio. Token counts come from text completions usage only.
One tool in Span. All OpenAI Platform usage appears as the tool OpenAI API, including Codex traffic on API keys. Span doesn't separate Codex calls from other API calls.
AI Spend. Spend is the cost OpenAI reports, in USD, per person, day, and model. You can break it down by tool and model and filter it by team or person. All OpenAI API spend is usage-based, so it appears as overage spend. There's no seat or subscription cost for the API.
Tool utilization. A person counts as an active OpenAI API user on any day they made at least one model request or had any cost. OpenAI doesn't report lines of code, so OpenAI API usage adds no accepted lines.
Where it shows up. People with the Manage Integrations permission see the connection in the Integrations status on the AI Spend page. Everyone else sees OpenAI API under Supported tools on the Tool utilization and AI Spend pages.
Matching people. Span matches usage to people by email address. For each day's usage and cost, Span uses the first email it finds: the user OpenAI recorded on the cost, then that user's email from your organization's member list, then the email of the person who owns the API key. The email must match the email of a person who is active in Span. Matching isn't case-sensitive.
One connection per organization. If your company has more than one OpenAI organization, add a connection for each. Each connection is tied to its organization ID, so the same organization can't be connected twice, and replacing the key keeps the same connection and its data.
Setup
You need the Manage Integrations permission in Span and an owner of your OpenAI organization, because only owners can create Admin keys. The organization needs API spend in the last 180 days: Span identifies the organization from its cost data.
On platform.openai.com, go to Settings → Organization → Admin keys and create a new Admin key. It starts with
sk-admin-. Copy it.In Span, go to Settings → Integrations. Find OpenAI Platform (tagged Developer Tools) and click Connect.
Paste the key into Admin API Key and click Continue. Span checks the key and reads your organization's name and ID from its cost data, so you don't enter them.
To add another organization, open the integration and click Connect another. To replace a key, click Edit on the connection.
After you connect, allow a few hours for data to appear.
If the check fails, Span tells you why:
"OpenAI rejected the key." The key isn't an Admin key, or it was revoked. Project API keys can't read usage. Create a new Admin key as an organization owner.
"Could not verify OpenAI Admin API key: OpenAI reported no costs in the last 180 days." Span can't identify an organization with no recent spend. Connect again once the organization has API usage.
Things to know
API platform only. ChatGPT Enterprise workspace keys don't work here, and usage from ChatGPT sign-ins isn't in your API organization's data. Use the ChatGPT & Codex Workspace integration for it. The two connections read different OpenAI reports: API-key usage appears under OpenAI API, and ChatGPT sign-in usage under ChatGPT and Codex CLI. Connect each with its own integration; AI Spend adds the two.
Some spend can't be matched to a person. Usage on service account keys has no person. Usage on deleted keys, or keys in archived projects, matches only when OpenAI recorded a user on that usage or cost, because OpenAI no longer lists those keys' owners. Usage by someone whose OpenAI email differs from their email in Span doesn't match either. Unmatched usage appears under Unknown in the integration status, by email or API key ID, and isn't counted in AI Spend totals or Tool utilization.
Estimates, not your invoice. Spend comes from OpenAI's usage reporting, not your bill. Small differences are expected, for example from credits, discounts, or taxes.
Days are UTC. OpenAI reports usage and costs by UTC day, so a late-evening request in US time zones can land on the next day.
Codex on API keys can appear under two tools. If someone uses Codex with an API key and also has agent traces, the traces appear as Codex CLI and the API usage as OpenAI API. In the All tools view of Tool utilization the person counts once per day; in the per-tool views they count under each tool.
Freshness. Span syncs from OpenAI about every 2 hours, and each sync re-reads the previous 2 days because OpenAI keeps updating recent usage and costs. The last couple of days can change slightly, and today's numbers are partial until the day ends. Tool utilization updates within a few hours of a sync. AI Spend rebuilds its combined spend about every 6 hours, so new spend can take longer to show there.
History. The first sync requests usage back to your organization's integration sync start date, up to one year back, because OpenAI serves only the past year.
Worked example. On Tuesday your OpenAI organization reports $47.40 of cost. Priya's API key, which she owns, used $12.40. A service account key used by your CI pipeline used $30.00. A deleted key with no user recorded used $5.00. AI Spend shows $12.40 of OpenAI API overage for Priya. The other $35.00 appears as two API key IDs under Unknown in the integration status and isn't in AI Spend totals. Priya also ran Codex on her API key that day with agent traces installed, so Tool utilization shows her active for both Codex CLI and OpenAI API, and once in All tools.
Related articles
ChatGPT & Codex Workspace Integration
Why AI tool or Spend data might be missing for a person
Need help?
Contact your Span account team or reach out to support@span.app.