Skip to main content
POST
Generate scene views
Generate new views of a session’s scene from a camera you place. The model reads the image batches you list in referenceBatchIds and renders new images as seen from the camera you give — a targetC2w matrix, or a targetPosition with yaw and pitch angles — which become a new generated batch in the session. Use them to fill in parts of the scene the existing views don’t cover, then pass the new batchId, together with the earlier ones, to Reconstruct Scene for an updated .spz. The request is asynchronous: it answers with a queued Scene Task; poll it until it finishes.
Pricing (1 credit = $0.01): 1 credit ($0.01) per new view — 1 credit with projection: perspective, 6 credits ($0.06) with projection: pano, since a panorama counts as 6 views — reserved when it is submitted and refunded in full unless it finishes ready. See Pricing.

Request parameters

Send application/json, up to 1 MiB. Unknown fields are rejected.
The easiest way to get a valid targetC2w is to start from a view’s c2w in a batch you already have and move or turn it. A camera close to the existing views gives the most consistent images.

Target position

targetPosition places the camera without writing a matrix. Send exactly one of targetC2w and targetPosition; sending both, or neither, is rejected. No other fields are accepted, and a null angle counts as 0. The angles use the same OpenGL convention as c2w: world +Y is up, and the camera looks down its own −Z axis with +X to its right. With yaw and pitch both 0 the camera looks down world −Z; yaw: 90 looks down −X, and pitch: 90 looks straight up. The request is turned into the targetC2w it stands for, with rotation R = Ry(yaw) · Rx(pitch) and position as the translation:
Roll isn’t expressible: the camera’s horizon stays level. Use targetC2w for a rolled camera.

Response parameters

Returns 200 OK with a queued (or already processing) Scene Task:
When it’s ready, result.outputBatch is the new generated batch, with every new image and its camera in views, and result.newViewCount is how many there are. result.spz is null — run Reconstruct Scene to fold the new views into the scene.

Common errors

A batch ID that’s well-formed but not from this session is caught by the model: the task starts and then fails with INVALID_REQUEST.

Examples

From a position and angles

The same session, with a camera at [0.5, 1.2, 0] turned 30° to the left and tilted 10° down:

Quick Start: Scene Model

See generate in 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

application/json

Body of POST /v1/scenes/generate. Send exactly one of targetC2w and targetPosition.

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"

referenceBatchIds
string[]
required

1–35 distinct batch IDs from the same session, as returned in result.outputBatch.batchId. A well-formed ID from another session fails the task with INVALID_REQUEST.

Required array length: 1 - 35 elements
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
targetC2w
number[][]

Camera to render from, in the frame of the views' c2w. Exactly one of targetC2w and targetPosition.

Required array length: 4 elements
Required array length: 4 elements
Example:
targetPosition
object

Camera as a position, yaw, and pitch. Exactly one of targetC2w and targetPosition.

Example:
projection
enum<string>
default:perspective

perspective for camera images, pano for a 360° panorama at the target camera.

Available options:
perspective,
pano
fov
number | null

Field of view in degrees. Omitted or null, the model's default.

Required range: 20 <= x <= 140
seed
integer<int64>
default:1
Required range: 0 <= x <= 4294967295

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