cloadyDocs
API ReferenceEndpointsWorkspaces

Read AI gateway usage

Requests, errors, tokens and median latency over the last 24 hours, hourly spend by model and the models used, from the request log; and this month's spend against the budget. With `key`, only that key's.

GET
/api/workspaces/{workspaceSlug}/ai/usage
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string

Query Parameters

key?string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/workspaces/string/ai/usage"
{  "usage": {    "available": true,    "requests": 0,    "errors": 0,    "input": 0,    "output": 0,    "p50Ms": 0,    "month": {      "spentMicros": 0,      "freeMicros": 0,      "requests": 0    },    "budgetCents": 0,    "hourly": {      "models": [        "string"      ],      "series": [        [          0        ]      ]    },    "models": [      {        "model": "string",        "requests": 0,        "micros": 0,        "p50Ms": 0      }    ]  }}