Use a Management API key. A chat or inference key (
sk-or-v1-...) returns 403 on analytics (Only management keys can perform this operation). Management keys cannot call completion endpoints.- Manual setup
- Terraform
1
Create a Management API key
In OpenRouter > Settings > Management keys, create a Management API key. Copy it immediately. It is shown once.Do not use a chat or inference key. See OpenRouter’s Management API keys guide.
2
Connect in Costory
Go to Integrations, click + Add integration, then choose OpenRouter under Billing. The connect URL is
/integration/new/openrouter/billing. 3
Enter connection details
Fill Connection name (default OpenRouter) and Management key.Organization name is optional. It is a display label Costory stores as the billing-account name. It is not sent to OpenRouter. The management key already scopes the org.Start date is optional. Leave it empty to use Costory’s default lookback.
4
Validate, then save
Click Validate. Costory calls
GET /api/v1/keys with Authorization: Bearer. Save stays disabled until the key can read the Management API. An empty key list is still success. 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 OpenRouter’s Analytics query API and maps them into . Typical lines are billed credit usage for that OpenRouter organization. Explorer dollars follow OpenRouter credits usage, not a BYOK or token-list estimate. How to analyze OpenRouter costs- Spend over time: use the same date presets as other billing sources in Explorer
- Spend by model or SKU: group by Service name or SKU when those fields are populated from analytics
- Spend for this org: the optional Organization name is the Billing account id label
- Chat or inference keys (
sk-or-v1-...) - BYOK or
total_usageestimates as billed dollars - Serving-provider or
endpoint_idsplits (not on this connector yet) - Taxes, credits, or invoice adjustments outside the analytics query
Rotate the Management API key from Integrations when you need a new credential. The stored organization name stays the same.
Troubleshooting
Related pages
Billing Data
All billing providers and shared setup notes.
OpenAI billing
Import OpenAI Platform organization costs.
Allocate LLM cost per team
Split OpenRouter, OpenAI, Anthropic, and cloud LLM spend by team.
Explorer
Filter and group OpenRouter spend with the rest of your stack.
