API Reference
Log In
API Reference

Get total cost by model

Returns one total cost in USD per model for the whole window, with no time buckets. Narrow it to one provider with provider. The group parameter is accepted but not applied: the value is always the total. GET /v2/api/sources/metrics/ai/cost-metric-by-model returns the same shape but filters by model and applies group; for one value per model per time bucket, use GET /v2/api/sources/metrics/ai/cost-by-model-over-time.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
required

ID of the team that owns this data.

string
enum

Predefined time window to aggregate results (e.g., TWELVE_MONTHS). Ignored if both startDate and endDate are provided. Defaults to TWELVE_MONTHS when no custom date range is specified.

string

Start of a custom date range in ISO 8601 format (e.g., 2025-09-01T00:00:00Z). Must be provided together with endDate. When both are provided, the period parameter is ignored and this custom range is used instead.

string

End of a custom date range in ISO 8601 format (e.g., 2025-09-30T23:59:59Z). Must be provided together with startDate. When both are provided, the period parameter is ignored and this custom range is used instead.

string

Optional provider filter. Omit to include all providers.

string
enum

Accepted but not applied. This operation always returns the total cost.

Allowed:
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*