> ## 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.

# Build an additional target for a cut release

> Builds one more target (e.g. linux/amd) for a release that is already cut, reusing the same frozen manifest, so it is the same environment on different hardware. A deleted release takes no more targets and answers 404, the same as a release the workspace does not have. A release whose ComfyUI pin is older than the minimum `/v1/base-images` serves answers 400 `INVALID_DEFINITION`, with `invalid` naming that minimum, for any target that would start a build (new, failed, queued or building), since such a build fails its test step; a target already built still answers 409.




## OpenAPI

````yaml /openapi-builder.yaml post /v1/releases/{id}/artifacts
openapi: 3.0.3
info:
  title: Comfy Builder API
  version: 0.1.0
  description: >
    Builder owns builds (editable environment definitions) and cuts immutable,
    deployable releases that Deploy later runs.
servers:
  - url: https://platformapi.comfy.org/builder
    description: Comfy Developer Platform
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /v1/releases/{id}/artifacts:
    post:
      summary: Build an additional target for a cut release
      description: >
        Builds one more target (e.g. linux/amd) for a release that is already
        cut, reusing the same frozen manifest, so it is the same environment on
        different hardware. A deleted release takes no more targets and answers
        404, the same as a release the workspace does not have. A release whose
        ComfyUI pin is older than the minimum `/v1/base-images` serves answers
        400 `INVALID_DEFINITION`, with `invalid` naming that minimum, for any
        target that would start a build (new, failed, queued or building), since
        such a build fails its test step; a target already built still answers
        409.
      operationId: addBuildArtifact
      parameters:
        - $ref: '#/components/parameters/PathID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddArtifactRequest'
      responses:
        '202':
          description: Accepted; poll statusUrl.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddArtifactResult'
        '400':
          description: >
            INVALID_TARGET for a missing body or a target this release cannot
            build; INVALID_DEFINITION for a release whose definition a new build
            would refuse. Either names each problem in invalid and the first in
            message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddArtifactError'
        '402':
          $ref: '#/components/responses/SubscriptionRequired'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: That target is already built.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    PathID:
      name: id
      in: path
      required: true
      schema:
        type: string
  schemas:
    AddArtifactRequest:
      type: object
      required:
        - target
      properties:
        target:
          $ref: '#/components/schemas/Target'
    AddArtifactResult:
      type: object
      required:
        - artifactId
        - status
        - statusUrl
      properties:
        artifactId:
          type: string
        status:
          $ref: '#/components/schemas/ReleaseStatus'
        statusUrl:
          type: string
    AddArtifactError:
      type: object
      description: >
        The 400 body of adding a target: the Error fields, plus each problem
        with the target or with the release's definition.
      required:
        - error
      properties:
        error:
          type: string
          description: INVALID_TARGET or INVALID_DEFINITION.
        message:
          type: string
          description: The first problem, as its field then its reason.
        invalid:
          type: array
          description: One entry per problem.
          items:
            $ref: '#/components/schemas/ValidationIssue'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable detail.
    Target:
      type: object
      required:
        - os
        - gpu
      properties:
        os:
          type: string
          enum:
            - linux
            - windows
            - mac
        gpu:
          type: string
          enum:
            - nvidia
            - amd
            - cpu
            - mps
        accelVariant:
          type: string
          readOnly: true
          description: >
            Accelerator build variant, e.g. cu128. Part of the target identity.
            Server-derived from the gpu and the release's base image: exactly
            one variant is valid per pair, so a value sent on a request is
            IGNORED. Present on responses to report what was built.
    ReleaseStatus:
      type: string
      description: >
        Closed enum for a release's build lifecycle: queued (nothing started),
        building (a target is in flight), stopping (a target is stopping),
        stopped (all targets are terminal and some stopped), complete (all
        targets are terminal and none stopped). It says only whether the build
        is DONE, not whether it succeeded or is deployable. A complete release
        may have built all, some, or none of its targets; see artifactCounts and
        deployable. Adding or retrying a target reopens it to building.
      enum:
        - queued
        - building
        - complete
        - stopping
        - stopped
    ValidationIssue:
      type: object
      required:
        - field
        - reason
      properties:
        field:
          type: string
        reason:
          type: string
    PaymentRequiredError:
      type: object
      description: >
        A 402 body. error is always PAYMENT_REQUIRED; reason says which gate
        refused. This service refuses only a workspace an operator blocked, so
        every 402 it sends carries spend_blocked -- the enum matches the deploy
        API's so one client can branch on one vocabulary across both.
      required:
        - error
        - reason
      properties:
        error:
          type: string
          description: Machine-readable error code. Always PAYMENT_REQUIRED.
        message:
          type: string
          description: Human-readable detail.
        reason:
          type: string
          description: >
            no_credit_balance: the workspace has neither an active subscription
            nor a positive credit balance, so subscribing or topping up clears
            it. No longer sent by this service. spend_blocked: an operator
            blocked this workspace, which topping up does not clear.
          enum:
            - no_credit_balance
            - spend_blocked
  responses:
    SubscriptionRequired:
      description: >
        An operator blocked the workspace (PAYMENT_REQUIRED, reason
        spend_blocked). A workspace with no credit is not refused here; it is
        held to the Standard plan's caps and asked for credit when it deploys.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentRequiredError'
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        A workspace-scoped Cloud JWT. A missing or invalid token is 401
        UNAUTHORIZED in the Error body.
    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 INVALID_REQUEST, and a value that is not a
        key's shape is 401 UNAUTHORIZED. A refused key answers 401
        (UNAUTHORIZED), 403 (FORBIDDEN), 404 (NOT_FOUND) or 429 (RATE_LIMITED)
        with its message and Retry-After; a 503 (SERVICE_UNAVAILABLE) means the
        key could not be checked right now, so retry. Each refusal answers the
        Error body.

````

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