Skip to main content

Overview

The CostOptix API uses API keys. A key belongs to your organisation and carries permissions that control what it can do. Every plan includes API access, with a daily call limit: Limits reset at 00:00 UTC.

Creating a key

  1. Go to Settings → API Keys and click Create API Key.
  2. Give it a name you will recognise, such as CI pipeline or Grafana.
  3. Pick its permissions.
  4. Optionally set an expiry: 7 days, 30 days, 90 days or 1 year.
  5. Copy the key straight away. It is shown only once.

Permissions

The four ingest permissions are deliberately narrow. A key that holds only ingest permissions can push that data and nothing else: it cannot read costs or change settings. Adding read, write or admin to the same key removes that limit, so keep ingest keys separate. That makes them safe to leave on a cluster, a machine or a developer laptop. The guided setup on the Kubernetes, Hosts and LLM Usage pages creates the right key for you.

Using a key

Send the key in the X-API-Key header:
Base URL:

Examples

List connected accounts:
Get the org-wide overview for a month:
Leave out month for the current month.
Treat API keys like passwords. Never put them in client-side code or a public repository.

Rotating and revoking keys

Revoke a key at any time from Settings → API Keys. Revocation is immediate. To rotate without downtime:
  1. Create the new key.
  2. Update everything that uses the old one.
  3. Revoke the old key.
Agent keys show their expiry date in the agent health panel on the Kubernetes and Hosts pages, so you can replace them before they lapse.

Rate limits

When the daily limit is reached, the API returns 429 Too Many Requests with details of the limit and when it resets:

Errors

Errors use the same shape: