OpenAI
Connect your OpenAI organization to track reported costs and token usage by model.
What StackSpend tracks
Once connected, StackSpend pulls cost and usage data directly from the OpenAI usage API. You get:
- Reported costs from the organization Costs API, grouped by billing line item
- Usage attribution by project and user where the provider returns those fields
- Model-level token usage, including input, cached input and output tokens
- An initial 90-day backfill, limited to data available from OpenAI
| Metric | Detail |
|---|---|
| Latency | Provider reporting and scheduled sync; not a live request meter |
| Historical data | Up to 90 days on first sync |
| Setup time | ~2 minutes |
Prerequisites
- An OpenAI account with billing enabled
- An API Platform organization owner who can create an organization Admin API key
- Your Organization ID (starts with
org-)
Setup
/v1/organization/costs and /v1/organization/usage/completions. A standard project key for model requests is not the documented key type for these organization APIs. StackSpend makes read requests; that does not mean every Admin key is automatically restricted to read-only access. Select only the read permissions needed for your connection where OpenAI exposes permission controls. Do not grant unrestricted access to resolve a missing-permission error; review the endpoint and contact support first.Requirements checked against the connector and official guidance on 30 September 2026: OpenAI Admin APIs and Costs API reference. API Platform keys are separate from ChatGPT workspace Admin keys.
Get your Admin API key
- Go to the OpenAI organization settings → Admin keys.
- Ask an API Platform organization owner to create a dedicated Admin API key.
- Give it a descriptive name such as StackSpend.
- Copy the key immediately — it is only shown once. Store it somewhere safe until you paste it into StackSpend.
Get your Organization ID
- In the OpenAI Dashboard, go to Settings → Organization.
- Copy the Organization ID. It begins with
org-.
Add to StackSpend
Go to Providers → Add provider → OpenAI and fill in both fields:
Add OpenAI provider
Organization Admin API key
Find in OpenAI Settings → Organization → Organization ID
Verify sync
After saving, an initial sync starts automatically. Cost data typically appears within a few minutes. To confirm everything is working, return to the Providers page and check the Last synced timestamp next to the OpenAI entry.
Frequently asked questions
What access does StackSpend need to connect OpenAI?
StackSpend needs an organization Admin API key that can read organization costs and usage, plus your Organization ID (org-). Standard project model keys are not the documented key type. Choose only the required read permissions where supported; do not assume an Admin key is automatically read-only.
Is the connection read-only?
The connector makes GET requests to OpenAI costs, usage and optional organization directory APIs; it does not make write requests. The permissions carried by your Admin key are a separate concern. Restrict them to the reads you need where OpenAI supports those controls.
How long does setup take and how much history loads?
Setup typically takes about 2 minutes once the key is available. The first sync requests up to 90 days of available history. Costs appear after provider reporting and scheduled sync; this is not a real-time request meter.
Why don't I see any cost data yet?
The initial sync runs automatically after you save and data usually appears within a few minutes. If nothing shows, confirm the organization Admin key can read the Costs API and that the Organization ID is correct, then check the Last synced timestamp on the Providers page.