Skip to content
Hayonix

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

GET/v1/serverless/endpoints/{endpoint_id}/request-metrics
API keyserverless_endpoint:readProject
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

Headers
HeaderRequiredDescription
AuthorizationyesBearer and your API key. The key implies its project.
X-Project-Idsession onlyThe project to act in, for console sessions. Requests with an API key leave it out.

Path parameters

  • endpoint_idstringrequired

    ID of the endpoint

    ID with prefix sep_

Query parameters

  • window_secondsinteger | null

    Default 3600

  • bucket_secondsinteger | null

    Default 60

  • worker_idstring

    One worker only

    ID with prefix swk_

Response

200 ServerlessEndpointRequestMetrics — Request metrics

  • objectstringrequired

    Always `serverless_endpoint_request_metrics`: the type of this object

    One ofserverless_endpoint_request_metrics

  • endpoint_idstringrequired

    ID of the endpoint

  • window_secondsintegerrequired

    Length of the window covered, in seconds, ending now

  • bucket_secondsintegerrequired

    Width of each bucket, in seconds

  • bucketsarray of objectrequired

    Buckets with any requests, oldest first

    Show 9 fields of buckets
    • startstring (date-time)required

      Start of the bucket

    • requestsintegerrequired

      Requests in the period

    • requests_per_secondnumberrequired

      Average requests per second over the period

    • statusobjectrequired

      Answers by status class: 2xx, 3xx, 4xx and 5xx

      Show 4 fields of status
      • successintegerrequired

        Answers with a 2xx status

      • redirectintegerrequired

        Answers with a 3xx status

      • client_errorintegerrequired

        Answers with a 4xx status

      • server_errorintegerrequired

        Answers with a 5xx status

    • latency_msobjectrequired

      Time 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

      Show 5 fields of latency_ms
      • avgnumber | nullrequired

        Mean latency in milliseconds; null without requests

      • p50number | nullrequired

        Median (p50) latency in milliseconds; null without requests

      • p95number | nullrequired

        95th percentile (p95) latency in milliseconds; null without requests

      • p99number | nullrequired

        99th percentile (p99) latency in milliseconds; null without requests

      • maxnumber | nullrequired

        Highest latency in milliseconds; null without requests

    • in_flightobjectrequired

      Concurrent requests being served

      Show 2 fields of in_flight
      • avgnumberrequired

        Average number of requests in flight at once over the period

      • maxintegerrequired

        Most requests in flight at once

    • unroutedintegerrequired

      Answered by the platform without reaching a worker (no worker ready in time, payment required, limits)

    • cold_waitsintegerrequired

      Requests that found no ready worker and waited for one to start or resume

    • cold_wait_msobjectrequired

      How long the requests counted in `cold_waits` waited for a worker

      Show 2 fields of cold_wait_ms
      • avgnumber | nullrequired

        Mean wait for a ready worker, in milliseconds; null when there was none

      • maxnumber | nullrequired

        Longest wait for a ready worker, in milliseconds; null when there was none

  • workersarray of objectrequired

    The whole window per worker

    Show 6 fields of workers
    • worker_idstringrequired

      ID of the worker

    • requestsintegerrequired

      Requests in the period

    • requests_per_secondnumberrequired

      Average requests per second over the period

    • statusobjectrequired

      Answers by status class: 2xx, 3xx, 4xx and 5xx

      Show 4 fields of status
      • successintegerrequired

        Answers with a 2xx status

      • redirectintegerrequired

        Answers with a 3xx status

      • client_errorintegerrequired

        Answers with a 4xx status

      • server_errorintegerrequired

        Answers with a 5xx status

    • latency_msobjectrequired

      Time 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

      Show 5 fields of latency_ms
      • avgnumber | nullrequired

        Mean latency in milliseconds; null without requests

      • p50number | nullrequired

        Median (p50) latency in milliseconds; null without requests

      • p95number | nullrequired

        95th percentile (p95) latency in milliseconds; null without requests

      • p99number | nullrequired

        99th percentile (p99) latency in milliseconds; null without requests

      • maxnumber | nullrequired

        Highest latency in milliseconds; null without requests

    • in_flightobjectrequired

      Concurrent requests being served

      Show 2 fields of in_flight
      • avgnumberrequired

        Average number of requests in flight at once over the period

      • maxintegerrequired

        Most requests in flight at once

Example response
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:

Errors
StatusTypeWhen
400invalid_request_errorA parameter or body field is missing or not allowed; param names it.
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
404not_found_errorNo such resource in this project (an ID from another project is answered the same way).
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.