Skip to main content
POST
Create a scene
Send a JSON body with a sessionId and either a prompt or a panoramaUri. With a prompt, the scene model first generates a 360° panorama — optionally guided by reference images — and then builds the scene from it; with panoramaUri, it builds the scene from your panorama. The request is asynchronous: it answers immediately with a queued Scene Task whose ID starts with scn_, and you poll Get Scene Task until it finishes. Instead of hosting your panorama at a panoramaUri, you can upload the image file with the request — see Upload a panorama file. Reference images for a prompt can be uploaded as files too — see Upload reference image files. A ready pano task gives you the scene as an .spz Gaussian splat, the panorama, and an initial image batch of posed views. Pass that batch’s batchId to Generate Scene Views and Reconstruct Scene to extend the scene.
Pricing (1 credit = $0.01): 1 credit ($0.01) per view, and a panorama counts as 6 views — so every scene costs 6 credits ($0.06), whether it comes from a prompt, a panoramaUri, or an uploaded panorama file. Credits are reserved when the task is submitted and refunded in full unless it finishes ready. See Pricing.

Sessions

Every scene request names a sessionId of your choosing. A session holds one scene and every image batch made for it:
  • sessionId is 1–128 ASCII letters, digits, underscores, or hyphens. It is scoped to your account, so it can’t collide with another customer’s.
  • A session runs one task at a time. Submitting while a task is still queued or processing answers 409, before anything is charged, with that task’s ID in error.details.running_task_id — poll it, then submit again.
  • referenceBatchIds on generate and reconstruct only accept batches made in the same session; a batch from another session fails the task with INVALID_REQUEST.

Request parameters

Send application/json, up to 1 MiB, or multipart/form-data to upload the panorama or reference image files themselves — see Upload a panorama file and Upload reference image files. Unknown fields are rejected.

Upload a panorama file

To build the scene from a panorama on your machine, send the request as multipart/form-data instead of JSON, with the image in a panorama file field:
  • The other fields are the same as in the JSON body, each sent once. sessionId, panoramaUri, prompt, and quality are plain text; referenceImages carries its JSON value as text, for example referenceImages=["https://example.com/a.jpg"].
  • Send at most one panorama file. It must be 1 byte to 50 MiB, and its content must be a JPEG, PNG, or WebP image — the type is detected from the bytes, not from the file name or its Content-Type.
  • The file takes the place of panoramaUri: sending both is rejected, and so is a file together with prompt, referenceImages, referenceImageFiles, or quality.
  • It is priced the same as a scene from panoramaUri.
Viggle stores the file only once the rest of the request is valid, and the scene model reads it the way it reads a panoramaUri. An upload that stops arriving before the server’s read deadline answers 408 UPLOAD_TIMEOUT; retry it, or host the image and pass panoramaUri instead.

Upload reference image files

To guide a prompt’s panorama with images on your machine, send the request as multipart/form-data and put each image in a referenceImageFiles file field, repeated once per image:
  • They take the place of referenceImages: send image URLs in referenceImages or files in referenceImageFiles, not both — even an empty referenceImages list together with files is rejected.
  • Send 1 to 8 files. Each must be 1 byte to 10 MiB and a JPEG, PNG, or WebP image, detected from its bytes. They are used in the order you send them.
  • Only with prompt: files are rejected together with panoramaUri or a panorama file, and on Create Scene from Custom Panorama, Generate Scene Views, and Reconstruct Scene.
  • The other fields follow the same multipart rules as in Upload a panorama file. The price is that of any scene from a prompt.
Viggle stores the files only once the rest of the request is valid. A multipart request may carry up to 81 MiB in all.

URL rules

panoramaUri and referenceImages are fetched by Viggle’s servers, so each must be:
  • http or https, without a username or password, with a valid port if one is given;
  • on a host that resolves only to public internet addresses. Private, loopback, link-local, and carrier-grade NAT addresses are rejected with 400.

Response parameters

Returns 200 OK with a Scene Task — the same shape Get Scene Task returns. It is usually queued, with queuePosition tasks ahead of it, or already processing if a slot was free. credits is what the task reserved — 6, for the panorama’s 6 views:

Common errors

A task that starts can still fail later; see Status and errors.

Examples

From an existing panorama

To place the panorama at a known position and scale in your own world, use Create Scene from Custom Panorama instead.

From a local panorama file

Don’t set Content-Type yourself: the client adds multipart/form-data with its boundary.

With local reference image files

With reference image URLs

Next step

Get Scene Task

Poll the task and read the result.

Quick Start: Scene Model

The full build, generate, and reconstruct flow.

Authorizations

Authorization
string
header
required

Server-side SDK clients use a project API key. Remote MCP clients use an OAuth access token. Never expose a project API key in browser code.

Headers

X-Request-Id
string

Optional caller-supplied correlation ID, up to 128 characters. The service returns the effective value in the response header for tracing and support.

Required string length: 1 - 128
X-Viggle-Source
string

Optional source-channel label, up to 128 characters, used to attribute traffic to an SDK, integration, product surface, or internal workflow.

Required string length: 1 - 128

Body

Body of POST /v1/scenes/pano. Send either prompt (optionally with referenceImages and quality) or panoramaUri, not both. Input URLs must be http(s), without credentials, on a host that resolves only to public addresses.

sessionId
string
required

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.

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9_-]+$
Example:

"living-room-01"

prompt
string

Scene description; a 360° panorama is generated from it. Must not be blank.

Required string length: 1 - 1000
referenceImages
string<uri>[]

Image URLs that guide panorama generation. Only with prompt.

Maximum array length: 8
quality
enum<string>
default:low

Panorama generation quality. Only with prompt.

Available options:
low,
medium,
high
panoramaUri
string<uri>

URL of an existing 360° panorama to build the scene from. Not combinable with prompt, referenceImages, or quality.

Response

Scene task started.

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. A task stays readable for about 72 hours after it finishes.

id
string
required

Task ID, scn_{runId}.{sessionId}.

sessionId
string
required
operation
enum<string>
required

A custom-pano task reports pano.

Available options:
pano,
generate,
reconstruct
status
enum<string>
required
Available options:
queued,
processing,
ready,
failed,
cancelled
credits
number
required

Credits this task is charged: reserved at submission (1 per view the run handles, with a panorama counting as 6) and 0 once a task that did not finish ready is refunded.

Required range: x >= 0
createdAt
integer<int64> | null
required

Start time, Unix milliseconds.

completedAt
integer<int64> | null
required

End time, Unix milliseconds; null while queued or processing.

result
object | null
required

Set only when ready.

error
object | null
required

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).

queuePosition
integer

Only while queued: tasks waiting ahead of this one, 0 when it is next.

Required range: x >= 0