API reference · Serverless
HTTP endpoints: request rate, status classes, latency percentiles, requests in flight and cold-start waits over time, per endpoint and per worker
/v1/serverless/endpoints/{endpoint_id}/request-metrics- TypeScript
client.serverless.getEndpointRequestMetrics()- Python
client.serverless.get_endpoint_request_metrics()- CLI
hayonix serverless request-metrics
Measured where requests enter the platform, over a window ending now: the last hour in 1-minute buckets by default. The window is 60 seconds to 14 days, buckets are at least 10 seconds, and a call returns at most 1000 buckets. Queue endpoints have no request traffic, so their buckets are empty.
Project API key (Authorization: Bearer sk_…), or a console session. Requires the serverless_endpoint:read permission (a key's scope, or a role that includes it).
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
curl -sS "$API_BASE_URL/serverless/endpoints/sep_01jc5zq4m8k3v6x9t2w7r0b1e4/request-metrics" \
-H "Authorization: Bearer $API_KEY"Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
X-Project-Id | session only | The project to act in, for console sessions. Requests with an API key leave it out. |
Path parameters
endpoint_idstringrequiredID of the endpoint
ID with prefix sep_
Query parameters
window_secondsinteger | nullDefault 3600
bucket_secondsinteger | nullDefault 60
worker_idstringOne worker only
ID with prefix swk_
Response
200 ServerlessEndpointRequestMetrics — Request metrics
objectstringrequiredAlways `serverless_endpoint_request_metrics`: the type of this object
One of
serverless_endpoint_request_metricsendpoint_idstringrequiredID of the endpoint
window_secondsintegerrequiredLength of the window covered, in seconds, ending now
bucket_secondsintegerrequiredWidth of each bucket, in seconds
bucketsarray of objectrequiredBuckets with any requests, oldest first
ShowHide 9 fields of
bucketsstartstring (date-time)requiredStart of the bucket
requestsintegerrequiredRequests in the period
requests_per_secondnumberrequiredAverage requests per second over the period
statusobjectrequiredAnswers by status class: 2xx, 3xx, 4xx and 5xx
ShowHide 4 fields of
statussuccessintegerrequiredAnswers with a 2xx status
redirectintegerrequiredAnswers with a 3xx status
client_errorintegerrequiredAnswers with a 4xx status
server_errorintegerrequiredAnswers with a 5xx status
latency_msobjectrequiredTime to response headers. Percentiles are the upper bound of a fixed histogram bucket (5, 10, 25, 50, 100, 250, 500 ms, 1, 2.5, 5, 10, 30, 60, 300 s), capped by the maximum
ShowHide 5 fields of
latency_msavgnumber | nullrequiredMean latency in milliseconds; null without requests
p50number | nullrequiredMedian (p50) latency in milliseconds; null without requests
p95number | nullrequired95th percentile (p95) latency in milliseconds; null without requests
p99number | nullrequired99th percentile (p99) latency in milliseconds; null without requests
maxnumber | nullrequiredHighest latency in milliseconds; null without requests
in_flightobjectrequiredConcurrent requests being served
ShowHide 2 fields of
in_flightavgnumberrequiredAverage number of requests in flight at once over the period
maxintegerrequiredMost requests in flight at once
unroutedintegerrequiredAnswered by the platform without reaching a worker (no worker ready in time, payment required, limits)
cold_waitsintegerrequiredRequests that found no ready worker and waited for one to start or resume
cold_wait_msobjectrequiredHow long the requests counted in `cold_waits` waited for a worker
ShowHide 2 fields of
cold_wait_msavgnumber | nullrequiredMean wait for a ready worker, in milliseconds; null when there was none
maxnumber | nullrequiredLongest wait for a ready worker, in milliseconds; null when there was none
workersarray of objectrequiredThe whole window per worker
ShowHide 6 fields of
workersworker_idstringrequiredID of the worker
requestsintegerrequiredRequests in the period
requests_per_secondnumberrequiredAverage requests per second over the period
statusobjectrequiredAnswers by status class: 2xx, 3xx, 4xx and 5xx
ShowHide 4 fields of
statussuccessintegerrequiredAnswers with a 2xx status
redirectintegerrequiredAnswers with a 3xx status
client_errorintegerrequiredAnswers with a 4xx status
server_errorintegerrequiredAnswers with a 5xx status
latency_msobjectrequiredTime to response headers. Percentiles are the upper bound of a fixed histogram bucket (5, 10, 25, 50, 100, 250, 500 ms, 1, 2.5, 5, 10, 30, 60, 300 s), capped by the maximum
ShowHide 5 fields of
latency_msavgnumber | nullrequiredMean latency in milliseconds; null without requests
p50number | nullrequiredMedian (p50) latency in milliseconds; null without requests
p95number | nullrequired95th percentile (p95) latency in milliseconds; null without requests
p99number | nullrequired99th percentile (p99) latency in milliseconds; null without requests
maxnumber | nullrequiredHighest latency in milliseconds; null without requests
in_flightobjectrequiredConcurrent requests being served
ShowHide 2 fields of
in_flightavgnumberrequiredAverage number of requests in flight at once over the period
maxintegerrequiredMost requests in flight at once
Example response
{
"object": "serverless_endpoint_request_metrics",
"endpoint_id": "string",
"window_seconds": 1,
"bucket_seconds": 1,
"buckets": [
{
"start": "2026-01-01T00:00:00.000Z",
"requests": 1,
"requests_per_second": 1.5,
"status": {
"success": 1,
"redirect": 1,
"client_error": 1,
"server_error": 1
},
"latency_ms": {
"avg": 1.5,
"p50": 1.5,
"p95": 1.5,
"p99": 1.5,
"max": 1.5
},
"in_flight": {
"avg": 1.5,
"max": 1
},
"unrouted": 1,
"cold_waits": 1,
"cold_wait_ms": {
"avg": 1.5,
"max": 1.5
}
}
],
"workers": [
{
"worker_id": "string",
"requests": 1,
"requests_per_second": 1.5,
"status": {
"success": 1,
"redirect": 1,
"client_error": 1,
"server_error": 1
},
"latency_ms": {
"avg": 1.5,
"p50": 1.5,
"p95": 1.5,
"p99": 1.5,
"max": 1.5
},
"in_flight": {
"avg": 1.5,
"max": 1
}
}
]
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | A parameter or body field is missing or not allowed; param names it. |
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
404 | not_found_error | No such resource in this project (an ID from another project is answered the same way). |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |