curl --request POST \
--url https://api.example.com/calls/stats \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"granularity": 123,
"usage_metrics": [
{
"metric": "input_tokens",
"aggregations": [
"sum"
],
"percentiles": []
}
],
"call_metrics": [
{
"metric": "latency_ms",
"aggregations": [
"sum"
],
"percentiles": []
}
],
"filter": {
"op_names": [
"<string>"
],
"input_refs": [
"<string>"
],
"output_refs": [
"<string>"
],
"parent_ids": [
"<string>"
],
"trace_ids": [
"<string>"
],
"call_ids": [
"<string>"
],
"thread_ids": [
"<string>"
],
"turn_ids": [
"<string>"
],
"trace_roots_only": true,
"wb_user_ids": [
"<string>"
],
"wb_run_ids": [
"<string>"
]
},
"timezone": "UTC"
}
'{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"granularity": 123,
"timezone": "<string>",
"usage_buckets": [],
"call_buckets": []
}curl --request POST \
--url https://api.example.com/calls/stats \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": "<string>",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"granularity": 123,
"usage_metrics": [
{
"metric": "input_tokens",
"aggregations": [
"sum"
],
"percentiles": []
}
],
"call_metrics": [
{
"metric": "latency_ms",
"aggregations": [
"sum"
],
"percentiles": []
}
],
"filter": {
"op_names": [
"<string>"
],
"input_refs": [
"<string>"
],
"output_refs": [
"<string>"
],
"parent_ids": [
"<string>"
],
"trace_ids": [
"<string>"
],
"call_ids": [
"<string>"
],
"thread_ids": [
"<string>"
],
"turn_ids": [
"<string>"
],
"trace_roots_only": true,
"wb_user_ids": [
"<string>"
],
"wb_run_ids": [
"<string>"
]
},
"timezone": "UTC"
}
'{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"granularity": 123,
"timezone": "<string>",
"usage_buckets": [],
"call_buckets": []
}Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Request for aggregated call statistics over a time range.
Inclusive start time (UTC, ISO 8601).
Exclusive end time (UTC, ISO 8601). Defaults to now if omitted.
Bucket size in seconds (e.g., 3600 for 1 hour). If omitted, auto-selected based on time range. Will be adjusted if it would produce more than 10,000 buckets.
Usage metrics (tokens, cost) to compute. Grouped by timestamp and model.
Show child attributes
Call-level metrics (latency, counts) to compute. Grouped by timestamp only.
Show child attributes
Show child attributes
IANA timezone for bucket alignment (e.g., 'America/New_York')
Successful Response
Response containing time-series call statistics.
Resolved start time (UTC)
Resolved end time (UTC)
Bucket size used (in seconds)
Timezone used for bucket alignment
Usage metrics by model. Each bucket contains 'timestamp', 'model', and aggregated metric values.
Call-level metrics. Each bucket contains 'timestamp' and aggregated metric values.
Was this page helpful?