OpenAI
Connect your OpenAI account to track API costs in real time, broken down by project and model.
What StackSpend tracks
Once connected, StackSpend pulls cost and usage data directly from the OpenAI usage API. You get:
- Real-time API costs as they accrue
- Project-level cost breakdown across all your OpenAI projects
- Model-level usage — gpt-4o, gpt-4, gpt-3.5-turbo, and more
- Full historical data imported on first sync
| Metric | Detail |
|---|---|
| Latency | Real-time |
| Historical data | Full history |
| Setup time | ~2 minutes |
Prerequisites
- An OpenAI account with billing enabled
- Admin or billing access on the organization
- Your Organization ID (starts with
org-)
Setup
Get your API key
- Go to the OpenAI Dashboard → API Keys.
- Click Create new secret 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
Starts with sk-...
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 a read-only OpenAI Admin API key plus your Organization ID (which starts with org-). The key must have billing access; a key scoped to model access only will not return cost data.
Is the connection read-only?
Yes. StackSpend only reads cost and usage data from the OpenAI usage API and never writes to your OpenAI account. It pulls project-level and model-level breakdowns for models like gpt-4o, gpt-4, and gpt-3.5-turbo.
How long does setup take and how much history loads?
Setup takes about 2 minutes. On the first sync, StackSpend imports your full available OpenAI usage history and then keeps costs current in real time as they accrue.
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 API key has billing scope (not model-access only) and that the Organization ID is correct, then check the Last synced timestamp on the Providers page.