> ## 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 scene from a custom panorama

> Like `pano` with `panoramaUri` or an uploaded `panorama` file
(`multipart/form-data`), with the panorama placed at
`panoramaC2w` and `metersPerUnit` in the caller's world; every camera in
the result is in that frame. The task reports `operation: pano`. Costs 6
credits: 1 per view, and the panorama counts as 6.




## OpenAPI

````yaml /openapi.yaml post /v1/scenes/custom-pano
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/scenes/custom-pano:
    post:
      tags:
        - Scenes
      summary: Create a scene from a custom panorama
      description: |
        Like `pano` with `panoramaUri` or an uploaded `panorama` file
        (`multipart/form-data`), with the panorama placed at
        `panoramaC2w` and `metersPerUnit` in the caller's world; every camera in
        the result is in that frame. The task reports `operation: pano`. Costs 6
        credits: 1 per view, and the panorama counts as 6.
      operationId: createSceneFromCustomPano
      parameters:
        - $ref: '#/components/parameters/RequestId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SceneCustomPanoRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SceneCustomPanoForm'
      responses:
        '200':
          description: Scene task started.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SceneTask'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/V1Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '408':
          $ref: '#/components/responses/SceneUploadTimeout'
        '409':
          $ref: '#/components/responses/SceneSessionBusy'
        '429':
          $ref: '#/components/responses/RateLimited'
        '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:
    SceneCustomPanoRequest:
      type: object
      additionalProperties: false
      description: |
        Body of `POST /v1/scenes/custom-pano`. The panorama is placed at
        `panoramaC2w` in the caller's world: a model-frame point `p` lands
        at `R · (metersPerUnit · p) + t`. The rotation must be orthonormal
        and not mirrored (tolerance `1e-4`), and the largest absolute
        translation component plus `25 × metersPerUnit` must be below
        `4000`.
      required:
        - sessionId
        - panoramaUri
        - panoramaC2w
      properties:
        sessionId:
          $ref: '#/components/schemas/SceneSessionId'
        panoramaUri:
          type: string
          format: uri
          description: URL of the 360° panorama.
        panoramaC2w:
          $ref: '#/components/schemas/SceneMatrix'
        metersPerUnit:
          type: number
          minimum: 0.05
          default: 1
          description: Scale applied to model-frame positions before `panoramaC2w`.
    SceneCustomPanoForm:
      type: object
      additionalProperties: false
      description: |
        Multipart form of `POST /v1/scenes/custom-pano`, for uploading the
        panorama file itself. The fields are those of the JSON body, each
        sent once; `panoramaC2w` and `metersPerUnit` carry
        their JSON value as text. Send exactly one of the `panorama` file
        and `panoramaUri`.
      required:
        - sessionId
        - panoramaC2w
      properties:
        sessionId:
          $ref: '#/components/schemas/SceneSessionId'
        panorama:
          type: string
          format: binary
          description: >-
            The 360° panorama image, used instead of `panoramaUri`: 1 byte to 50
            MiB, a JPEG, PNG, or WebP image as detected from its bytes. The only
            file the form may carry.
        panoramaUri:
          type: string
          format: uri
          description: URL of the 360° panorama. Not combinable with the `panorama` file.
        panoramaC2w:
          type: string
          description: >-
            Camera-to-world matrix of the panorama as JSON text: four rows of
            four numbers, the last `[0, 0, 0, 1]`.
        metersPerUnit:
          type: string
          description: >-
            Scale applied to model-frame positions before `panoramaC2w`, as JSON
            text. At least `0.05`; default `1`.
    SceneTask:
      type: object
      additionalProperties: false
      description: |
        A scene task (`scn_` prefix), returned by every `/v1/scenes`
        submission and by `GET /v1/scenes/{task_id}`. It starts `queued` (or
        `processing` when a GPU slot is free); `ready`, `failed`, and
        `cancelled` are terminal. Only a `ready` task keeps its credits.
      required:
        - id
        - sessionId
        - operation
        - status
        - credits
        - createdAt
        - completedAt
        - result
        - error
      properties:
        id:
          type: string
          description: Task ID, `scn_{runId}.{sessionId}`.
        sessionId:
          type: string
        operation:
          type: string
          enum:
            - pano
            - generate
            - reconstruct
          description: A custom-pano task reports `pano`.
        status:
          type: string
          enum:
            - queued
            - processing
            - ready
            - failed
            - cancelled
        queuePosition:
          type: integer
          minimum: 0
          description: >-
            Only while `queued`: tasks waiting ahead of this one, 0 when it is
            next.
        credits:
          type: number
          minimum: 0
          description: >-
            Credits this task is charged: reserved at submission (1 per view the
            run handles, with a panorama counting as 6), settled to the views
            actually counted for perspective generate and reconstruct, and 0
            once a task that did not finish `ready` is refunded.
        createdAt:
          type: integer
          format: int64
          nullable: true
          description: Start time, Unix milliseconds.
        completedAt:
          type: integer
          format: int64
          nullable: true
          description: End time, Unix milliseconds; null while queued or processing.
        result:
          description: Set only when `ready`.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SceneResult'
        error:
          description: |
            Set only when `failed`. `code` is `INVALID_REQUEST` (not
            retryable — the model rejected the input, such as a batch from
            another session) or `PROCESSING_FAILED` (retryable).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ErrorBody'
    SceneSessionId:
      type: string
      minLength: 1
      maxLength: 128
      pattern: ^[A-Za-z0-9_-]+$
      description: |
        Session chosen by the caller, scoped to the caller's account. A
        session holds one scene and its image batches, and runs one task at
        a time: a submission while a task is still `processing` answers
        `409` with that task in `error.details.running_task_id`.
      example: living-room-01
    SceneMatrix:
      type: array
      description: >-
        4 × 4 camera-to-world matrix as four rows of four finite numbers; the
        last row must be `[0, 0, 0, 1]`.
      minItems: 4
      maxItems: 4
      items:
        type: array
        minItems: 4
        maxItems: 4
        items:
          type: number
      example:
        - - 1
          - 0
          - 0
          - 0
        - - 0
          - 1
          - 0
          - 0
        - - 0
          - 0
          - 1
          - 0
        - - 0
          - 0
          - 0
          - 1
    SceneResult:
      type: object
      required:
        - operation
        - sessionId
        - spz
        - preview
        - panorama
        - outputBatch
        - referenceViewCount
        - newViewCount
        - seconds
      properties:
        operation:
          type: string
          enum:
            - pano
            - generate
            - reconstruct
        sessionId:
          type: string
        spz:
          description: >-
            The Gaussian-splat scene in SPZ format; set by `pano` and
            `reconstruct`.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SceneFile'
        preview:
          description: A preview image, when the operation produced one.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SceneFile'
        panorama:
          description: The panorama the scene was built from; set by `pano`.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SceneFile'
        outputBatch:
          description: The batch this task added; null for `reconstruct`.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SceneOutputBatch'
        referenceViewCount:
          type: integer
          description: Views read from `referenceBatchIds`.
        newViewCount:
          type: integer
          description: New views produced.
        seconds:
          type: object
          description: Processing time by stage, in seconds. Informational; keys vary.
          additionalProperties:
            type: number
    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'
    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'
    SceneFile:
      type: object
      additionalProperties: false
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: >-
            Download URL. Viggle's signed URLs last 3 hours; fetch the task
            again for fresh ones.
    SceneOutputBatch:
      type: object
      additionalProperties: false
      required:
        - batchId
        - createdAt
        - manifest
      description: >-
        The image batch a `pano` or `generate` task added to the session. `kind`
        and `views` are missing on tasks that finished before they were
        introduced.
      properties:
        batchId:
          type: string
          description: Batch ID, a lowercase UUID; pass it in `referenceBatchIds`.
        createdAt:
          type: number
          description: Batch creation time, Unix milliseconds.
        manifest:
          $ref: '#/components/schemas/SceneFile'
        kind:
          type: string
          enum:
            - initial
            - generated
        views:
          type: array
          items:
            $ref: '#/components/schemas/SceneView'
    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
    SceneView:
      type: object
      additionalProperties: false
      required:
        - index
        - url
        - c2w
        - intrinsic
      properties:
        index:
          type: integer
          minimum: 0
          description: Position in the batch, from 0.
        url:
          type: string
          format: uri
          description: Signed download URL of the image, valid for 3 hours.
        c2w:
          $ref: '#/components/schemas/SceneMatrix'
        intrinsic:
          type: array
          description: Camera intrinsics, as recorded in the batch manifest.
          items:
            type: number
  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'
    SceneUploadTimeout:
      description: >-
        A multipart upload did not finish arriving before the read deadline.
        Code `UPLOAD_TIMEOUT`, retryable: retry, or pass `panoramaUri` instead.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    SceneSessionBusy:
      description: >-
        The session already has a task queued or running;
        `error.details.running_task_id` names it. Code `INVALID_REQUEST`.
      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'
    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.