tracking
Request Analytics Custom Analytics
Changed onpost/api/public/v2/requests/analytics/custom-analytics
Request
- Base URLhttps://docs.promptlayer.com (the document declares no server; this is the origin it was published from)
- AuthAPI key in header X-API-KEY
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"filter_group": {
"logic": "AND",
"filters": [
{
"field": "request_start_time",
"operator": "between",
"value": [
"2025-06-01T00:00:00Z",
"2025-06-08T00:00:00Z"
]
}
]
},
"customCharts": [
{
"id": "cost_by_model",
"title": "Cost by Model",
"chartType": "bar",
"metric": "sum",
"metricField": "cost",
"groupByField": "engine"
},
{
"id": "requests_over_time",
"title": "Requests Over Time",
"chartType": "line",
"metric": "count",
"timeSeries": true
}
]
}Response
Custom chart results in the order requested.
Changes
- info
endpoint added
- info