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

# Create a video

> Generates a Viggle H3 video (a tuned version of MiniMax H3) with
native audio, or a Viggle Remake video on a separate backend. `multipart/form-data` for every mode;
Remake mode also accepts a plain `application/json`
body. The fields supplied select one of five generation modes:

- Neither frame field nor any reference or Remake
  field supplied: text-to-video from `prompt` alone.
- `first_frame_image`/`first_frame_image_url` supplied, no last
  frame: first-frame-to-video.
- Both a first frame and a last frame supplied: first+last-frame-to-video.
- Any of `reference_video`/`reference_video_url`/`reference_image`/
  `reference_image_url` supplied: reference-video (omni-reference)
  generation, carrying the subject/style of a reference video and/or
  up to 6 reference images into the new video. Mutually exclusive
  with the frame fields.
- `driving_video`/`driving_video_url` and/or `character_image`/
  `character_image_url`/`character_image_urls` supplied:
  Viggle Remake. Send a driving video and character images; a request
  without a driving video is rejected with `400 INVALID_REQUEST`. Image
  usage depends on `enhance_mode` and ordered target tags (see
  `CreateVideoForm`). Mutually exclusive with every field above,
  including `quality`. See the Viggle Remake guide.

`quality=low` generates faster for quicker iteration; `quality=high`
produces higher-fidelity output; `quality=ultrafast` is the fastest
tier, at `480p` or `768p` only, with its own price. `low` and `high`
are billed at the same price; `resolution` and `enhance` set it — see
`CreateVideoForm` below. Remake mode has no `quality`
tier and is billed by `enhance_mode` on the driving video's
duration, rounded up, instead.

All five modes answer `200` with the same minimal acceptance shape;
poll `GET /v1/videos/{video_id}` for the final result.

Insufficient credits: Viggle Remake answers `402` at creation. A
Viggle H3 request is accepted (`queued`) and then fails with
`INSUFFICIENT_CREDITS`. `429 RATE_LIMITED` applies to Remake only,
when the credit-reservation gate is busy; retry with backoff.

Videos are visible only to the API key that created them. Result
files are deleted 24 hours after the job finishes; `video_url` is
signed for 1 hour and re-signed on every read.



## OpenAPI

````yaml /openapi.yaml post /v1/videos
openapi: 3.0.3
info:
  title: Viggle API
  description: >
    The Viggle API generates AI video (Viggle H3, Viggle Remake, Video

    Remix), images (Viggle Image), 2x video upscaling (FlashVSR), and JST-2

    3D characters, motions, and scenes. Every job is asynchronous: create it,

    then poll (or, for renders, watch) until it reaches a terminal status.


    Base URL: `https://apis.viggle.ai`. Authenticate every request with

    `Authorization: Bearer <API key>`. Usage is billed in credits

    (1 credit = $0.01). Guides and pricing:
    https://docs.viggle.ai/v1/introduction
  version: 2.0.0
  contact:
    name: Viggle Support
    url: https://viggle.ai
servers:
  - url: https://apis.viggle.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Renders
    description: >-
      Video Remix (JST-1). Prepare inputs, create renders, watch progress,
      cancel, and download results. Read render status through `GET
      /v1/videos/{video_id}`.
  - name: Credits
    description: Read the credit balance available to the calling API key.
  - name: Characters
    description: |
      Create, list, inspect, and delete reusable character assets. `type`
      selects whether creation also extracts a 3D vsplat; export its
      download URL separately once ready.
  - name: Motions
    description: |
      Create, list, inspect, and delete reusable motion assets, and import one
      from an official motion template. `type` selects whether creation also
      extracts or generates a 3D animation; export its download URL
      separately once ready.
  - name: Videos
    description: |
      Generate a Viggle H3 video from text, frames, or references (`vid_`
      prefix) or a Viggle Remake video from a driving video and character
      images (`anim_` prefix), upscale a video 2x with FlashVSR (`vsr_`
      prefix), and read the unified view over every video the calling API
      key created — H3 generations, Remake generations, and Video Remix
      renders (`render_` prefix) — merged into one resource.
  - name: Images
    description: |
      Viggle Image — generate 1–6 PNG images from a text prompt,
      optionally guided by up to 8 reference images
      (`img_` prefix), and retrieve them by ID.
  - name: Scenes
    description: |
      Scene model — build a 3D Gaussian-splat scene (`.spz`) from a text
      prompt or a 360° panorama, generate new posed views of it, and
      reconstruct it from those views. Every operation is an asynchronous
      task (`scn_` prefix) read back by ID. Every run costs 1 credit per
      view, and a panorama counts as 6 views. Credits are refunded in full
      unless the task finishes `ready`.
