Skip to Content
Docs

Query AI metrics

POST
/metrics/ai

Authorization

jwt
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
filter*
last?string
Match^-?\d+[dhm]$
from?string

An ISO 8601 date time string

Match^(?:\d+(?:\.\d+?)?|(?:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z))$
Formatdate-time
to?string

An ISO 8601 date time string

Match^(?:\d+(?:\.\d+?)?|(?:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z))$
Formatdate-time
rollup?
groupBy?string
Value in"provider-model""route""agent""node""finish-reason"
limit*integer
Range0 < value <= 10000
Default100
offset?integer
Range0 <= value <= 1000000
output*string
Default"table"
Value in"table""timeseries""summary""group""tool-calls-table""tool-calls-timeseries""fallback-chains""fallback-table""route-health"

Response Body

application/json
  1. response
[key: string]?unknown
Example Request
curl -X POST 'https://observability.your-tenant-id.my.contextual.io/api/v1/metrics/ai' \  -H 'Content-Type: application/json' \  -d '{  "filter": {    "service": "string"  },  "limit": 100,  "output": "table"}'
Example Response
{  "property1": null,  "property2": null}