Skip to main content
GET
Get the estimated cost, LLM spans and tokens of a period split by model, version or end user

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Query Parameters

from
string<date-time>
required

Start of the period, inclusive (ISO 8601)

to
string<date-time>
required

End of the period, exclusive (ISO 8601). A period that does not end after from, or is longer than 1830 days (5 years), is rejected with 400.

isProduction
boolean
required

Count production sessions when true, development sessions when false.

organizationId
string

The organization whose products to read. Defaults to the caller's own organization. Another organization reads products only for a caller that may read across organizations.

name
string

Keep the products whose name contains this (case-insensitive)

tags
string[]

Keep the products that carry any of these tags

productIds
string[]

Keep only these products. A product outside the caller's grant is refused with 403; a product of another organization, or a deleted one, matches nothing. At most 25.

Maximum array length: 25
groupBy
enum<string>
required

The value each row stands for: the model that answered each LLM span, the version, or the end user of each turn

Available options:
model,
version,
endUser
Example:

"model"

Response

The cost of the products per value

rows
object[]
required

Every value, the highest cost first. Each turn's estimated cost is split over the LLM spans it counts, each LLM call once and under the model it reports; the part of a turn's cost that its spans do not carry goes to the version model. So the rows add up to total, which is the totalCost of GET /analytics/cost-overview for the same filters.

total
object
required

The sum of every row