Skip to content
AISpendbook

Billing sources

OpenAI

Connect an Admin key to read the organization Usage and Costs APIs.

The connector uses an Admin API key, because OpenAI's organization usage and cost reports are only available to admin keys. The key is used only to read those reports. Project keys are rejected.

  • An organization owner creates an Admin key in the OpenAI platform under organization settings, Admin keys.
  • Endpoints read: the organization Usage API (completions, embeddings and other usage types) and the Costs API.
  • Costs are reported per day and per project or line item. Usage provides model-level detail.
  • Projects and API keys can be mapped to customers under Customers, Mapping (see attribution and coverage). The cost report carries the project but not the API key, so API key mappings apply to usage estimates only.
  • ChatGPT Enterprise seats are a separate connection: ChatGPT Enterprise (seats).

After you save the key, AI Spendbook validates it, shows the permissions it detected, and runs an initial sync (90 days by default). After that it syncs incrementally. The key is stored encrypted and never shown again. You can rotate it from the connection page.

  • The provider revises recent days. Each sync reads the trailing 3 days again, and a month that has just ended is read again.
  • A workspace can hold several connections of one kind, for example two organizations. Their records are kept apart by connection.
  • The report doesn't carry a customer, feature or end user. Those come from your app's data.

Anthropic has its own page: Anthropic.

This connector has not been run against a live account. It was written from OpenAI's public documentation and tested against mocked responses.