Skip to main content
GET
/
credits
/
usage
Aggregated credit usage over a time window
curl --request GET \
  --url https://app.hockeystack.com/api/revenue-agents/v1/credits/usage \
  --header 'Authorization: Bearer <token>'
{
  "from": "2023-11-07T05:31:56Z",
  "to": "2023-11-07T05:31:56Z",
  "total_credits_used": 123,
  "groups": [
    {
      "credits_used": 123,
      "operation_count": 123,
      "feature": "<string>",
      "day": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

from
string<date-time>

Inclusive lower bound. Accepts any string parseable as a date or datetime — YYYY-MM-DD, RFC 3339 with or without an offset. Output is always echoed as full ISO 8601 with Z.

to
string<date-time>

Exclusive upper bound. Accepts any string parseable as a date or datetime. Must be >= from (server returns 400 otherwise).

group_by
enum<string>
default:feature
Available options:
feature,
day,
feature,day

Response

Usage page.

from
string<date-time>
required
to
string<date-time>
required
group_by
enum<string>
required
Available options:
feature,
day,
feature,day
total_credits_used
number
required
groups
object[]
required