Administer
API keys
Keys for automation and for sending usage data, each scoped to one project.
Each key belongs to one project and is created in Settings, API keys. The secret is shown once, when the key is created. Store it in your secret manager; it cannot be retrieved later.
Scopes
Every key starts with crm_ and has one of three scopes:
| Scope | What it can do |
|---|---|
| Read only | Read the organization, the project it belongs to, and the project's costs, budgets and alerts. |
| Read and write | Read the same, and change the project's settings, such as its name and currency. |
| Send data only | Send usage data, custom source files and business metric values to the project, and nothing else: it cannot read anything. |
No key can manage people, single sign on or other keys, and none can reach another project. A key that leaked reaches no further than its project and scope. A key reads its whole project, so someone who sees part of a project cannot create one for it. Use a Send data only key in your own services, since it can never read your billing data; see Sending usage data, Custom sources and Unit costs.
Using a key
Send it as a bearer token:
Authorization: Bearer crm_...
Every path below is under https://api.costreveal.com/api/v1. A request the API refuses is answered with a code that says why, as Errors lists them.
Reading costs
A read only or read and write key reads its own project's figures through the same endpoints the dashboard reads, and answers with the same figures, each carrying its basis. Name the project with projectId; a key can read no other.
| Endpoint | What it returns | Parameters |
|---|---|---|
GET /costs/overview | A month's total, how much is explained, unknown and not yet invoiced, and reconciliation | projectId, period, currency, billedIn, costType |
GET /costs/explore | Spend by a dimension, then by a second, filtered, compared with another month | Those, and groupBy, thenBy, filter, compare |
GET /costs/explore/drivers | What drove the change from the month compared with | As Explore, with compare |
GET /costs/business | Cost per feature, customer and user, beside the calls usage data counted | projectId, period, currency, billedIn, costType |
GET /costs/margin | Revenue beside cost, by customer, once Stripe is connected | projectId, period, currency, billedIn, costType |
GET /costs/unit-costs | Each unit cost's month, the month before, its trend, its days and each owner's figure | projectId, period, currency, billedIn, costType |
GET /metrics | Each business metric, and the days it holds values for | projectId |
GET /costs/insights | The month's forecast, the next month's, and anomalies against what was expected, with where each stands | projectId, currency, billedIn, costType |
GET /costs/insights/anomaly-drivers | What drove an anomaly's day, divided exactly by every dimension | projectId, provider, day, lens and its subject, currency, billedIn |
GET /costs/insights/anomaly-movements | What moved below the service: usage types and resources, more use or a higher price | As above |
GET /costs/insights/anomaly-changes | What changed around an anomaly, from each cloud's own records and the cluster's | As above |
GET /costs/savings | Savings each cloud recommends and clusters' idle capacity, with where each stands | projectId, currency, billedIn |
GET /budgets | Each budget, its spend so far, its state and its forecast | projectId |
GET /kubernetes/costs | Each cluster's bill, its workloads, idle capacity and unmeasured days | projectId, period, costType |
periodis a month asYYYY-MM; the current month when left out.currencyshows every figure in that currency, at the European Central Bank's average rate for the month; the project's display currency when left out.billedInreads only what was billed in one currency, unconverted.costTypeisbilled,discounted,amortizedordiscounted_amortized; billed when left out. Each answer states itscostType, and the anomalies of/costs/insightsare in billed cost whichever is asked for. See Cost types.groupByandthenByareprovider,account,region,service,model,team,feature,customeroruser,cluster,namespaceorworkloadfor Kubernetes, or a custom dimension astag:<key>.filterisdimension:value, repeated for each, such asfilter=team:search&filter=service:AmazonEC2.compareisprevious_month,previous_yearor a month asYYYY-MM.- An anomaly is named as
/costs/insightslists it: itsprovider, itsdayasYYYY-MM-DD, and its subject'slenswith the subject's fields, such aslens=service&service=AmazonEC2. - Amounts are decimal strings, exact as billed, never floating point numbers.
curl -H "Authorization: Bearer crm_..." \
"https://api.costreveal.com/api/v1/costs/explore?projectId=<project>&period=2026-10&groupBy=team&thenBy=service"
The same reads are offered to AI tools such as Claude Code, Cursor and Visual Studio Code through the MCP server.
Chargeback statements and reports are read in the dashboard, where each download is recorded against the person who made it.
Rate limits
An organization's read only and read and write keys, together, may call each endpoint up to its plan's limit a minute, listed under Settings, Plan and usage. A Send data only key has a limit of its own, so usage data, custom source files and metric values are never held up by other keys. A request past its limit is answered with status 429, and its Retry-After header says how many seconds to wait. People signed in to the dashboard are counted apart, each on their own.
Expiry and revocation
Choose an expiry of 30 days, 90 days, a year, or none. Revoking a key stops everything using it straight away. Each key shows when it was last used, which helps find keys that can be retired.