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

# Transform an asset

> Makes a free Derived copy of an asset from a recipe: a frame from a video, or a cropped, resized or converted image, or a trimmed, cropped, despilled, LUT-graded, resized or converted video. The work runs in the background, so this returns a run; its output's asset is the copy. It needs `runs:read` as well as `runs:create`, because it returns the run. Send `Prefer: wait=N` to hold the response until it ends. Your earlier run of the same recipe on this asset for the same destination returns with `reused` true instead of running again, unless it failed. New runs count toward the running caps. A test key can't transform assets.

Needs the `runs:create` and `runs:read` scopes.



## OpenAPI

````yaml /openapi.json post /assets/{assetId}/transform
openapi: 3.1.0
info:
  title: ZeroGen API
  version: v1
  description: >-
    Generate images and video with every model in ZeroGen from your own servers.
    Generated from the API's contracts by `npm run openapi` in apps/web; do not
    edit by hand.
servers:
  - url: https://api.zerogen.com/v1
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The calling key and the organization's balance.
  - name: Models
    description: The models an organization can run and their schemas.
  - name: Runs
    description: Quote, create, read, list and cancel runs.
  - name: Uploads
    description: Upload files into the Library to use as inputs.
  - name: Projects
    description: The organization's projects.
  - name: Assets
    description: >-
      Search and read Library assets, their lineage and their folders; download
      their files; rename and favorite them; make Derived copies.
  - name: LUTs
    description: The organization's LUTs, for a transform recipe.
  - name: Folders
    description: >-
      A project's folders: create, rename and move them, and add, move and
      remove their assets.
  - name: Labels
    description: 'Organization labels: manage them, and add them to assets or remove them.'
  - name: Naming presets
    description: A project's shared naming presets, for naming a run's outputs.
  - name: Skills
    description: The skills available to the key's owner.
