Skip to content
Hayonix

API reference · Serverless

Queue depth, jobs by state, workers by state and rollout progress

GET/v1/serverless/endpoints/{endpoint_id}/health
API keyserverless_endpoint:readProject
TypeScript
client.serverless.getEndpointHealth()
Python
client.serverless.get_endpoint_health()
CLI
hayonix serverless health

A snapshot taken now. launch explains queued jobs that no worker picks up (credit, spend limit, suspension or worker quota); requests covers HTTP endpoints' live traffic.

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/health" \
  -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_

Response

200 ServerlessEndpointHealth — Health

  • objectstringrequired

    Always `serverless_endpoint_health`: the type of this object

    One ofserverless_endpoint_health

  • endpoint_idstringrequired

    ID of the endpoint

  • queueobjectrequired

    The job queue right now

    Show 3 fields of queue
    • queuedintegerrequired

      Jobs waiting for a worker

    • runningintegerrequired

      Jobs a worker is running

    • oldest_queued_atstring (date-time) | nullrequired

      Time oldest queued (ISO 8601, UTC)

  • jobsobjectrequired

    Jobs by state: live ones and those finished in the last 24 hours

  • workersobjectrequired

    Live workers by state

    Show 6 fields of workers
    • provisioningintegerrequired

      Starting: being placed, pulling the image or booting

    • idleintegerrequired

      Ready with no work

    • busyintegerrequired

      Ready and running jobs or requests

    • drainingintegerrequired

      Taking no new work, finishing what they have, then leaving

    • pausedintegerrequired

      Paused for fast resume (not charged)

    • resumingintegerrequired

      Unpaused, about to take work again

  • releaseobjectrequired

    Rollout progress of the current release

    Show 3 fields of release
    • current_release_idstring | nullrequired

      ID of the current release

    • workers_on_currentintegerrequired

      Live workers running the current release

    • workers_outdatedintegerrequired

      Live workers still on an older release, replaced as the rollout proceeds

  • launchobjectrequired

    Whether a new worker could start now. When not, queued jobs wait until credit is added, the spend limit clears or worker quota frees up.

    Show 2 fields of launch
    • allowedbooleanrequired

      True when a new worker could start now

    • blocked_bystring | nullrequired

      Why not: `insufficient_credit` (no credit left), `spend_limit_reached` (a spend limit was hit), `organization_suspended`, `quota_exceeded` (the worker quota is used up); null when allowed

      One ofinsufficient_creditspend_limit_reachedorganization_suspendedquota_exceeded

  • requestsobject | nullrequired

    HTTP endpoints: requests in flight at workers and waiting for one, now (null for queue endpoints)

    Show 3 fields of requests
    • in_flightintegerrequired

      Requests being served by workers

    • waitingintegerrequired

      Requests waiting for a ready worker

    • ready_workersintegerrequired

      Workers passing their health check and taking requests

Example response
Example response
{
  "object": "serverless_endpoint_health",
  "endpoint_id": "string",
  "queue": {
    "queued": 1,
    "running": 1,
    "oldest_queued_at": "2026-01-01T00:00:00.000Z"
  },
  "jobs": {},
  "workers": {
    "provisioning": 1,
    "idle": 1,
    "busy": 1,
    "draining": 1,
    "paused": 1,
    "resuming": 1
  },
  "release": {
    "current_release_id": "string",
    "workers_on_current": 1,
    "workers_outdated": 1
  },
  "launch": {
    "allowed": true,
    "blocked_by": "insufficient_credit"
  },
  "requests": {
    "in_flight": 1,
    "waiting": 1,
    "ready_workers": 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.
402insufficient_credit_errorThe organization is out of credit or over a spend limit.
404not_found_errorNo such resource in this project (an ID from another project is answered the same way).
429quota_exceeded_error quota_exceededAn organization quota is reached; param names it.
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.