Skip to main content
Note: Access to the Token Index API is gated per subscription. Your subscription may restrict the available token, index_version, and queryable date range.

POST /api/token-index/index

Get daily LLM token index data for a requested token, index version, and date range. If no date range is provided, data for the server current date is used by default. Missing dates are returned as "-1".

Authorization

This endpoint requires a valid user token or application token. 🔒OAuth2: OAuth2PasswordBearer
Flow type: password
Token URL: token

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
tokenstringYESLLM token index type (case-insensitive). Currently supported: expenditure.1 to 60 characters
index_versionstringNOToken index version. Defaults to v1 (case-insensitive).1 to 60 characters
starting_datestring or nullNOThe start date for the query in YYYY-MM-DD format. Defaults to the server current date.On or after 2025-12-01, unless deployment config overrides it; not in the future
ending_datestring or nullNOThe end date for the query in YYYY-MM-DD format. Defaults to the server current date.Not in the future
starting_date must be less than or equal to ending_date.

Request Example

{
  "token": "expenditure",
  "index_version": "v1",
  "starting_date": "2026-04-20",
  "ending_date": "2026-04-26"
}

Responses

  • 200: Successful Response Index values are returned as strings formatted to four decimal places. index_name is taken from the underlying data and may be null if no data exists for the range.
{
  "meta": {
    "code": 0,
    "url": "/api/token-index/index",
    "message": "OK",
    "timestamp": 1777545600
  },
  "data": {
    "token": "expenditure",
    "index_name": "Token Expenditure Index",
    "index_version": "v1",
    "starting_date": "2026-04-20",
    "ending_date": "2026-04-26",
    "indexes": {
      "2026-04-20": "100.0000",
      "2026-04-21": "101.2345",
      "2026-04-22": "-1",
      "2026-04-23": "103.5678",
      "2026-04-24": "104.0000",
      "2026-04-25": "-1",
      "2026-04-26": "105.4321"
    }
  }
}
  • 422: Validation Error
{
  "meta": {
    "code": 422,
    "url": "/api/token-index/index",
    "message": "Parameter value error: ...",
    "timestamp": 1777545600
  },
  "data": {}
}
  • 10008: Date range error
{
  "meta": {
    "code": 10008,
    "url": "/api/token-index/index",
    "message": "starting date should be less than or equal to ending date",
    "timestamp": 1777545600,
    "args": [],
    "kwargs": {}
  },
  "data": {}
}
  • 34004: Product permission is missing
{
  "meta": {
    "code": 34004,
    "url": "/api/token-index/index",
    "message": "You don't have permission to access the current product...",
    "timestamp": 1777545600
  },
  "data": {}
}

GET /api/token-index/specs-list

Get the list of supported parameters for the Token Index API (supported tokens, index versions, and related metadata).

Authorization

This endpoint requires a valid user token or application token. 🔒OAuth2: OAuth2PasswordBearer
Flow type: password
Token URL: token

Query Parameters

This endpoint takes no query parameters.

Request Example

GET /api/token-index/specs-list

Responses

  • 200: Successful Response The data payload is returned directly from the data store. The exact shape depends on the configured tokens and index versions.
{
  "meta": {
    "code": 0,
    "url": "/api/token-index/specs-list",
    "message": "OK",
    "timestamp": 1777545600
  },
  "data": {
    "token_list": ["expenditure"],
    "index_version_list": ["v1"],
    "min_date": "2025-12-01"
  }
}

GET /api/token-index/latest-date

Get the latest date for which a valid token index value has been generated.

Authorization

This endpoint requires a valid user token or application token. 🔒OAuth2: OAuth2PasswordBearer
Flow type: password
Token URL: token

Query Parameters

This endpoint takes no query parameters.

Request Example

GET /api/token-index/latest-date

Responses

  • 200: Successful Response
{
  "meta": {
    "code": 0,
    "url": "/api/token-index/latest-date",
    "message": "OK",
    "timestamp": 1777545600
  },
  "data": {
    "date": "2026-04-26"
  }
}

POST /api/token-index/dashboard

Get all token index data for the requested date range (used to power the dashboard view). If no date range is provided, data for the server current date is used by default. Your subscription may restrict the queryable date range.

Authorization

This endpoint requires a valid user token or application token. 🔒OAuth2: OAuth2PasswordBearer
Flow type: password
Token URL: token

Request Body

The request body must be in application/json format.
FieldTypeRequiredDescriptionConstraints
starting_datestring or nullNOThe start date for the query in YYYY-MM-DD format. Defaults to the server current date.On or after 2025-12-01, unless deployment config overrides it; not in the future
ending_datestring or nullNOThe end date for the query in YYYY-MM-DD format. Defaults to the server current date.Not in the future
starting_date must be less than or equal to ending_date.

Request Example

{
  "starting_date": "2026-04-20",
  "ending_date": "2026-04-26"
}

Responses

  • 200: Successful Response The response includes the date range echoed back plus the aggregated token index payload.
{
  "meta": {
    "code": 0,
    "url": "/api/token-index/dashboard",
    "message": "OK",
    "timestamp": 1777545600
  },
  "data": {
    "starting_date": "2026-04-20",
    "ending_date": "2026-04-26"
  }
}
  • 10008: Parameter limit error
{
  "meta": {
    "code": 10008,
    "url": "/api/token-index/dashboard",
    "message": "starting date should be less than or equal to ending date",
    "timestamp": 1777545600,
    "args": [],
    "kwargs": {}
  },
  "data": {}
}