Usage

AI token usage for this api-key and its organisation

GET/usage

Reports AI token consumption (as recorded for billing) at two levels:

  • account — usage accrued by this api-key's linked service user.
  • organisation — aggregated across every user in the linked user's usergroup. If your organisation holds several api-keys (each with its own service user), this is the combined picture; it also includes interactive platform users in the same group.

Dates are inclusive ISO dates. With no parameters you get the current calendar month to date, at both levels. Counters are daily aggregates, so byDay has at most one entry per day; days with no usage are omitted.

X-Api-Key<token>

Issued to you when your integration is provisioned. Determines which catalogue resources are visible and which AI tools are available.

In: header

Query Parameters

from?string

Inclusive start date. Defaults to the first day of the current month.

Formatdate
to?string

Inclusive end date. Defaults to today. Maximum range is one year.

Formatdate
level?string

Which section(s) to include in the response.

Default"both"

Value in

  • "account"
  • "organisation"
  • "both"

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/usage?from=2026-07-01&to=2026-07-15"
{  "success": true,  "status": "success",  "message": "Success",  "data": {    "from": "2026-07-01",    "to": "2026-07-15",    "level": "both",    "units": "tokens",    "account": {      "userRef": 1024,      "username": "api_service_account",      "totals": {        "tokenCount": 15230,        "inputTokens": 12400,        "outputTokens": 2830      },      "byDay": [        {          "day": "2026-07-01",          "tokenCount": 9100,          "inputTokens": 7600,          "outputTokens": 1500        },        {          "day": "2026-07-03",          "tokenCount": 6130,          "inputTokens": 4800,          "outputTokens": 1330        }      ],      "byModel": [        {          "model": "GPT 5.1",          "tokenCount": 15230,          "inputTokens": 12400,          "outputTokens": 2830        }      ],      "bySource": [        {          "source": "chat",          "tokenCount": 15230,          "inputTokens": 12400,          "outputTokens": 2830        }      ]    },    "organisation": {      "usergroupRef": 12,      "usergroupName": "Publisher X",      "totals": {        "tokenCount": 40870,        "inputTokens": 33800,        "outputTokens": 7070      },      "byDay": [        {          "day": "2026-07-01",          "tokenCount": 22400,          "inputTokens": 18700,          "outputTokens": 3700        },        {          "day": "2026-07-03",          "tokenCount": 18470,          "inputTokens": 15100,          "outputTokens": 3370        }      ],      "byUser": [        {          "userRef": 1024,          "username": "api_service_account",          "tokenCount": 15230,          "inputTokens": 12400,          "outputTokens": 2830        },        {          "userRef": 1031,          "username": "warehouse_sync_key",          "tokenCount": 25640,          "inputTokens": 21400,          "outputTokens": 4240        }      ],      "byModel": [        {          "model": "GPT 5.1",          "tokenCount": 40870,          "inputTokens": 33800,          "outputTokens": 7070        }      ]    }  }}
{  "success": false,  "status": "fail",  "message": "string",  "error": {    "message": "API key is required",    "code": "NO_API_KEY"  }}

{  "success": false,  "status": "fail",  "message": "API key is required",  "error": {    "code": "NO_API_KEY",    "message": "API key is required"  }}