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

> The request body carries one of two shapes and the `Content-Type`
selects between them.

`multipart/form-data` creates a render directly from character and
motion inputs, each supplied as an uploaded file, a URL, or the id of a
saved asset. This form answers `200`; `Idempotency-Key` is optional
and honoured when sent.

`application/json` creates a render from a draft prepared by
`POST /v1/renders/prepare`. This form answers `202`, requires
`Idempotency-Key`.

Idempotency keys are scoped to the API key and kept for 24 hours:
reusing a key with the same input returns the original render, while
reusing it with different input returns `409 IDEMPOTENCY_KEY_REUSED`.

Billed at 1 credit ($0.01) per character per second of the finished
video, with a minimum of 0.5 credit ($0.005) per render. A
single-character render is $0.01/second; a multi-person render counts
one character per entry in `character_mapping`. Creation reserves an
estimate from the measured motion duration (10 seconds when unknown);
the charge is settled against the actual duration when the render
finishes. Insufficient credits answer `402`. A cancelled or failed
render is refunded in full.

Renders are visible only to the API key that created them. The result
`video_url` is a CDN URL; result files are deleted 24 hours after the
render finishes.




## OpenAPI

````yaml /openapi.yaml post /v1/renders
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/renders:
    post:
      tags:
        - Renders
      summary: Create a render
      description: |
        The request body carries one of two shapes and the `Content-Type`
        selects between them.

        `multipart/form-data` creates a render directly from character and
        motion inputs, each supplied as an uploaded file, a URL, or the id of a
        saved asset. This form answers `200`; `Idempotency-Key` is optional
        and honoured when sent.

        `application/json` creates a render from a draft prepared by
        `POST /v1/renders/prepare`. This form answers `202`, requires
        `Idempotency-Key`.

        Idempotency keys are scoped to the API key and kept for 24 hours:
        reusing a key with the same input returns the original render, while
        reusing it with different input returns `409 IDEMPOTENCY_KEY_REUSED`.

        Billed at 1 credit ($0.01) per character per second of the finished
        video, with a minimum of 0.5 credit ($0.005) per render. A
        single-character render is $0.01/second; a multi-person render counts
        one character per entry in `character_mapping`. Creation reserves an
        estimate from the measured motion duration (10 seconds when unknown);
        the charge is settled against the actual duration when the render
        finishes. Insufficient credits answer `402`. A cancelled or failed
        render is refunded in full.

        Renders are visible only to the API key that created them. The result
        `video_url` is a CDN URL; result files are deleted 24 hours after the
        render finishes.
      operationId: createRender
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/RequestId'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateRenderForm'
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRenderRequest'
      responses:
        '200':
          description: |
            Render accepted from a direct `multipart/form-data` request.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Render'
        '202':
          description: Render accepted from a prepared draft.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Render'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/V1Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '404':
          description: |
            A saved character or motion (`character_id`, `motion_id`, or one
            named in the draft) doesn't exist, was deleted, or can't be used by
            this account: code `CHARACTER_NOT_FOUND` or `MOTION_NOT_FOUND`. An
            unknown or expired `draft_id` answers `DRAFT_NOT_FOUND`.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '408':
          $ref: '#/components/responses/UploadTimeout'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: |
        Caller-generated stable key, maximum 255 characters, scoped to the API
        key and kept for 24 hours. Required by the `application/json` draft
        form of `POST /v1/renders`; optional and honoured by the
        `multipart/form-data` form.
      schema:
        type: string
        minLength: 1
        maxLength: 255
    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:
    CreateRenderForm:
      description: |
        Supply the character as one of `image`, `image_url` (or its
        `ref_url`/`ref_image_url` aliases), or `character_id`, and the motion
        as one of `motion_video`, `motion_video_url` (or its
        `video_url`/`driving_video_url` aliases), or `motion_id`/`scene_id`.
        If neither group is supplied at all, the server
        substitutes its own preconfigured default `character_id`/`motion_id`
        and renders that instead of rejecting the request — supplying either
        group partially (for example a character source with no motion
        source) is still an error.
      type: object
      properties:
        image:
          type: string
          format: binary
          description: >-
            Character image uploaded directly. Use exactly one character source
            among `image`, `image_url`, and `character_id`.
        image_url:
          type: string
          format: uri
          description: >-
            Public URL of a character image that the service can fetch. Use
            instead of `image` or `character_id`.
        ref_url:
          type: string
          format: uri
          deprecated: true
          description: >-
            Backward-compatible alias for `image_url`. Do not combine character
            URL aliases.
        ref_image_url:
          type: string
          format: uri
          deprecated: true
          description: >-
            Backward-compatible alias for `image_url`. Do not combine character
            URL aliases.
        character_id:
          type: string
          description: >-
            ID of a ready reusable Character owned by the caller. Use instead of
            uploading or linking a new image.
          minLength: 1
        motion_video:
          type: string
          format: binary
          description: >-
            Driving video uploaded directly. Use exactly one motion source among
            `motion_video`, `motion_video_url`, and `motion_id`.
        motion_video_url:
          type: string
          format: uri
          description: >-
            Public URL of a driving video that the service can fetch. Use
            instead of `motion_video` or `motion_id`.
        video_url:
          type: string
          format: uri
          deprecated: true
          description: >-
            Backward-compatible alias for `motion_video_url`. Do not combine
            motion URL aliases.
        driving_video_url:
          type: string
          format: uri
          deprecated: true
          description: >-
            Backward-compatible alias for `motion_video_url`. Do not combine
            motion URL aliases.
        motion_id:
          type: string
          description: >-
            ID of a ready reusable Motion owned by the caller. Use instead of
            uploading or linking a new driving video.
          minLength: 1
        scene_id:
          type: string
          deprecated: true
          description: >-
            Backward-compatible alias for `motion_id` (the internal name for a
            reusable Motion). Do not send both fields.
          minLength: 1
        mode:
          type: string
          enum:
            - full_pipeline
            - preprocessed
            - character_only
            - scene_preprocess
          description: >-
            Advanced pipeline mode. Omit to infer `preprocessed` when a Motion
            ID is supplied and `full_pipeline` otherwise.
        background_mode:
          description: |
            `inpaint` is accepted and treated as `original`. This set is
            unrelated to `RenderOutputOptions.background_mode`, which belongs to
            the draft-based flow.
          type: string
          enum:
            - original
            - solid
            - transparent
            - inpaint
          default: original
        bg_color:
          description: |
            Solid background colour as three decimal components, `"R,G,B"`, for
            example `"0,177,64"`. Valid only with `background_mode=solid`.
          type: string
          example: 0,177,64
        background_url:
          type: string
          format: uri
          description: >-
            Optional custom background image URL forwarded to the render
            pipeline. Normally omitted unless the selected pipeline mode
            supports it.
        model:
          type: string
          enum:
            - V3
            - v3
            - V3_Preview
            - V4
            - v4
            - V4_Preview
            - V4_BaseSG
          description: >-
            Optional render model. Omit to let the service infer the model from
            saved assets or use its configured default.
        character_mapping:
          type: string
          description: |
            Multi-person render. A JSON object, sent as a string, that maps
            each person (track ID) of a multi-person Motion to a `ready`
            Character owned by the caller; Character IDs may use the public
            `char_` prefix. For a Motion imported from a template, the track
            IDs are the UUIDs of the people in that template. A key that is not
            a track of the Motion answers 400 with the valid keys in the
            message. People left out of the mapping are rendered with the
            primary character source (`character_id`, `image`, or
            `image_url`), which is still required. Billing counts one
            character per mapping entry.
    CreateRenderRequest:
      type: object
      additionalProperties: false
      required:
        - draft_id
      properties:
        draft_id:
          type: string
          description: >-
            Draft identifier returned by `POST /v1/renders/prepare`. A draft
            stays valid for 1 hour; each submission with a new `Idempotency-Key`
            creates a new render.
          minLength: 1
        upload_completions:
          type: array
          description: >-
            Optional. The service verifies each planned upload itself
            (existence, size, and `sha256` when declared); a missing upload
            answers `400 INVALID_REQUEST`.
          items:
            $ref: '#/components/schemas/UploadCompletion'
    Render:
      description: |
        `stage`, `progress`, and `created_at` are null on renders that carry no
        such information. Treat them as optional when reading.

        The resource response exposes the result URLs but does not expose
        media dimensions, duration, thumbnail URL, or URL expiry metadata.
        Clients must not infer those fields from this contract.
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - stage
        - progress
        - video_url
        - alpha_url
        - created_at
        - completed_at
        - error
      properties:
        id:
          type: string
          description: >-
            Public Render ID, normally beginning with `render_`; use it with
            get, events, and download operations.
          minLength: 1
        status:
          description: >-
            Overall render lifecycle. `ready`, `failed`, and `cancelled` are
            terminal states.
          allOf:
            - $ref: '#/components/schemas/RenderStatus'
        stage:
          type: string
          description: >-
            Coarse pipeline phase when one can be mapped to the public
            vocabulary; null when unavailable or unknown.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RenderStage'
        progress:
          type: integer
          description: >-
            Best-effort completion percentage from 0 through 100; `0` until the
            pipeline reports progress.
          minimum: 0
          maximum: 100
        video_url:
          type: string
          description: >-
            CDN URL of the completed rendered video; null until the render is
            ready or when no output was produced. Result files are deleted 24
            hours after the render finishes.
          nullable: true
          format: uri
        alpha_url:
          type: string
          description: >-
            CDN URL of the alpha/mask video for transparent output; null for
            non-transparent renders or until ready.
          nullable: true
          format: uri
        created_at:
          type: string
          description: >-
            ISO 8601 timestamp when the render was created; null when the
            backing pipeline did not provide it.
          nullable: true
          format: date-time
        completed_at:
          type: string
          description: >-
            ISO 8601 timestamp when the render entered a terminal state; null
            while it is still active.
          nullable: true
          format: date-time
        error:
          type: object
          description: >-
            Structured failure details when `status` is `failed`; otherwise
            null.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RenderFailure'
    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'
    UploadCompletion:
      type: object
      additionalProperties: false
      required:
        - upload_handle
      properties:
        upload_handle:
          type: string
          description: >-
            Opaque handle from the matching `UploadPlan`; it tells the service
            which planned input was uploaded.
          minLength: 1
        etag:
          type: string
          description: >-
            Optional ETag returned by the object-store upload response,
            including quotes when the storage service supplies them.
          minLength: 1
    RenderStatus:
      type: string
      enum:
        - queued
        - processing
        - ready
        - failed
        - cancelled
    RenderStage:
      description: |
        A coarse progress hint, set only while a render is `processing`.
        Treat an unrecognized value as "in progress" rather than failing.
      type: string
      enum:
        - analyzing
        - rendering
        - finishing
    RenderFailure:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            Stable machine-readable failure code. Use it for programmatic
            handling instead of parsing the message.
        message:
          type: string
          description: Human-readable explanation of why the render failed.
        details:
          type: object
          description: >-
            Additional structured context supplied by the failing service; keys
            vary by error code.
          additionalProperties: true
        request_id:
          type: string
          description: >-
            Request or worker correlation identifier to provide to support; null
            when the failure was not associated with one.
          nullable: true
        retryable:
          type: boolean
          description: Whether submitting the same render again may succeed.
        remediation:
          description: Suggested recovery action and optional retry delay.
          allOf:
            - $ref: '#/components/schemas/ErrorRemediation'
    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'
    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
    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
  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'
    Conflict:
      description: State or idempotency conflict.
      headers:
        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.