Skip to main content
GET
/
api
/
v1
/
credits
/
usage
Get credit usage
curl --request GET \
  --url https://api.example.com/api/v1/credits/usage \
  --header 'X-API-KEY: <api-key>'
{
  "data": {
    "series": [
      {
        "featureId": "feature-tokens",
        "featureName": "API Tokens",
        "totalCredits": 1500,
        "points": [
          {
            "timestamp": "2024-01-01T00:00:00.000Z",
            "value": 500
          },
          {
            "timestamp": "2024-01-02T00:00:00.000Z",
            "value": 750
          },
          {
            "timestamp": "2024-01-03T00:00:00.000Z",
            "value": 250
          }
        ]
      }
    ],
    "currency": {
      "currencyId": "credits",
      "displayName": "Credits",
      "symbol": null,
      "singular": "credit",
      "plural": "credits"
    }
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Query Parameters

customerId
string
required

Filter by customer ID (required)

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$
resourceId
string

Filter by resource ID

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
currencyId
string

Filter by currency ID

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
timeRange
enum<string>

Time range for usage data (LAST_DAY, LAST_WEEK, LAST_MONTH, LAST_YEAR). Defaults to LAST_MONTH

Available options:
LAST_DAY,
LAST_WEEK,
LAST_MONTH,
LAST_YEAR

Response

Credit usage data with time-series points per feature.

Response object

data
CreditUsage · object
required

Credit usage data grouped by feature with time-series points