API reference · Serverless
Queue delay, execution time, cold starts and job counts over time
/v1/serverless/endpoints/{endpoint_id}/metrics- TypeScript
client.serverless.getEndpointMetrics()- Python
client.serverless.get_endpoint_metrics()- CLI
hayonix serverless metrics
Fixed buckets over a window ending now: the last hour in 1-minute buckets by default. The window is 60 seconds to 30 days, buckets are at least 10 seconds, and a call returns at most 1000 buckets.
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/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
Response
200 ServerlessEndpointMetrics — Metrics
objectstringrequiredAlways `serverless_endpoint_metrics`: the type of this object
One of
serverless_endpoint_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 activity, oldest first (empty buckets are omitted)
ShowHide 14 fields of
bucketsstartstring (date-time)requiredStart of the bucket
submittedintegerrequiredJobs submitted in the bucket
succeededintegerrequiredJobs that finished as `succeeded` in the bucket
failedintegerrequiredJobs that finished as `failed` in the bucket
timed_outintegerrequiredJobs that finished as `timed_out` in the bucket
canceledintegerrequiredJobs that finished as `canceled` in the bucket
expiredintegerrequiredJobs that finished as `expired` in the bucket
retriedintegerrequiredRetries (after lost workers) of the jobs that finished in the bucket
queue_delay_msobjectrequiredFor jobs that finished in the bucket: time from submission until a worker first took the job
ShowHide 3 fields of
queue_delay_msavgnumber | nullrequiredMean, in milliseconds; null when no job counted
p50number | nullrequiredMedian (p50), in milliseconds; null when no job counted
p95number | nullrequired95th percentile (p95), in milliseconds; null when no job counted
execution_msobjectrequiredFor jobs that finished in the bucket: time their last attempt ran
ShowHide 3 fields of
execution_msavgnumber | nullrequiredMean, in milliseconds; null when no job counted
p50number | nullrequiredMedian (p50), in milliseconds; null when no job counted
p95number | nullrequired95th percentile (p95), in milliseconds; null when no job counted
cold_startsintegerrequiredNew workers that became ready in the bucket
cold_start_msobjectrequiredCold start time of the workers that became ready in the bucket
ShowHide 2 fields of
cold_start_msavgnumber | nullrequiredMean time from the worker being created until it was ready, in milliseconds; null when there was none
maxnumber | nullrequiredLongest time from the worker being created until it was ready, in milliseconds; null when there was none
resumesintegerrequiredPaused workers resumed (fast resume), counted when they took work again
resume_msobjectrequiredResume time of the workers counted in `resumes`
ShowHide 2 fields of
resume_msavgnumber | nullrequiredMean time from the resume request until the worker was ready again, in milliseconds; null when there was none
maxnumber | nullrequiredLongest time from the resume request until the worker was ready again, in milliseconds; null when there was none
Example response
{
"object": "serverless_endpoint_metrics",
"endpoint_id": "string",
"window_seconds": 1,
"bucket_seconds": 1,
"buckets": [
{
"start": "2026-01-01T00:00:00.000Z",
"submitted": 1,
"succeeded": 1,
"failed": 1,
"timed_out": 1,
"canceled": 1,
"expired": 1,
"retried": 1,
"queue_delay_ms": {
"avg": 1.5,
"p50": 1.5,
"p95": 1.5
},
"execution_ms": {
"avg": 1.5,
"p50": 1.5,
"p95": 1.5
},
"cold_starts": 1,
"cold_start_ms": {
"avg": 1.5,
"max": 1.5
},
"resumes": 1,
"resume_ms": {
"avg": 1.5,
"max": 1.5
}
}
]
}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. |