Skip to content
Hayonix

API reference · Schema

ServerlessWorker

  • objectstringrequired

    Always `serverless_worker`: the type of this object

    One ofserverless_worker

  • idstringrequired

    Unique ID (`swk_…`)

    ID with prefix swk_

  • endpoint_idstringrequired

    ID of the endpoint

  • release_idstringrequired

    ID of the release

  • workload_idstringrequired

    ID of the workload

  • node_idstring | nullrequired

    The node the worker runs on, once placed

  • skustringrequired

    Hardware type code

  • statestringrequired

    `paused`: frozen in place (fast resume), not charged; `resuming`: unfrozen, taking work again once it proves itself

    One ofprovisioningidlebusydrainingpausedresumingterminated

  • running_jobsintegerrequired

    Queue endpoints: jobs this worker is running (0 for HTTP endpoints)

  • in_flightintegerrequired

    HTTP endpoints: requests in flight at this worker (0 for queue endpoints)

  • healthstring | nullrequired

    HTTP endpoints: the health check (null when unknown)

    One ofstartinghealthyunhealthy

  • drain_reasonstring | nullrequired

    While `draining`: why, for example `idle`, `over_max` (above `max_workers`), `outdated` (an older release), `pause` (about to be paused) or `endpoint_deleted`; null otherwise

  • cold_start_msinteger | nullrequired

    Milliseconds from the worker being created until it was ready; null until then

  • paused_atstring (date-time) | nullrequired

    Time paused (ISO 8601, UTC)

  • resumed_atstring (date-time) | nullrequired

    Time resumed (ISO 8601, UTC)

  • resume_countintegerrequired

    Times the worker was resumed from pause

  • created_atstring (date-time)required

    When it was created (ISO 8601, UTC)

  • ready_atstring (date-time) | nullrequired

    Time ready (ISO 8601, UTC)

  • last_seen_atstring (date-time) | nullrequired

    Time last seen (ISO 8601, UTC)

  • idle_sincestring (date-time) | nullrequired

    Since when the worker has had no work; null while it is working or not ready

  • terminated_atstring (date-time) | nullrequired

    Time terminated (ISO 8601, UTC)

  • termination_reasonstring | nullrequired

    Why the worker was removed, for example `idle`, `drained`, `outdated`, `startup_timeout`, `placement_timeout`, `unhealthy`, `silent` (stopped reporting), `paused_expired` or `endpoint_deleted`; null while it is live

  • scheduling_statusstring | nullrequired

    Placement on a host: `pending` (waiting for capacity), `placed`, `refused` or `unschedulable` (no host can take it; see `scheduling_message`); null when unknown

  • scheduling_messagestring | nullrequired

    Why placement is waiting or failed; null when there is nothing to say

  • How the worker started, in order: pulling its image, making each model present (from the host’s model cache or by downloading it), starting the container. Loading inside the container ends at ready_at.

    Show 8 fields of start
    • stepstringrequired

      Which step: pulling the image, making one model present, or starting the container

      One ofimagemodelcontainer

    • statestringrequired

      image: pulling | pulled | present (already on the host) | failed; model: cached (found in the host cache, nothing downloaded) | downloading | downloaded | failed; container: started

    • atstring (date-time) | nullrequired

      When the step reached its state; null for an image already on the host

    • repositorystring

      Model steps: the repository

    • bytes_totalinteger

      Model steps: the size of the model in bytes

    • bytes_doneinteger

      Model steps: bytes present and verified so far

    • bytes_downloadedinteger

      Model steps: bytes downloaded for this start (0 when the host already had the model)

    • secondsinteger | null

      Downloaded model steps: how long the download took, in seconds

Example
{
  "object": "serverless_worker",
  "id": "swk_01jc5zq4m8k3v6x9t2w7r0b1e4",
  "endpoint_id": "string",
  "release_id": "string",
  "workload_id": "string",
  "node_id": "string",
  "sku": "string",
  "state": "provisioning",
  "running_jobs": 1,
  "in_flight": 1,
  "health": "starting",
  "drain_reason": "string",
  "cold_start_ms": 1,
  "paused_at": "2026-01-01T00:00:00.000Z",
  "resumed_at": "2026-01-01T00:00:00.000Z",
  "resume_count": 1,
  "created_at": "2026-01-01T00:00:00.000Z",
  "ready_at": "2026-01-01T00:00:00.000Z",
  "last_seen_at": "2026-01-01T00:00:00.000Z",
  "idle_since": "2026-01-01T00:00:00.000Z",
  "terminated_at": "2026-01-01T00:00:00.000Z",
  "termination_reason": "string",
  "scheduling_status": "string",
  "scheduling_message": "string",
  "start": [
    {
      "step": "image",
      "state": "string",
      "at": "2026-01-01T00:00:00.000Z",
      "repository": "string",
      "bytes_total": 1,
      "bytes_done": 1,
      "bytes_downloaded": 1,
      "seconds": 1
    }
  ]
}

Used by