Usage

Retrieve usage history

Changed on

Retrieve credits and requests over time, bucketed by hour, day, or month. History is kept for one year.

get/org/usage/history

Request

  • Base URL: https://api.context.dev/v1
  • URL: https://api.context.dev/v1/org/usage/history
  • Auth: HTTP bearer

Query parameters

fromstring date-time

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.

Example:2026-09-01T00:00:00Z
tostring date-time

End of the range, as an ISO 8601 timestamp. Defaults to now.

Example:2026-10-01T00:00:00Z
interval'hour' | 'day' | 'month'

Bucket size. hour covers up to 7 days; day and month cover up to 366 days. Buckets start on UTC boundaries.

group_by'path' | 'key_id' | 'status_code'

Split each bucket by endpoint path, API key, or HTTP status code.

Response

Usage over time

total_credits_usedinteger required

Credits charged across the range.

total_request_countinteger required

Requests made across the range.

interval'hour' | 'day' | 'month' required

Bucket size used.

fromstring date-time required

Start of the range.

tostring date-time required

End of the range.

request_idstring uuid required

Unique ID of this request, also in X-Request-Id. Include it when contacting support.

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_MARKDOWN enum value to the response property for the response status

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response 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

      added the optional property to the response with the status