Dimension Data API

Get cost breakdown by dimension

Returns cost aggregated by a specific custom dimension (e.g., "team", "region"). Call it with a GET request to /dimension-data/cost-breakdown, authenticated with a restricted API key and the "costs:read" scope.

Returns cost aggregated by a specific custom dimension (e.g., "team", "region"). Groups costs by the dimension values (e.g., "team-ml", "team-api"). Events that do not carry the dimension key in their metadata are grouped under the reserved dimensionValue "Unassigned". Requests count toward your per-API-key rate limit; sustained overruns return 429 with the standard error envelope.

Authentication and scopes

Authenticate with a restricted API key in the Authorization: Bearer <key> header. This endpoint requires the costs:read scope.

Parameters

NameInTypeRequiredDescription
dimension_keyquerystringYesDimension key exactly as returned by GET /dimension-data/definitions (snake_case, case-sensitive).
start_datequerystringYesStart of date range (ISO 8601, inclusive).
end_datequerystringYesEnd of date range (ISO 8601, exclusive).

Response fields

Fields returned in the 200 response body. Nested objects are listed under their parent. A field marked optional may be absent from the body; one marked nullable is always present but its value may be null.

FieldTypeDescription
itemsobject[]Cost breakdown by dimension value.
dimension_valuestringDimension value (e.g., "team-ml", "region-us-east"). Events missing this dimension key in their metadata are grouped as "Unassigned".
total_coststringTotal cost for this dimension value (USD, decimal string).
input_tokensnumber (double)Input tokens used.
output_tokensnumber (double)Output tokens used.
event_countnumber (double)Number of events.
percent_of_totalnumber (double)Percentage of total organization cost.
total_coststringTotal cost across all dimension values (USD, decimal string).

Error codes

Errors return the standard error envelope with a code, message, and a correlationId you can quote to support.

StatusWhen it happens
400Invalid request. Check that start_date and end_date are valid ISO 8601 dates.
401Authentication required. Provide a valid API key in the Authorization header.
403Insufficient permissions. Use an API key with the costs:read scope.
404Dimension not found. Pass a dimension_key exactly as returned by GET /dimension-data/definitions (snake_case, case-sensitive).
429Rate limit or plan quota exceeded. Slow down and retry after the current window resets.

Rate limits and retries

Rate limit or plan quota exceeded. Slow down and retry after the current window resets.