Overview
The Cost Optix API uses API keys for authentication. API keys are scoped to your organization and carry a permission level that controls what operations they can perform.
API access is available on all tiers, with daily call limits depending on your plan:
Generating an API Key
- Log into your Cost Optix dashboard
- Navigate to Settings → API Keys
- Click Create API Key
- Give it a descriptive name (e.g.
CI Pipeline, Grafana Integration)
- Select a permission level
- Optionally set an expiry date
- Copy the key immediately — it will not be shown again
Permission Levels
Using Your API Key
Include your API key in every request using the X-API-Key header:
Never expose your API key in client-side code or public repositories. Treat it like a password.
Base URL
Example Requests
Check authentication:
Get cost summary:
Key Rotation
API keys can be revoked at any time from Settings → API Keys. When rotating keys:
- Create the new key
- Update all systems using the old key
- Revoke the old key
Revocation is immediate — the old key will stop working as soon as it is revoked.
Rate Limiting
Requests that exceed your daily limit return a 429 Too Many Requests response. The response includes a Retry-After header indicating when your quota resets (midnight UTC).
Error Responses
All API errors follow a consistent format: