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

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

`multipart/form-data` supplies the source video either as an
uploaded file or as `motion_video_url`. `type` selects what gets
produced from it: `render` (default, unchanged from before `type`
existed) is the render-ready 2D motion and has no separate
preprocessing charge; `glb` additionally extracts a 3D skeletal
animation and costs 5 credits per second of source video, rounded
up; `all` produces both and is billed for both.

`application/json` generates the 3D animation from a `text` prompt
instead of a video — there is no render-ready 2D counterpart for a
text-generated motion, so this shape always produces `type: glb`
only. This replaces the old `POST /v1/animations/generate`, and
costs a flat 10 credits regardless of `duration_seconds`.

Insufficient credits: a 3D (`glb`) extraction or a text-generated
motion is accepted and then fails with `INSUFFICIENT_CREDITS`.
`render` motions are shared across the account. A `glb` or
text-generated motion, and every motion export, is visible only to
the API key that created it; other keys get `404 MOTION_NOT_FOUND`.

Either shape lands on the same resource: poll
`GET /v1/motions/{motion_id}` until `status` is `ready`, then fetch
the glb's download URL, if any, from
`GET /v1/motions/{motion_id}/export`.




## OpenAPI

````yaml /openapi.yaml post /v1/motions
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/motions:
    parameters:
      - $ref: '#/components/parameters/RequestId'
    post:
      tags:
        - Motions
      summary: Create a motion
      description: |
        The request body carries one of two shapes and the `Content-Type`
        selects between them.

        `multipart/form-data` supplies the source video either as an
        uploaded file or as `motion_video_url`. `type` selects what gets
        produced from it: `render` (default, unchanged from before `type`
        existed) is the render-ready 2D motion and has no separate
        preprocessing charge; `glb` additionally extracts a 3D skeletal
        animation and costs 5 credits per second of source video, rounded
        up; `all` produces both and is billed for both.

        `application/json` generates the 3D animation from a `text` prompt
        instead of a video — there is no render-ready 2D counterpart for a
        text-generated motion, so this shape always produces `type: glb`
        only. This replaces the old `POST /v1/animations/generate`, and
        costs a flat 10 credits regardless of `duration_seconds`.

        Insufficient credits: a 3D (`glb`) extraction or a text-generated
        motion is accepted and then fails with `INSUFFICIENT_CREDITS`.
        `render` motions are shared across the account. A `glb` or
        text-generated motion, and every motion export, is visible only to
        the API key that created it; other keys get `404 MOTION_NOT_FOUND`.

        Either shape lands on the same resource: poll
        `GET /v1/motions/{motion_id}` until `status` is `ready`, then fetch
        the glb's download URL, if any, from
        `GET /v1/motions/{motion_id}/export`.
      operationId: createMotion
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateMotionForm'
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CreateMotionRequest'
                - $ref: '#/components/schemas/CreateMotionForm'
              description: >-
                With `text`: motion from text (`CreateMotionRequest`). Without
                `text`: a motion from a video URL, using the form fields with
                `video_url` or `motion_video_url` instead of a file upload.
      responses:
        '200':
          description: Motion queued.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
        '400':
          $ref: '#/components/responses/ResourceBadRequest'
        '401':
          $ref: '#/components/responses/ResourceUnauthorized'
        '402':
          $ref: '#/components/responses/ResourcePaymentRequired'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '408':
          $ref: '#/components/responses/UploadTimeout'
        '409':
          $ref: '#/components/responses/ResourceConflict'
        '500':
          $ref: '#/components/responses/ResourceInternalServerError'
        '503':
          $ref: '#/components/responses/ResourceServiceUnavailable'
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:
    CreateMotionForm:
      description: |
        Supply the source video as exactly one of `motion_video`,
        `motion_video_url`, or the backward-compatible `video_url` alias.
        `type` selects what gets produced from it — see
        `createMotion`. The fields below `type` apply only when it is
        `glb` or `all`.
        This is the complete public contract; staged paths, output locations,
        extraction templates, character PKLs, joint configuration, and
        tracking masks are service-managed.
      type: object
      properties:
        motion_video:
          type: string
          format: binary
          description: >-
            Driving video uploaded directly. Supply exactly one of
            `motion_video` or `motion_video_url`.
        motion_video_url:
          type: string
          format: uri
          description: >-
            Publicly reachable URL of the driving video. Supply this instead of
            `motion_video`, and keep it accessible during ingestion.
        video_url:
          type: string
          format: uri
          deprecated: true
          description: >-
            Backward-compatible alias for `motion_video_url`. Do not send both
            URL fields.
        name:
          description: |
            Optional label for `render` or `all`. A `glb`-only Motion
            currently returns an empty name.
          type: string
          default: ''
        model:
          type: string
          enum:
            - V3
            - v3
            - V3_Preview
            - V4
            - v4
            - V4_Preview
            - V4_BaseSG
          description: >-
            Optional 2D preprocessing model used by `type=render` or `all`. It
            has no effect on a `glb`-only request. Omit to use the service
            default.
        thumbnail_path:
          type: string
          description: >-
            Optional existing thumbnail URI/path for the reusable 2D Motion
            created by `type=render` or `all`. It has no effect on `type=glb`.
        thumbnail_url:
          type: string
          format: uri
          deprecated: true
          description: >-
            Multipart-only backward-compatible alias for `thumbnail_path`. Do
            not send both fields.
        type:
          type: string
          description: >-
            Outputs to produce: `render` for the reusable 2D Motion (no separate
            preprocessing charge), `glb` for only the 3D animation (5 credits
            per second of source video, rounded up), or `all` for both.
          enum:
            - render
            - glb
            - all
          default: render
        enable_smoothing:
          type: boolean
          description: >-
            Whether to apply motion smoothing during 3D extraction. Applies only
            to `type=glb` or `all` and may reduce frame-to-frame jitter.
          default: false
        target_fps:
          description: |
            Target extraction and GLB timeline frame rate. Omit to use the
            extraction service's 25 FPS default. The value must be greater
            than zero and applies only to `type=glb` or `all`.
          type: number
          minimum: 0
          exclusiveMinimum: true
          default: 25
        smooth_velocity_threshold:
          type: number
          minimum: 0
          default: 0.12
          description: >-
            Velocity threshold used by temporal smoothing. Applies only when
            `enable_smoothing=true`.
        apply_std_joints:
          type: boolean
          default: true
          description: Whether dynamic extraction applies standard-joint normalization.
        render_mp4:
          type: boolean
          default: false
          description: >-
            Also render an MP4 preview of the 3D animation, returned as
            `mp4_url` on `GET /v1/motions/{motion_id}/export`. Requires
            `type=glb` or `all` (`400` with `type=render`). Does not change the
            price.
        task_id:
          description: |
            Client-supplied task ID for `type=glb`. For `type=all`, the
            service keys the companion extraction with the Motion ID.
            Reusing an ID answers `409 ID_ALREADY_EXISTS`; it does not replay
            the original response. 1–200 characters: letters, digits, `_`,
            `.` and `-`, starting with a letter or digit.
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9][A-Za-z0-9_.-]*$
    CreateMotionRequest:
      description: |
        Text-to-motion generation — the `application/json` shape of
        `POST /v1/motions`. Always yields `type: glb` on the resulting
        `Asset`. Formerly `GenerateMotionRequest`, the body of the
        now-removed `POST /v1/animations/generate`. Costs a flat 10 credits,
        independent of `duration_seconds`.
      type: object
      additionalProperties: false
      required:
        - text
      properties:
        text:
          type: string
          description: >-
            Natural-language description of the desired movement. Be specific
            about actions, direction, pacing, and body parts; maximum 400 bytes
            (UTF-8).
          minLength: 1
          maxLength: 400
        duration_seconds:
          description: |
            Requested animation length in seconds. It is rounded to the
            nearest frame at 30 FPS; values outside [3, 60] are rejected with
            HTTP 400 rather than clamped. Defaults to 5 seconds.
          type: number
          minimum: 3
          maximum: 60
          default: 5
        guidance_scale:
          description: >-
            Controls how strongly generation follows the text prompt. Values
            must be between 0 and 30; out-of-range input is rejected with HTTP
            400 rather than clamped. Defaults to 5.
          type: number
          minimum: 0
          maximum: 30
          default: 5
        smooth:
          type: boolean
          description: >-
            Whether to smooth the generated animation to reduce abrupt
            frame-to-frame joint changes.
          default: true
        render_mp4:
          type: boolean
          default: false
          description: >-
            Also render an MP4 preview of the generated animation, returned as
            `mp4_url` on `GET /v1/motions/{motion_id}/export`. Does not change
            the price.
        name:
          type: string
          description: >-
            Optional display name for the generated Motion; defaults to an empty
            string.
          default: ''
        task_id:
          type: string
          description: >-
            Optional client-supplied task ID, 1–200 characters (letters, digits,
            `_`, `.` and `-`, starting with a letter or digit). Reusing an
            existing ID answers `409 ID_ALREADY_EXISTS`; it does not replay the
            original response.
          minLength: 1
          maxLength: 200
          pattern: ^[A-Za-z0-9][A-Za-z0-9_.-]*$
    Asset:
      description: >
        A character or motion asset. Both resources share one wire shape.


        `progress` and `error` are always null, including on a `failed`

        asset: read `status` to detect failure, and `vsplat.error` or

        `glb.error` for extraction failures.


        `type` reflects what was requested at creation. For characters it is

        `render`, `vsplat`, or `all`; for motions it is `render`, `glb`,

        or `all`. Assets created before `type` existed report `render`.

        `vsplat` and `glb` carry that extraction's own status — never

        download URLs, which come from `GET
        /v1/characters/{character_id}/export`

        or `GET /v1/motions/{motion_id}/export` instead — and are null unless

        `type` requested that extraction. On an `all` asset, the top-level

        `status` only reaches `ready` once both the 2D render and the 3D

        extraction have; if either fails, the top-level `status` is `failed`

        while the sub-object's own `status` still shows which one it was.
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - name
        - progress
        - capabilities
        - created_at
        - completed_at
        - error
        - type
        - vsplat
        - glb
      properties:
        id:
          type: string
          description: >-
            Public asset identifier. Character IDs normally begin with `char_`;
            Motion IDs normally begin with `mot_`.
          minLength: 1
        status:
          description: >-
            Overall lifecycle of the asset. `pending` means created but not yet
            queued; treat it like `queued`. Use an asset for rendering or export
            only after the required capability becomes `ready`.
          type: string
          enum:
            - pending
            - queued
            - processing
            - ready
            - failed
        name:
          type: string
          description: >-
            Display name supplied at creation or derived during import; it may
            be empty when a workflow does not accept a name.
        progress:
          type: integer
          description: Reserved; currently always null. Poll `status` instead.
          nullable: true
          minimum: 0
          maximum: 100
        capabilities:
          description: |
            What the asset can be used for. `video_render` appears once the
            asset is ready.
          type: array
          items:
            type: string
        created_at:
          description: >-
            ISO 8601 timestamp with a UTC offset, for example
            `2026-07-31T09:15:22+00:00`.
          type: string
          nullable: true
        completed_at:
          type: string
          description: >-
            ISO 8601 timestamp with a UTC offset when all requested processing
            reached a terminal state; null while work is active.
          nullable: true
        error:
          type: object
          description: >-
            Reserved top-level failure detail. It is currently always null;
            detect failure from `status` and inspect extraction sub-objects when
            applicable.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ErrorBody'
        type:
          type: string
          description: >-
            Work requested when the asset was created. `render` produces the 2D
            render-ready asset, `vsplat`/`glb` requests 3D output, and `all`
            requests both supported outputs.
          enum:
            - render
            - vsplat
            - glb
            - all
          default: render
        vsplat:
          description: |
            Character vsplat extraction status. Null for motions, and for
            characters whose `type` is `render`. The request parameters
            (`model_precision`, etc.) submitted at creation are not echoed
            back here — this is status only.
          nullable: true
          type: object
          additionalProperties: false
          required:
            - status
            - error
          properties:
            status:
              description: >-
                Lifecycle of the character's vsplat extraction, independent of
                the top-level asset status.
              allOf:
                - $ref: '#/components/schemas/ResourceStatus'
            error:
              type: object
              description: >-
                Structured vsplat extraction failure when its status is
                `failed`; otherwise null.
              nullable: true
              allOf:
                - $ref: '#/components/schemas/ErrorBody'
        glb:
          description: |
            Motion 3D animation extraction/generation status. Null for
            characters, and for motions whose `type` is `render`.
          nullable: true
          type: object
          additionalProperties: false
          required:
            - status
            - skeletons
            - error
          properties:
            status:
              description: >-
                Lifecycle of the motion's 3D animation extraction or generation,
                independent of the top-level asset status.
              allOf:
                - $ref: '#/components/schemas/ResourceStatus'
            skeletons:
              description: |
                Skeleton variants ready to export via
                `GET /v1/motions/{motion_id}/export?download_type=`.
                Empty until `status` is `ready`; both variants are
                generated up front, so this is either empty or
                `[mixamo, metahuman]`.
              type: array
              items:
                type: string
                enum:
                  - mixamo
                  - metahuman
            error:
              type: object
              description: >-
                Structured 3D animation failure when its status is `failed`;
                otherwise null.
              nullable: true
              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'
    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
    ResourceErrorResponse:
      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'
    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'
    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:
    ResourceBadRequest:
      description: |
        Invalid request. The resource operations answer every request-shape
        rejection with `400`; they never answer `422`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceUnauthorized:
      description: Missing or invalid API key. Code `UNAUTHENTICATED`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourcePaymentRequired:
      description: Insufficient credits.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceNotFound:
      description: |
        The resource does not exist, or it is not visible to the caller (a
        2D asset of another account, or a 3D-only asset or export created by
        another API key). The cases are deliberately indistinguishable. Codes
        `CHARACTER_NOT_FOUND`, `MOTION_NOT_FOUND`, or `RENDER_NOT_FOUND`;
        an export whose files were deleted answers `RESULT_EXPIRED`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    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'
    ResourceConflict:
      description: >-
        The client-supplied `task_id` is already in use (code
        `ID_ALREADY_EXISTS`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceInternalServerError:
      description: Unexpected server error.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceServiceUnavailable:
      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/ResourceErrorResponse'
  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.