paths:
  /v1/videos:
    post:
      tags:
        - Videos
      summary: Create a video
      description: >-
        Generates a Viggle H3 video (a tuned version of MiniMax H3) with

        native audio, or a Viggle Remake video on a separate backend.
        `multipart/form-data` for every mode;

        Remake mode also accepts a plain `application/json`

        body. The fields supplied select one of five generation modes:


        - Neither frame field nor any reference or Remake
          field supplied: text-to-video from `prompt` alone.
        - `first_frame_image`/`first_frame_image_url` supplied, no last
          frame: first-frame-to-video.
        - Both a first frame and a last frame supplied:
        first+last-frame-to-video.

        - Any of `reference_video`/`reference_video_url`/`reference_image`/
          `reference_image_url` supplied: reference-video (omni-reference)
          generation, carrying the subject/style of a reference video and/or
          up to 6 reference images into the new video. Mutually exclusive
          with the frame fields.
        - `driving_video`/`driving_video_url` and/or `character_image`/
          `character_image_url`/`character_image_urls` supplied:
          Viggle Remake. Send a driving video and character images; a request
          without a driving video is rejected with `400 INVALID_REQUEST`. Image
          usage depends on `enhance_mode` and ordered target tags (see
          `CreateVideoForm`). Mutually exclusive with every field above,
          including `quality`. See the Viggle Remake guide.

        `quality=low` generates faster for quicker iteration; `quality=high`

        produces higher-fidelity output; `quality=ultrafast` is the fastest

        tier, at `480p` or `768p` only, with its own price. `low` and `high`

        are billed at the same price; `resolution` and `enhance` set it — see

        `CreateVideoForm` below. Remake mode has no `quality`

        tier and is billed by `enhance_mode` on the driving video's

        duration, rounded up, instead.


        All five modes answer `200` with the same minimal acceptance shape;

        poll `GET /v1/videos/{video_id}` for the final result.


        Insufficient credits: Viggle Remake answers `402` at creation. A

        Viggle H3 request is accepted (`queued`) and then fails with

        `INSUFFICIENT_CREDITS`. `429 RATE_LIMITED` applies to Remake only,

        when the credit-reservation gate is busy; retry with backoff.


        Videos are visible only to the API key that created them. Result

        files are deleted 24 hours after the job finishes; `video_url` is

        signed for 1 hour and re-signed on every read.
      operationId: createVideo
      parameters:
        - $ref: '#/components/parameters/RequestId'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateVideoForm'
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRemakeRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateRemakeRequest'
      responses:
        '200':
          description: Video generation accepted and queued.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoCreateResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/V1Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '408':
          $ref: '#/components/responses/UploadTimeout'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    RequestId:
      name: X-Request-Id
      in: header
      required: false
      description: >-
        Optional caller-supplied correlation ID, echoed as sent in the response
        header. Omit it and the service generates one. Use it for tracing and
        support.
      schema:
        type: string
        minLength: 1
  schemas:
    CreateVideoForm:
      description: >-
        Body of `POST /v1/videos`: H3 uses `multipart/form-data`; character

        animation also accepts `application/json` and

        `application/x-www-form-urlencoded`. Which fields are

        supplied selects the generation mode:


        - Neither `first_frame_image`/`first_frame_image_url` nor
          `last_frame_image`/`last_frame_image_url` nor any reference or
          Remake field supplied: text-to-video.
        - A first frame supplied, no last frame: first-frame-to-video.

        - Both a first frame and a last frame supplied:
          first+last-frame-to-video.
        - Any of `reference_video`/`reference_video_url`/
          `reference_image`/`reference_image_url` supplied: reference-video
          (omni-reference) generation.
        - `driving_video`/`driving_video_url` and/or `character_image`/
          `character_image_url`/`character_image_urls` supplied:
          Viggle Remake generation, dispatched to a separate backend
          from the four modes above. Send a driving video and character
          images; image usage depends on `enhance_mode` and target tags as
          described below. It has no `quality` tier, no `duration_s`/`resolution`/
          `aspect_ratio`/`seed`, and `prompt` is optional rather than
          required; see below and the Viggle Remake guide
          (https://docs.viggle.ai/v1/video/remake) for its own fields,
          pricing, and constraints.

        Within a frame slot, supply at most one of the file and the URL

        form. Supplying both `first_frame_image` and `first_frame_image_url`

        (or both `last_frame_image` and `last_frame_image_url`) answers

        `400 INVALID_REQUEST` with "supply only one of first_frame_image or

        first_frame_image_url" (or the `last_frame_*` equivalent). A last

        frame requires a first frame; supplying a last frame with no first

        frame answers `400 INVALID_REQUEST` with "a last frame requires a

        first frame".


        Reference-video mode is selected purely by whether any of the four

        reference fields is present — there is no separate `source`/`mode`

        parameter, and no error if you meant to but forgot: supplying none

        of `reference_video`/`reference_video_url`/`reference_image`/

        `reference_image_url` simply generates text-to-video instead (the

        first bullet above), the same way omitting `first_frame_image`/

        `last_frame_image` falls back to text-to-video rather than

        erroring. `reference_video` and `reference_video_url` are declared

        as arrays for forward compatibility, but at most 1 reference video

        is accepted today; supplying any combination of the two fields that

        adds up to more than 1 (two files, two URLs, or one of each) answers

        `400 INVALID_REQUEST` with "at most 1 reference video(s) allowed".

        `reference_image` and `reference_image_url` may be mixed freely, but

        their combined count cannot exceed 6; going over answers

        `400 INVALID_REQUEST` with "at most 6 reference images are allowed".

        Reference fields cannot be combined with

        `first_frame_image`/`last_frame_image` (file or URL form); doing so

        answers `400 INVALID_REQUEST` with

        "reference_video/reference_image cannot be combined with

        first_frame_image/last_frame_image". The reference video itself

        (independent of `duration_s`, the target duration of the *generated*

        video) must be 0.5–600 seconds long and at least 64x64 with even

        width and height, the same constraints enforced on uploaded video

        elsewhere in this API, and at most 100 MiB whether uploaded or

        fetched from `reference_video_url`.


        Frame and reference images (`first_frame_image`, `last_frame_image`,

        `reference_image`) may be up to 20 MiB each when uploaded, and up to

        30 MiB when fetched from the matching `*_url` field. The format is

        detected from the image bytes — JPEG, PNG, WebP, GIF, BMP, TIFF, or

        HEIC/HEIF/AVIF — and there is no minimum or maximum dimension; an

        image at or above 4K (long edge >= 3840 px or short edge >= 2160 px)

        is downscaled to fit 1920x1080, keeping its aspect ratio. An

        oversized upload answers `400 INVALID_REQUEST` with "invalid or

        oversized first_frame_image upload" (naming the field), an

        undecodable one with "first_frame_image must be a valid image"; a

        URL that can't be decoded answers "first_frame_image_url is not a

        valid image", and an unreadable reference video URL answers

        "reference_video_url is not a valid video".


        Remake mode cannot be combined with quality or H3 frame/reference
        fields. For Remake, supply character images as

        `character_image` uploads or `character_image_url`/

        `character_image_urls` (uploads and URLs cannot be combined in the

        same request).


        Send the driving video as exactly one of `driving_video` (upload)

        or `driving_video_url` (URL). One image replaces one target character.

        Up to 10 images are accepted in every mode. Guidance: in `planner`

        (default) or `normal` mode, replacing 2 or 3 characters works best

        with ordered `<Character1>`, `<Character2>` (and `<Character3>`)

        descriptions in `prompt`, one per image, describing targets in the

        source video; without these tags, expect only the first image to be

        used. In `agent` mode, 1-10 images are used in order as

        Character1..N; tags are optional. The driving video supplies the source
        motion.


        For `planner` and `normal`, use a driving video 5-16 seconds long.

        For `agent`, use 5-60 seconds; `agent` checks duration after

        truncating to whole seconds, so a 60.9-second video counts as 60.

        A video outside its mode's range returns HTTP 400 `INVALID_REQUEST`.

        Both uploads and URLs undergo API media validation with a 100 MiB

        limit. Uploaded videos are staged to object storage; URL-form

        sources are also fetched by the worker.


        Billed per started second of `duration_s`, at a per-second rate set

        by `resolution` alone (1 credit = $0.01): 1 credit at `480p` and

        `768p`, 2 at `1080p`, 3 at `2k`, 5 at `4k`. `enhance` on (the

        default) adds 1 credit per second. The rate is the same in

        every H3 mode; `quality` (`low` or `high`) and `aspect_ratio` do not
        affect price.

        `quality=ultrafast` is billed instead at 2.2 credits per second at

        `480p` or 3 at `768p`, on `ceil(duration_s)` plus the reference

        video's duration rounded up, plus 1.1 (`480p`) or 1.5 (`768p`)

        credits per reference image after the first 5, with the total

        rounded up to a whole credit; `enhance` adds nothing.

        Remake mode is billed by `enhance_mode` instead:

        `planner` 5, `normal` 1 and `agent` 10 credits per second. It

        reserves the driving video's measured duration

        rounded up; on completion the charge is settled against the

        finished video's duration, never above the reservation. It is not

        tied to `duration_s`; see the Viggle Remake guide.


        Every generated video includes native audio; there is no separate

        audio flag or field.
      type: object
      properties:
        prompt:
          type: string
          minLength: 1
          description: >-
            Required for H3 generation. For Remake, planner/normal use ordered
            Character tags for multiple targets; agent reads the editing
            instruction directly. See the Remake path descriptions above.
          example: A paper airplane gliding through a sunlit office
        quality:
          type: string
          enum:
            - low
            - high
            - ultrafast
          description: >-
            Generation quality tier. `low` generates faster, for quicker
            iteration; `high` generates slower but produces higher-fidelity
            output. Both are billed at the same price. `ultrafast` is the
            fastest tier: `480p` or `768p` only, no `watermark`, `enhance` not
            applied, each reference video 2-15 seconds, and its own price (see
            the description above). It answers `503` when the tier is
            temporarily unavailable. Required for every mode except Remake,
            which has no quality tiers and rejects this field outright if
            supplied.
          example: low
        first_frame_image:
          type: string
          format: binary
          description: >-
            First-frame image uploaded directly. Mutually exclusive with
            `first_frame_image_url`. Supplying either switches on
            first-frame-to-video mode. Cannot be combined with any
            `reference_video`/`reference_image` field. Up to 20 MiB; JPEG, PNG,
            WebP, GIF, BMP, TIFF, or HEIC/HEIF/AVIF, detected from the file
            contents. An image with a long edge of 3840 px or more, or a short
            edge of 2160 px or more, is downscaled to fit 1920x1080, keeping its
            aspect ratio.
        first_frame_image_url:
          type: string
          format: uri
          description: >-
            Publicly reachable http(s) URL of the first-frame image, or the
            image inline as a base64 `data:` URI (`data:image/png;base64,…`);
            the service fetches and re-hosts it. Mutually exclusive with
            `first_frame_image`. Cannot be combined with any
            `reference_video`/`reference_image` field. The fetched image may be
            up to 30 MiB, in the same formats and with the same downscaling as
            the upload form.
        last_frame_image:
          type: string
          format: binary
          description: >-
            Last-frame image uploaded directly. Mutually exclusive with
            `last_frame_image_url`. Valid only alongside a first frame. Cannot
            be combined with any `reference_video`/`reference_image` field. Up
            to 20 MiB; JPEG, PNG, WebP, GIF, BMP, TIFF, or HEIC/HEIF/AVIF,
            detected from the file contents. An image with a long edge of 3840
            px or more, or a short edge of 2160 px or more, is downscaled to fit
            1920x1080, keeping its aspect ratio.
        last_frame_image_url:
          type: string
          format: uri
          description: >-
            Publicly reachable http(s) URL of the last-frame image, or a base64
            `data:` URI; the service fetches and re-hosts it. Mutually exclusive
            with `last_frame_image`. Valid only alongside a first frame. Cannot
            be combined with any `reference_video`/`reference_image` field. The
            fetched image may be up to 30 MiB, in the same formats and with the
            same downscaling as the upload form.
        reference_video:
          type: array
          maxItems: 1
          items:
            type: string
            format: binary
          description: >-
            Reference video uploaded directly, for reference-video
            (omni-reference) generation. Declared as an array for forward
            compatibility, but at most 1 is accepted today — combined with
            `reference_video_url`. Not required if at least one reference image
            is supplied instead. Up to 100 MiB, in any container with a readable
            video stream (MP4, MOV, WebM, etc.). Must be 0.5–600 seconds long
            and at least 64x64 with even width/height. Cannot be combined with
            `first_frame_image`/`last_frame_image`.
        reference_video_url:
          type: array
          maxItems: 1
          items:
            type: string
            format: uri
          description: >-
            Publicly reachable http(s) URL of the reference video, or a base64
            `data:` URI; the service fetches and re-hosts it. Declared as an
            array for forward compatibility, but at most 1 is accepted today —
            combined with `reference_video`. Same size, duration, and resolution
            constraints as `reference_video`.
        reference_image:
          type: array
          maxItems: 6
          items:
            type: string
            format: binary
          description: >-
            Reference images uploaded directly, for reference-video
            (omni-reference) generation. Up to 6 total, combined with
            `reference_image_url`. Can be freely mixed with
            `reference_image_url`. Up to 20 MiB; JPEG, PNG, WebP, GIF, BMP,
            TIFF, or HEIC/HEIF/AVIF, detected from the file contents. An image
            with a long edge of 3840 px or more, or a short edge of 2160 px or
            more, is downscaled to fit 1920x1080, keeping its aspect ratio.
        reference_image_url:
          type: array
          maxItems: 6
          items:
            type: string
            format: uri
          description: >-
            Publicly reachable http(s) URLs of reference images, or base64
            `data:` URIs; the service fetches and re-hosts each one. Up to 6
            total, combined with `reference_image`. Can be freely mixed with
            `reference_image`. Each fetched image may be up to 30 MiB, in the
            same formats and with the same downscaling as `reference_image`.
        driving_video:
          type: string
          format: binary
          description: >-
            Source video upload for Remake, at most 100 MiB. Use 5-16 seconds
            for planner/normal, or 5-60 seconds for agent. Cannot be combined
            with driving_video_url.
        driving_video_url:
          type: string
          format: uri
          description: >-
            Source video URL for Remake, under the same limits as driving_video.
            Cannot be combined with driving_video.
        character_image:
          type: array
          maxItems: 10
          items:
            type: string
            format: binary
          description: >-
            Ordered character image uploads, at most 20 MiB per image. Send with
            a driving video. Image usage depends on enhance_mode and prompt tags
            as described above.
        character_image_url:
          type: array
          maxItems: 10
          items:
            type: string
            format: uri
          description: >-
            One character image URL. Send with a driving video. Use
            character_image_urls for multiple images in JSON. Cannot be combined
            with character_image_urls or uploads.
        character_image_urls:
          type: array
          maxItems: 10
          items:
            type: string
            format: uri
          description: >-
            Ordered character image URLs. Send with a driving video. Image usage
            depends on enhance_mode and prompt tags as described above. Cannot
            be combined with character_image_url or uploads.
        enhance_mode:
          type: string
          enum:
            - planner
            - normal
            - agent
          default: planner
          description: >
            How a Remake prepares the driving video for the

            render, and sets the per-second price. `planner` adds a planning

            pass that prepares the prompt and key frames; `normal` is the

            lightest pass; `agent` hands the whole edit to an AI agent. Omit it
            for `planner`.

            Remake only:

            H3 generation ignores it and uses `enhance`.
        duration_s:
          type: number
          minimum: 5
          maximum: 15
          default: 5
          description: >-
            H3 generation only. Requested video duration in seconds, between 5
            and 15 inclusive. Defaults to 5. Does not set Remake duration; that
            comes from the driving video.
        resolution:
          type: string
          enum:
            - 480p
            - 768p
            - 1080p
            - 2k
            - 4k
          default: 768p
          description: >-
            Output resolution tier, case-insensitive (`2K` and `2k` both work).
            It sets the per-second price — see the operation description.
        aspect_ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
            - '21:9'
          default: '16:9'
          description: Output aspect ratio.
        seed:
          type: integer
          format: int64
          minimum: 0
          description: >-
            Deterministic generation seed. Omit for a random seed. H3 modes only
            — not applicable to Remake mode.
        watermark:
          type: boolean
          default: false
          description: Whether to burn in a Viggle watermark.
        enhance:
          type: boolean
          default: true
          description: >-
            Whether to run a low-effort AI Planner pass that rewrites only
            `prompt` before generation; any supplied frame or reference
            video/image is left unchanged. H3 modes only — not applicable to
            Remake mode. Defaults to `true`; pass `false` to use `prompt`
            exactly as given. `true` adds 1 credit per second in every H3 mode.
    CreateRemakeRequest:
      type: object
      description: |
        Viggle Remake with URL inputs only, as `application/json` or
        `application/x-www-form-urlencoded`. Viggle H3 accepts only
        `multipart/form-data`. Send one image source: `character_image_url`
        or `character_image_urls`. A null field counts as not sent.
      required:
        - driving_video_url
      properties:
        driving_video_url:
          type: string
          format: uri
          description: >-
            `https://` URL of the driving video, at most 100 MiB. 5-16 seconds
            for `planner`/`normal`, 5-60 seconds for `agent`. A single string.
        character_image_url:
          type: string
          format: uri
          description: >-
            `https://` URL of one character image. In a form body, repeat the
            field for several images, in order.
        character_image_urls:
          type: array
          maxItems: 10
          items:
            type: string
            format: uri
          description: >-
            Ordered `https://` URLs of up to 10 character images. In a form
            body, send a JSON array string.
        prompt:
          type: string
          description: >-
            Ordered `<Character1>`-style target tags for `planner`/`normal`, or
            the editing instruction for `agent`.
        enhance_mode:
          type: string
          enum:
            - normal
            - planner
            - agent
          default: planner
          description: Preparation level and price per driving-video second.
        watermark:
          type: boolean
          default: false
          description: Burns in a Viggle watermark. Doesn't change the price.
    VideoCreateResponse:
      description: |
        Acceptance acknowledgment for `POST /v1/videos`, shared by all five
        generation modes. This is a queued confirmation, not the final
        result — poll `GET /v1/videos/{video_id}` (or watch it via
        `GET /v1/videos`) until `status` reaches `ready`, then read
        `video_url` from that response.
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - progress
        - created_at
      properties:
        id:
          type: string
          description: >-
            Public video ID — `vid_`-prefixed for the four H3 modes,
            `anim_`-prefixed for Remake mode.
          minLength: 1
        status:
          description: Lifecycle state at acceptance time; always `queued`.
          allOf:
            - $ref: '#/components/schemas/ResourceStatus'
        progress:
          type: integer
          description: Always null on acceptance.
          nullable: true
          minimum: 0
          maximum: 100
        created_at:
          type: string
          description: ISO 8601 creation timestamp, second precision.
          nullable: true
          format: date-time
    ResourceStatus:
      description: |
        The public lifecycle shared by every asynchronous resource. It carries
        the same values as `RenderStatus`.
      type: string
      enum:
        - queued
        - processing
        - ready
        - failed
        - cancelled
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          description: >-
            Error payload containing the stable code, message, retry guidance,
            correlation ID, and error-specific details.
          allOf:
            - $ref: '#/components/schemas/ErrorBody'
    ErrorBody:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - retryable
        - request_id
        - details
        - remediation
      properties:
        code:
          description: >-
            Stable, machine-readable error code. Use it for programmatic
            handling instead of parsing `message`.
          allOf:
            - $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable explanation suitable for logs or presentation to a
            developer.
        retryable:
          type: boolean
          description: >-
            Whether retrying the operation without changing its input may
            succeed. True for HTTP 408, 429, and 5xx responses.
        request_id:
          type: string
          description: >-
            Correlation identifier for tracing and support. Include it when
            reporting the failure.
        details:
          type: object
          description: Error-specific structured context; available keys depend on `code`.
          additionalProperties: true
        remediation:
          description: Suggested recovery action and optional retry delay.
          allOf:
            - $ref: '#/components/schemas/ErrorRemediation'
    ErrorCode:
      description: |
        Error codes the API emits, in the synchronous error envelope and in
        the `error` object of a failed job. Clients should tolerate codes not
        listed here. Asynchronous failures that have no public mapping
        surface as `PROCESSING_FAILED`.
      type: string
      enum:
        - INVALID_REQUEST
        - UNAUTHENTICATED
        - INVALID_CREDENTIAL
        - INSUFFICIENT_CREDITS
        - RENDER_NOT_FOUND
        - CHARACTER_NOT_FOUND
        - MOTION_NOT_FOUND
        - DRAFT_NOT_FOUND
        - NOT_FOUND
        - RESULT_EXPIRED
        - IDEMPOTENCY_KEY_REUSED
        - ID_ALREADY_EXISTS
        - UPLOAD_TIMEOUT
        - CONTENT_POLICY_VIOLATION
        - RATE_LIMITED
        - SERVICE_BUSY
        - INTERNAL_ERROR
        - IMAGE_REQUIRED
        - MOTION_VIDEO_REQUIRED
        - UNSUPPORTED_MEDIA
        - VIDEO_TOO_LONG
        - VIDEO_TOO_LARGE
        - VIDEO_RESOLUTION_TOO_HIGH
        - VIDEO_UNREADABLE
        - VIDEO_DIMENSIONS_MUST_BE_EVEN
        - VIDEO_INACCESSIBLE
        - NO_HUMANS_DETECTED
        - MOTION_NOT_READY
        - MOTION_MODEL_MISMATCH
        - INVALID_BACKGROUND_MODE
        - ALL_WORKERS_BUSY
        - WORKER_STOPPED
        - TASK_FAILED
        - PROCESSING_FAILED
    ErrorRemediation:
      type: object
      additionalProperties: false
      required:
        - action
        - retry_after_ms
      properties:
        action:
          type: string
          enum:
            - none
            - retry
          description: >-
            Suggested next action. Synchronous errors always carry `none`; a
            failed job's `error` carries `retry` when the failure is retryable.
        retry_after_ms:
          type: integer
          description: >-
            Recommended delay in milliseconds before retrying; null when no
            timed retry is advised.
          nullable: true
          format: int64
          minimum: 0
  headers:
    RequestId:
      description: Stable request identifier for support and tracing.
      schema:
        type: string
  responses:
    BadRequest:
      description: Invalid request.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    V1Unauthorized:
      description: Missing or invalid API key. Code `UNAUTHENTICATED`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PaymentRequired:
      description: Insufficient credits.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UploadTimeout:
      description: >-
        A multipart upload did not finish arriving within the 10-minute read
        deadline. Code `UPLOAD_TIMEOUT`, retryable: retry, or pass a URL instead
        of the file.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: |
        The credit-reservation gate is busy (code `RATE_LIMITED`, retryable).
        There is no per-account rate limit; this appears only on Viggle
        Remake, image, and scene creation. Retry with backoff.
      headers:
        Retry-After:
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Unexpected server error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Service temporarily unavailable.
      headers:
        Retry-After:
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: |
        Send your API key as `Authorization: Bearer <API key>`. Keys begin
        with `sk-`. A missing or invalid key answers `401 UNAUTHENTICATED`.
        Never expose an API key in browser code.

````

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