Skip to main content
GET
Get the estimated cost per session of a product per day, week or month

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

productId
string
required

The product to read

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.

interval
enum<string>
required

The bucket size: a UTC calendar day, an ISO week (from Monday) or a calendar month

Available options:
day,
week,
month
Example:

"week"

Response

The session cost of the product per bucket

interval
enum<string>
required

The bucket size: a UTC calendar day, an ISO week (from Monday) or a calendar month

Available options:
day,
week,
month
Example:

"week"

buckets
object[]
required

Every bucket of the period in order. Empty when the product belongs to another organization. A session cost is the estimated cost summed over its turns; a session with no cost on any turn is left out.