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

# Get a scoped upload URL for private content

> Private custom nodes and private models upload the same way: ask for a scoped upload URL, then PUT the bytes straight to GCS so the file never passes through Builder. The returned blobId is referenced from the definition.
A request with `reuse: true` may instead be answered with a blob the workspace already holds for these exact bytes and no upload URL; see BlobUpload.deduplicated. Without it every request mints a fresh upload, which is also how a client replaces a blob whose stored bytes turned out wrong: ask again without `reuse` and upload to the fresh address.
A request with `parts: true` is answered with one link per piece instead of one uploadUrl (see BlobUpload.parts). The client PUTs each piece, asks POST /v1/blobs/{id}/parts for fresh links to the pieces not landed when the first ones expire, and calls POST /v1/blobs/{id}/complete once every piece is in, which joins them into the one object a one-PUT upload leaves.




## OpenAPI

````yaml /openapi-builder.yaml post /v1/blobs
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/blobs:
    post:
      summary: Get a scoped upload URL for private content
      description: >
        Private custom nodes and private models upload the same way: ask for a
        scoped upload URL, then PUT the bytes straight to GCS so the file never
        passes through Builder. The returned blobId is referenced from the
        definition.

        A request with `reuse: true` may instead be answered with a blob the
        workspace already holds for these exact bytes and no upload URL; see
        BlobUpload.deduplicated. Without it every request mints a fresh upload,
        which is also how a client replaces a blob whose stored bytes turned out
        wrong: ask again without `reuse` and upload to the fresh address.

        A request with `parts: true` is answered with one link per piece instead
        of one uploadUrl (see BlobUpload.parts). The client PUTs each piece,
        asks POST /v1/blobs/{id}/parts for fresh links to the pieces not landed
        when the first ones expire, and calls POST /v1/blobs/{id}/complete once
        every piece is in, which joins them into the one object a one-PUT upload
        leaves.
      operationId: createBlobUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBlobRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlobUpload'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    CreateBlobRequest:
      type: object
      required:
        - kind
        - filename
        - sizeBytes
        - sha256
      properties:
        kind:
          type: string
          enum:
            - node_zip
            - model
        filename:
          type: string
        sizeBytes:
          type: integer
          format: int64
          description: >
            Size of the file in bytes. A node_zip can be at most 2 GiB
            (2147483648 bytes), the most a build installs; a larger one answers
            400.
        sha256:
          type: string
        blake3:
          type: string
          description: >
            Optional BLAKE3 digest of the same bytes, 64 hex characters. Sealed
            into the release manifest beside sha256, so a deploy can verify the
            staged file with whichever hash it holds.
        reuse:
          type: boolean
          default: false
          description: >
            True lets the answer be a blob the workspace already holds for these
            exact bytes, with `deduplicated: true` and no uploadUrl; a client
            that sends it must branch on `deduplicated`. Absent or false, the
            answer is always a fresh upload (one uploadUrl, or `parts` when
            parts is true), whatever the workspace holds, which is what a client
            written before this field expects and how a client replaces a held
            blob whose stored bytes are wrong.
        parts:
          type: boolean
          default: false
          description: >
            True asks for the upload in pieces: the answer carries `parts`, one
            link per piece, and no uploadUrl. sizeBytes is split into at most 32
            pieces of at least 64 MiB each (one piece below 128 MiB), and may be
            at most 128 GiB (137438953472 bytes); a larger one answers 400.
            Re-use applies first, as without it: a deduplicated answer has no
            pieces. Absent or false, the answer is one uploadUrl, as before this
            field.
    BlobUpload:
      type: object
      required:
        - blobId
        - deduplicated
      properties:
        blobId:
          type: string
          description: Random, workspace-scoped id referenced from the definition.
        deduplicated:
          type: boolean
          description: >
            True when the request said `reuse: true` and this workspace already
            held these exact bytes (same kind, filename, sha256, size and
            blake3): blobId names the blob it already has, uploadUrl and
            expiresAt are absent, and the client must transfer nothing. False on
            every fresh mint, and always false for a request that did not ask to
            reuse. A fresh mint carries uploadUrl and expiresAt, or parts in
            their place when the request said `parts: true`.

            Branch on this rather than on uploadUrl being absent. A presigned
            PUT is signed create-only, so replaying an old one against content
            that already exists fails rather than harmlessly re-uploading.
        uploadUrl:
          type: string
          description: >-
            Presigned PUT; size-locked and no-overwrite. The PUT must send the
            header `x-goog-if-generation-match: 0`. The link is signed with that
            header, so a PUT without it is refused. Present unless deduplicated
            is true, which only a request with `reuse: true` can get, or the
            request said `parts: true`.
        expiresAt:
          type: string
          format: date-time
          description: When uploadUrl stops being accepted. Absent with it.
        parts:
          type: array
          description: >
            Present only when the request said `parts: true` and the answer is
            not deduplicated: one link per piece, in order. PUT each piece's
            bytes to its link with the header `x-goog-if-generation-match: 0`,
            then call POST /v1/blobs/{id}/complete.
          items:
            $ref: '#/components/schemas/BlobUploadPart'
    BlobUploadPart:
      type: object
      required:
        - partNumber
        - offsetBytes
        - sizeBytes
        - uploadUrl
        - expiresAt
      properties:
        partNumber:
          type: integer
          description: The piece's place in the file, from 1.
        offsetBytes:
          type: integer
          format: int64
          description: Where the piece starts in the file.
        sizeBytes:
          type: integer
          format: int64
          description: The piece's length; the link refuses a body of any other length.
        uploadUrl:
          type: string
          description: >-
            Presigned PUT for this piece; size-locked and no-overwrite. The PUT
            must send the header `x-goog-if-generation-match: 0`. The link is
            signed with that header, so a PUT without it is refused.
        expiresAt:
          type: string
          format: date-time
          description: When uploadUrl stops being accepted.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable detail.
  responses:
    BadRequest:
      description: Invalid request
      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.