Stack SpendDocs

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
MetricDetail
LatencyProvider reporting and scheduled sync; not a live request meter
Historical dataUp 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

API key permissions.Use an organization Admin API key that can read /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.
Optional identity lookup.For readable user, project and service-account names, the connector also attempts GET requests to organization users, projects and project service accounts. Audit-log reads can help resolve former-user identities. These lookups are best effort: unavailable access falls back to IDs. Grant audit-log read access only if you need that lookup; it is not required by the initial cost-connection check.

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.

1

Get your Admin API key

  1. Go to the OpenAI organization settings → Admin keys.
  2. Ask an API Platform organization owner to create a dedicated Admin API 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

Go to Providers → Add provider → OpenAI and fill in both fields:

Add OpenAI provider

••••••••••••••••••••

Organization Admin API key

org-...

Find in OpenAI Settings → Organization → Organization ID

Providers›Add provider›OpenAI
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.

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.

Connect OpenAI to StackSpend — StackSpend Docs