paths:
  /assets/{assetId}/transform:
    post:
      tags:
        - Assets
      summary: Transform an asset
      description: >-
        Makes a free Derived copy of an asset from a recipe: a frame from a
        video, or a cropped, resized or converted image, or a trimmed, cropped,
        despilled, LUT-graded, resized or converted video. The work runs in the
        background, so this returns a run; its output's asset is the copy. It
        needs `runs:read` as well as `runs:create`, because it returns the run.
        Send `Prefer: wait=N` to hold the response until it ends. Your earlier
        run of the same recipe on this asset for the same destination returns
        with `reused` true instead of running again, unless it failed. New runs
        count toward the running caps. A test key can't transform assets.


        Needs the `runs:create` and `runs:read` scopes.
      operationId: transformAsset
      parameters:
        - name: assetId
          in: path
          required: true
          description: The asset's ID
          schema:
            type: string
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/Prefer'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransformAssetRequest'
            example:
              recipe:
                trim:
                  startSeconds: 0
                  endSeconds: 5
                resize:
                  maxEdge: 1280
      responses:
        '200':
          description: The run has ended, within the requested wait, or had already ended.
          headers:
            Request-Id:
              $ref: '#/components/headers/Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Location:
              $ref: '#/components/headers/Location'
            Preference-Applied:
              $ref: '#/components/headers/Preference-Applied'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransformRun'
        '202':
          description: The run has not ended yet.
          headers:
            Request-Id:
              $ref: '#/components/headers/Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
            Location:
              $ref: '#/components/headers/Location'
            Preference-Applied:
              $ref: '#/components/headers/Preference-Applied'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransformRun'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Makes retries safe: a retry with the same key and body returns the first
        response for 24 hours instead of repeating the work. Reusing a key with
        a different body returns 409.
      schema:
        type: string
        minLength: 1
        maxLength: 255
        pattern: ^[\x21-\x7e]+$
    Prefer:
      name: Prefer
      in: header
      required: false
      description: >-
        wait=N holds the response up to N seconds (at most 60) until the run
        ends.
      schema:
        type: string
        pattern: ^wait=\d+$
        example: wait=30
  schemas:
    TransformAssetRequest:
      type: object
      properties:
        recipe:
          anyOf:
            - type: object
              properties:
                extractFrame:
                  type: object
                  properties:
                    timeSeconds:
                      type: number
                      minimum: 0
                      description: >-
                        Where to take the frame, in seconds from the start of
                        the video
                  required:
                    - timeSeconds
                  additionalProperties: false
              required:
                - extractFrame
              additionalProperties: false
              description: Take one full-resolution frame from a video as a PNG.
            - type: object
              properties:
                crop:
                  description: >-
                    Keep this area of the upright image, within its width and
                    height
                  type: object
                  properties:
                    x:
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                      description: Pixels from the picture's left edge to the area's
                    'y':
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                      description: Pixels from the picture's top edge to the area's
                    width:
                      type: integer
                      minimum: 1
                      maximum: 9007199254740991
                      description: The area's width, in pixels
                    height:
                      type: integer
                      minimum: 1
                      maximum: 9007199254740991
                      description: The area's height, in pixels
                  required:
                    - x
                    - 'y'
                    - width
                    - height
                  additionalProperties: false
                resize:
                  type: object
                  properties:
                    maxEdge:
                      type: integer
                      minimum: 1
                      maximum: 16384
                      description: >-
                        Scale down proportionally so the longest edge is at most
                        this many pixels; never enlarges
                  required:
                    - maxEdge
                  additionalProperties: false
                convert:
                  type: object
                  properties:
                    format:
                      type: string
                      enum:
                        - png
                        - jpeg
                        - webp
                    quality:
                      description: >-
                        jpeg and webp only; default 90. An image already in the
                        asked format that needs no resize is copied unchanged,
                        so quality applies only when it is re-encoded
                      type: integer
                      minimum: 1
                      maximum: 100
                    background:
                      description: >-
                        jpeg only: the color that replaces transparency, such as
                        #ffffff
                      type: string
                      pattern: ^#[0-9a-f]{6}$
                  required:
                    - format
                  additionalProperties: false
              additionalProperties: false
              description: >-
                Crop a still image, downscale it, convert it to PNG, JPEG or
                WebP, or a combination, in that order. Colors become sRGB and
                embedded metadata is removed.
              anyOf:
                - required:
                    - crop
                - required:
                    - resize
                - required:
                    - convert
            - type: object
              properties:
                trim:
                  type: object
                  properties:
                    startSeconds:
                      type: number
                      minimum: 0
                      description: Where the copy starts, in seconds
                    endSeconds:
                      type: number
                      exclusiveMinimum: 0
                      description: >-
                        Where it ends, in seconds; at most 30 after startSeconds
                        and within the video
                  required:
                    - startSeconds
                    - endSeconds
                  additionalProperties: false
                crop:
                  description: >-
                    Keep this area of the upright picture, within its width and
                    height. Each number rounds down to an even one, which video
                    needs
                  type: object
                  properties:
                    x:
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                      description: Pixels from the picture's left edge to the area's
                    'y':
                      type: integer
                      minimum: 0
                      maximum: 9007199254740991
                      description: Pixels from the picture's top edge to the area's
                    width:
                      type: integer
                      minimum: 1
                      maximum: 9007199254740991
                      description: The area's width, in pixels
                    height:
                      type: integer
                      minimum: 1
                      maximum: 9007199254740991
                      description: The area's height, in pixels
                  required:
                    - x
                    - 'y'
                    - width
                    - height
                  additionalProperties: false
                inputColor:
                  description: >-
                    What the footage is, which its metadata can't tell, so ask
                    rather than guess. With it, adjust's exposure, temperature
                    and tint run before any LUT on its curve and gamut, which
                    can recover what the LUT would clip; without it, after
                  type: string
                  enum:
                    - rec709
                    - slog3-sgamut3cine
                    - slog3-sgamut3
                    - apple-log
                    - logc3
                    - logc4
                    - vlog
                    - clog2
                    - clog3
                    - bmd-film
                despill:
                  description: >-
                    Remove screen-colored spill from a green- or blue-screen
                    shot, before any LUT. It changes every pixel of that color,
                    so use it only on screen footage. The screen stays, turned
                    neutral; this does not key it out
                  type: object
                  properties:
                    screen:
                      type: string
                      enum:
                        - green
                        - blue
                      description: The screen color to remove from the subject
                  required:
                    - screen
                  additionalProperties: false
                lut:
                  description: >-
                    Apply a LUT. Use one whose inputColor matches the footage: a
                    log LUT on Rec.709 footage looks wrong, and footage metadata
                    can't tell. The copy is tagged Rec.709
                  type: object
                  properties:
                    lutId:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      description: A LUT from this organization
                    strength:
                      description: How much of the LUT to apply, as a percent; default 100
                      type: integer
                      minimum: 1
                      maximum: 100
                  required:
                    - lutId
                  additionalProperties: false
                adjust:
                  description: >-
                    Basic color correction, after any LUT, so it trims what the
                    LUT gave. Each is a whole number from -100 to 100; 0 changes
                    nothing
                  type: object
                  properties:
                    exposure:
                      description: >-
                        -100 is two stops darker, 100 two stops brighter;
                        highlights can clip
                      type: integer
                      minimum: -100
                      maximum: 100
                    brightness:
                      description: Moves the midtones; black and white stay where they are
                      type: integer
                      minimum: -100
                      maximum: 100
                    contrast:
                      description: '-100 halves the contrast around mid gray, 100 doubles it'
                      type: integer
                      minimum: -100
                      maximum: 100
                    saturation:
                      description: '-100 is black and white, 100 doubles the saturation'
                      type: integer
                      minimum: -100
                      maximum: 100
                    temperature:
                      description: Below 0 is cooler, above 0 warmer
                      type: integer
                      minimum: -100
                      maximum: 100
                    tint:
                      description: Below 0 is greener, above 0 more magenta
                      type: integer
                      minimum: -100
                      maximum: 100
                  additionalProperties: false
                resize:
                  type: object
                  properties:
                    maxEdge:
                      type: integer
                      minimum: 16
                      maximum: 4096
                      description: >-
                        Scale down proportionally so the longest edge is at most
                        this many pixels; never enlarges
                  required:
                    - maxEdge
                  additionalProperties: false
                convert:
                  type: object
                  properties:
                    format:
                      type: string
                      enum:
                        - mp4
                        - mov
                      description: >-
                        mp4: H.264 8-bit 4:2:0, which every model and browser
                        takes. mov: HEVC that keeps the source's 10-bit depth,
                        4:4:4 chroma, HDR and frame rate, for editing rather
                        than as a model reference
                  required:
                    - format
                  additionalProperties: false
              additionalProperties: false
              description: >-
                Trim a video, crop it, despill it, apply a LUT, adjust its
                color, downscale it, or convert it, in that order, to a copy of
                at most 30 seconds, an MP4 unless convert says mov. An MP4 makes
                ProRes, 4:4:4 and HDR sources 8-bit SDR 4:2:0 and brings frame
                rates within 24 to 60. Despill, a LUT and adjust refuse an HDR
                source; convert it to MP4 first and use that copy.
              anyOf:
                - required:
                    - trim
                - required:
                    - crop
                - required:
                    - despill
                - required:
                    - lut
                - required:
                    - adjust
                - required:
                    - resize
                - required:
                    - convert
        projectId:
          type: string
          pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          description: >-
            The project the copy goes into; the source asset's project when
            omitted
        folderId:
          anyOf:
            - type: string
              pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            - type: 'null'
          description: >-
            A folder in that project to also add the copy to; null or omitted
            for Unfiled
      required:
        - recipe
      additionalProperties: false
    TransformRun:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
          description: The project that holds the outputs
        model:
          anyOf:
            - type: string
              maxLength: 200
              pattern: >-
                ^[a-z0-9]+(?:[.-][a-z0-9]+)*\/[a-z0-9]+(?:[.-][a-z0-9]+)*\/[a-z0-9]+(?:[.-][a-z0-9]+)*$
            - type: 'null'
        modelVersion:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - partial
            - failed
            - cancelled
        outputs:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              status:
                type: string
                enum:
                  - queued
                  - running
                  - succeeded
                  - failed
                  - cancelled
              asset:
                anyOf:
                  - type: object
                    properties:
                      id:
                        type: string
                      mimeType:
                        type: string
                      width:
                        anyOf:
                          - type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          - type: 'null'
                      height:
                        anyOf:
                          - type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          - type: 'null'
                      durationMs:
                        anyOf:
                          - type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          - type: 'null'
                      resourceUri:
                        type: string
                        description: >-
                          Where this transport's client reads the asset, such as
                          an MCP resource
                      preview:
                        anyOf:
                          - $ref: '#/components/schemas/AssetPreview'
                          - type: 'null'
                        description: >-
                          The asset's previews, or null until they're made after
                          the asset is ready, and for assets with none, such as
                          audio
                    required:
                      - id
                      - mimeType
                      - width
                      - height
                      - durationMs
                      - preview
                    additionalProperties: false
                  - type: 'null'
              error:
                anyOf:
                  - $ref: '#/components/schemas/Error'
                  - type: 'null'
              warnings:
                type: array
                items:
                  type: object
                  properties:
                    code:
                      type: string
                    message:
                      type: string
                  required:
                    - code
                    - message
                  additionalProperties: false
                description: What the provider ignored, such as an unused reference
              draft:
                type: object
                properties:
                  expiresAt:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                    description: When upscaling this output closes
                  upscalable:
                    type: boolean
                    description: >-
                      A final can be requested now: unexpired, with no final in
                      progress
                  upscale:
                    anyOf:
                      - type: string
                        enum:
                          - upscaling
                          - upscaled
                      - type: 'null'
                    description: The newest final's state, or null when none was requested
                  finalResolution:
                    type: string
                    description: >-
                      That final's resolution, one the model's draft control
                      lists
                  finalAssetId:
                    type: string
                    description: The newest finished final's asset
                required:
                  - expiresAt
                  - upscalable
                  - upscale
                additionalProperties: false
                description: >-
                  A 480p Draft output; upscaling it makes a final with the same
                  seed, at a resolution the model's draft control lists
            required:
              - index
              - status
              - asset
              - error
            additionalProperties: false
        error:
          anyOf:
            - $ref: '#/components/schemas/Error'
            - type: 'null'
        billing:
          type: object
          properties:
            mode:
              type: string
              enum:
                - platform
                - byok
                - test
            state:
              anyOf:
                - type: string
                  enum:
                    - held
                    - charged
                    - released
                - type: 'null'
              description: >-
                held: an amount is reserved and nothing is charged yet; charged:
                chargedMicroUsd is the final charge; released: the hold ended
                with no charge; null: billing never admitted the run, so nothing
                was held or charged
            hold:
              type: object
              properties:
                state:
                  type: string
                  enum:
                    - running
                    - ended
                    - needs_attention
                  description: >-
                    running: the run has not ended; ended: it ended and the hold
                    is still pending; needs_attention: it has stayed pending 30
                    minutes after ending, or 24 hours after admission with no
                    end recorded (endedAt then stays null), so ZeroGen is
                    looking into it
                endedAt:
                  anyOf:
                    - type: string
                      format: date-time
                      pattern: >-
                        ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                    - type: 'null'
                  description: >-
                    When the run ended; null while it runs or when no end was
                    recorded
              required:
                - state
                - endedAt
              additionalProperties: false
              description: >-
                While held, where the run stands. It reports facts, not what
                settlement will do
            quotedMicroUsd:
              anyOf:
                - type: integer
                  minimum: 0
                  maximum: 9007199254740991
                - type: 'null'
              description: Reserved maximum expected charge
            heldMicroUsd:
              anyOf:
                - type: integer
                  minimum: 0
                  maximum: 9007199254740991
                - type: 'null'
              description: While held, the amount reserved now; it is never a charge
            chargedMicroUsd:
              anyOf:
                - type: integer
                  minimum: 0
                  maximum: 9007199254740991
                - type: 'null'
              description: >-
                The final charge once charged, zero once released; it can rarely
                exceed the quote
          required:
            - mode
            - state
            - quotedMicroUsd
            - heldMicroUsd
            - chargedMicroUsd
          additionalProperties: false
        createdBy:
          anyOf:
            - $ref: '#/components/schemas/Creator'
            - type: 'null'
          description: Who made it; null when ZeroGen recorded no one
        createdVia:
          anyOf:
            - type: string
              enum:
                - web
                - agent
                - mcp
                - api
            - type: 'null'
          description: >-
            Where it was made: web (the ZeroGen app), agent (ZeroGen's Agent),
            mcp (an MCP client) or api (an API key); null with createdBy
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
        startedAt:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
            - type: 'null'
        finishedAt:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
            - type: 'null'
        webUrl:
          description: >-
            Opens Generate's review of the run's first ready output in ZeroGen,
            on your organization's host, after sign-in. null until an output is
            ready, and for test keys. It can change until the run ends
          type:
            - string
            - 'null'
        reused:
          type: boolean
          description: >-
            True when this is your earlier run of the same recipe on this asset
            for the same destination, finished or in progress, so no new work
            started
      required:
        - id
        - projectId
        - model
        - modelVersion
        - status
        - outputs
        - error
        - billing
        - createdBy
        - createdVia
        - createdAt
        - startedAt
        - finishedAt
        - webUrl
        - reused
      additionalProperties: false
    AssetPreview:
      type: object
      properties:
        image96Url:
          type: string
          description: A WebP image up to 96 pixels wide
        image512Url:
          type: string
          description: A WebP image up to 512 pixels wide
        videoUrl:
          description: >-
            For a video, a silent WebM clip of its first six seconds, up to
            854×480; null for other assets and until it's made
          type:
            - string
            - 'null'
        expiresAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
          description: When the URLs stop loading; read the asset or run again for new ones
      required:
        - image96Url
        - image512Url
        - videoUrl
        - expiresAt
      additionalProperties: false
      description: >-
        Signed storage URLs for the asset's previews. Load them without your API
        key; anyone holding them can load the previews until expiresAt.
    Error:
      type: object
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,79}$
        message:
          type: string
        param:
          type: string
        retryable:
          type: boolean
        details:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
        - retryable
      additionalProperties: false
    Creator:
      type: object
      properties:
        id:
          type: string
          description: The user's ID, as GET /v1/me returns the key's own
        name:
          description: The name the person gave ZeroGen, or null; never an email address
          type:
            - string
            - 'null'
      required:
        - id
        - name
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
      additionalProperties: false
  headers:
    Request-Id:
      description: Identifies the request; quote it when contacting support.
      schema:
        type: string
    RateLimit-Limit:
      description: Requests the key may make in the current window.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the current window resets.
      schema:
        type: integer
    Idempotent-Replayed:
      description: >-
        true when this response replays an earlier request with the same
        Idempotency-Key.
      schema:
        type: string
        enum:
          - 'true'
    Location:
      description: Where to read the created resource.
      schema:
        type: string
    Preference-Applied:
      description: The wait applied, such as wait=30.
      schema:
        type: string
    WWW-Authenticate:
      description: Bearer realm="ZeroGen API".
      schema:
        type: string
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    BadRequest:
      description: >-
        The request is malformed or invalid: invalid_request, validation_failed,
        model_unavailable or input_import_failed.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: 'invalid_api_key: the key is missing, revoked or expired.'
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >-
        permission_denied: the key lacks the scope this endpoint needs, the
        request came from a browser, or the API isn't enabled for the
        organization.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: >-
        not_found: no such resource for this caller, including a projectId the
        caller can't use.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: >-
        idempotency_conflict: the Idempotency-Key was used for a different
        request. idempotency_in_progress: the first request with this key hasn't
        finished. invalid_state: the request can't go ahead as things stand,
        such as a run that needs a person's approval in ZeroGen.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PayloadTooLarge:
      description: >-
        The request body is larger than this endpoint's limit: 128 KiB by
        default, or 512 KiB for `POST /uploads` and `POST
        /assets/{assetId}/declaration`.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnsupportedMediaType:
      description: Send the body as application/json.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: >-
        rate_limited: the key or its owner is over the rate limit, or the
        organization is at its running cap. Retry after Retry-After seconds.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: 'internal: something went wrong. Retry.'
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: >-
        unavailable or pricing_unavailable: API keys, billing or pricing can't
        be reached right now. Retry.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.'

````

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