StackSpendDocs

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
MetricDetail
LatencyReal-time
Historical dataFull 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

API key permissions.The API key must have billing access. A key scoped to model access only will not return cost data. Create the key with no scope restrictions, or explicitly grant it billing scope.
1

Get your API key

  1. Go to the OpenAI Dashboard → API Keys.
  2. Click Create new secret key.
  3. Give it a descriptive name such as StackSpend.
  4. Copy the key immediately — it is only shown once. Store it somewhere safe until you paste it into StackSpend.
2

Get your Organization ID

  1. In the OpenAI Dashboard, go to Settings → Organization.
  2. Copy the Organization ID. It begins with org-.
3

Add to StackSpend

  1. In StackSpend, navigate to Providers and click Add provider.
  2. Select OpenAI from the list.
  3. Paste your API Key and Organization ID.
  4. Click Save.
4

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.

StackSpend Docs