> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Read whether a deployment serves, and its last worker sample

> Beta. For the workspace's own Metrics tab: the state of the copy the deployment serves, the release version it runs, the most workers its compute config allows and the last stored worker sample. Reads stored state only; it sends no request to a GPU provider or to a metrics store. Never cached: the response says `Cache-Control: private, no-store`.

Refuses an API key with 401, so only a signed-in workspace member reads it. Another workspace's deployment, a running copy's own id and an id that does not exist all answer 404.

Can be switched off per workspace (the same switch turns off the deployment metrics route). Switched off, this is still a 200 with enabled false and no other field. The switch is read before the API key refusal and the ownership check, so a valid API key and any id also get that 200.




## OpenAPI

````yaml /openapi-deploy.yaml get /v1/deployments/{id}/status
openapi: 3.0.3
info:
  title: Comfy Deploy API
  version: 0.1.0
  description: >
    Deploy takes an immutable release cut by Builder and runs it as a live
    autoscaling serverless endpoint.
servers:
  - url: https://platformapi.comfy.org/deploy
    description: Comfy Developer Platform
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /v1/deployments/{id}/status:
    get:
      summary: Read whether a deployment serves, and its last worker sample
      description: >
        Beta. For the workspace's own Metrics tab: the state of the copy the
        deployment serves, the release version it runs, the most workers its
        compute config allows and the last stored worker sample. Reads stored
        state only; it sends no request to a GPU provider or to a metrics store.
        Never cached: the response says `Cache-Control: private, no-store`.


        Refuses an API key with 401, so only a signed-in workspace member reads
        it. Another workspace's deployment, a running copy's own id and an id
        that does not exist all answer 404.


        Can be switched off per workspace (the same switch turns off the
        deployment metrics route). Switched off, this is still a 200 with
        enabled false and no other field. The switch is read before the API key
        refusal and the ownership check, so a valid API key and any id also get
        that 200.
      operationId: getDeploymentStatus
      parameters:
        - $ref: '#/components/parameters/PathID'
      responses:
        '200':
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentStatusAnswer'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/KeyUnverified'
      security:
        - BearerAuth: []
components:
  parameters:
    PathID:
      name: id
      in: path
      required: true
      schema:
        type: string
  schemas:
    DeploymentStatusAnswer:
      description: >
        The status of a deployment, as one of two bodies told apart by enabled:
        the whole status when it is true, and enabled false alone when the
        workspace's kill switch is on.
      oneOf:
        - $ref: '#/components/schemas/DeploymentStatusOff'
        - $ref: '#/components/schemas/DeploymentStatusOn'
    DeploymentStatusOff:
      type: object
      description: >
        Deployment metrics are turned off for the workspace. A client shows no
        status and says nothing about it.
      required:
        - enabled
      properties:
        enabled:
          type: boolean
          enum:
            - false
    DeploymentStatusOn:
      type: object
      required:
        - enabled
        - status
        - releaseVersion
        - maxWorkers
        - serving
      properties:
        enabled:
          type: boolean
          enum:
            - true
        status:
          $ref: '#/components/schemas/DeploymentStatus'
        releaseVersion:
          type: integer
          nullable: true
          description: >-
            The release's number (v1, v2, ...) in its build, for the release the
            serving copy runs; null when that release cannot be read.
        maxWorkers:
          type: integer
          description: >-
            The most workers the serving copy's compute config allows; 1 when it
            stores none.
        serving:
          allOf:
            - $ref: '#/components/schemas/DeploymentStatusServing'
          nullable: true
          description: >-
            The last stored worker sample, as the deployment read's serving
            field holds it, with no age bound: a stopping, stop_failed or
            stopped deployment keeps its last one. Null before the first sample,
            while the deployment holds no compute, on a GPU provider whose
            workers are not sampled, and after a start discards the sample taken
            before it.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable detail.
    DeploymentStatus:
      type: string
      description: >-
        Lifecycle state. unhealthy is a recoverable post-ready state: the
        deployment was serving but its endpoint degraded or vanished, and the
        control plane will move it back to ready if it recovers. stop_failed
        means a stop ran but could not release the compute, so the deployment
        may still be holding (and billing for) its endpoint; it is not terminal,
        and stopping it again retries the release. stopped and failed are
        terminal.
      enum:
        - queued
        - provisioning
        - starting
        - ready
        - unhealthy
        - stopping
        - stop_failed
        - stopped
        - failed
    DeploymentStatusServing:
      type: object
      required:
        - capacity
        - jobsInQueue
        - sampledAt
      properties:
        capacity:
          $ref: '#/components/schemas/WorkerCapacity'
        jobsInQueue:
          type: integer
          description: Jobs accepted by the endpoint and not yet picked up by a worker.
        sampledAt:
          type: string
          format: date-time
          description: When the control plane took this sample.
    WorkerCapacity:
      type: object
      description: >-
        Workers by what they were doing when sampled, in the same words on every
        GPU provider. ready could take a job, busy was running one, starting was
        coming up. A provider that cannot tell a worker still booting from a
        warm one counts it as ready, so ready is an upper bound. These describe
        the sample, not whether the deployment takes jobs: a stopped deployment
        keeps its last sample, and status says whether it serves. A
        scale-to-zero deployment sitting at all-zero is idle, not broken.
      required:
        - ready
        - busy
        - starting
      properties:
        ready:
          type: integer
        busy:
          type: integer
        starting:
          type: integer
  responses:
    Unauthorized:
      description: Missing or invalid token (UNAUTHORIZED)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: >
        Unknown id, or not in the caller's workspace (NOT_FOUND). An API key
        also gets this when its workspace no longer exists or its user is no
        longer a member.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    KeyUnverified:
      description: >
        The request could not be served now (SERVICE_UNAVAILABLE), and the same
        request may succeed if retried. Either a workspace API key could not be
        verified, because the key check gave no answer, or because the service
        was already checking as many keys as it will at once, overall or from
        the caller's address, which carries Retry-After; or the request ran past
        the service's request deadline, 30 seconds by default and 120 for a
        model add, and was cut off; or a model add could not read another
        deployment's storage to check which disk it mounts. The body's message
        says which.
      headers:
        Retry-After:
          description: >
            Seconds to wait before retrying; sent when the service refused the
            key check because too many were in flight.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: A workspace-scoped Cloud JWT.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        A workspace API key, sent alone. The service checks it on every request
        and acts as the key's user in the key's workspace. A request carrying a
        key and a Bearer token is 400, and a value that is not a key's shape is
        401. A refused key answers 401, 403 or 404 with its message; a 503 means
        the key could not be checked right now, so retry.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.