Azure OpenAI (Cognitive Services) is billed through Azure. Use the Azure billing connector for that spend. ChatGPT Enterprise and Codex are not on this connector.
- Manual setup
- Terraform
1
Create an Admin API key
In OpenAI Platform > Settings > Admin keys, create an Admin API key (
sk-admin-...). You must be an organization admin. A project inference key (sk-... or sk-proj-...) will not work. Copy the key immediately. It is shown once.2
Grant read-only scopes
Grant read-only scopes only. Do not grant write.
3
Connect in Costory
Go to Integrations, click + Add integration, then choose OpenAI under Billing. The connect URL is
/integration/new/openai/billing. 4
Enter connection details
Fill Connection name (default OpenAI) and Admin API key. Start date is optional. Leave it empty to use Costory’s default lookback.
5
Validate, then save
Click Validate. Costory calls
GET /v1/organization/costs with Authorization: Bearer. Save stays disabled until the Admin key can read organization costs. If this is the only billing source and it is demo data, Costory asks you to confirm before replacing it.Field reference
What Costory includes
Costory pulls organization costs from OpenAI’s Costs API and maps them into . Typical lines include billed Platform usage for that organization (models, line items, and the project or API key OpenAI returns on the Costs API). How to analyze OpenAI costs- Spend by project: one OpenAI project (and project key) per team is the split the Costs API exposes. Map those projects onto a virtual dimension for showback. See Allocate LLM cost per team.
- Spend by model or line item: group by Service name or SKU
- Spend by API key or user: names appear when the key has API keys + Projects read. Otherwise you see raw ids.
- Azure OpenAI charges (use the Azure connector)
- ChatGPT Enterprise or Codex billing
- Taxes, credits, or invoice adjustments outside the Costs API
- Per-request application metadata (feature, route, customer). OpenAI’s export does not carry those labels.
Rotate the Admin API key from Integrations when you need a new credential. Keep Usage read on the replacement key.
Troubleshooting
Related pages
Billing Data
All billing providers and shared setup notes.
Anthropic billing
Connect Anthropic Claude Console and claude.ai costs.
Allocate LLM cost per team
Split OpenAI, Anthropic, and cloud LLM spend by team.
Explorer
Filter and group OpenAI spend with the rest of your stack.
