Retrieve usage history
Changed onRetrieve credits and requests over time, bucketed by hour, day, or month. History is kept for one year.
Request
- Base URL: https://api.context.dev/v1
- URL: https://api.context.dev/v1/org/usage/history
- Auth: HTTP bearer
Query parameters
Start of the range, as an ISO 8601 timestamp. Defaults to 24 hours before to for hour, 30 days for day, and 366 days for month.
End of the range, as an ISO 8601 timestamp. Defaults to now.
Bucket size. hour covers up to 7 days; day and month cover up to 366 days. Buckets start on UTC boundaries.
Split each bucket by endpoint path, API key, or HTTP status code.
Response
Usage over time
Example response
{
"data": [
{
"start": "2026-09-29T00:00:00.000Z",
"credits_used": 1250,
"request_count": 830,
"groups": [
{
"value": "/v1/web/scrape",
"credits_used": 1000,
"request_count": 500
},
{
"value": "/v1/brand/retrieve",
"credits_used": 250,
"request_count": 330
}
]
},
{
"start": "2026-09-30T00:00:00.000Z",
"credits_used": 0,
"request_count": 0,
"groups": []
}
],
"total_credits_used": 1250,
"total_request_count": 830,
"interval": "day",
"from": "2026-09-29T00:00:00.000Z",
"to": "2026-09-30T23:59:59.999Z",
"key_metadata": {
"credits_consumed": 0,
"credits_remaining": 41250
},
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"
}Changes
- warning
added the new
NO_PUBLISHED_MARKDOWNenum value to theresponse property for the response status - warning
added the new
NO_PUBLISHED_MARKDOWNenum value to theresponse property for the response status - warning
added the new
NO_PUBLISHED_MARKDOWNenum value to theresponse property for the response status - warning
added the new
NO_PUBLISHED_MARKDOWNenum value to theresponse property for the response status
- warning
- info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status - info
added the optional property
to the response with the status
- info