Create and manage worlds
POST /v1/worlds is the primary generation endpoint. It accepts a discriminated input union, reserves credits, and returns 202 Accepted with a request_id (req_...). Notice the distinction between request (req_..., the asynchronous operation) and world (world.id, the generated 3D artifact UUID).
Endpoints
| Endpoint | Scope | Purpose |
|---|---|---|
POST /v1/worlds | worlds:create | Start an asynchronous world generation job. |
GET /v1/worlds/requests | worlds:read | List API-created world jobs on your account. |
GET /v1/worlds/requests/{request_id}/status | worlds:read | Poll lightweight job status (cached ~3s). |
GET /v1/worlds/requests/{request_id} | worlds:read | Fetch the full request and world result envelope. |
PATCH /v1/worlds/requests/{request_id} | worlds:write | Update title or visibility on a completed world. |
POST /v1/worlds/requests/{request_id}/cancel | worlds:write | Cancel a PENDING or PROCESSING job. |
DELETE /v1/worlds/requests/{request_id} | worlds:write | Permanently delete a finished, failed, or cancelled world and all its assets. |
Input types (Echo-2 and Echo HQ)
Every request passes model ("echo-2" or "echo-hq") and one input variant. For Echo-3 capture_bundle inputs, see Mobile capture.
1. Text prompt (type: "text")
{
"model": "echo-2",
"title": "Sunlit reading nook",
"input": {
"type": "text",
"prompt": "A sunlit Scandinavian reading nook with oak shelves, a linen armchair, and tall pine trees outside"
}
}
2. Image URL (type: "url")
Fetches a public https:// image (JPEG, PNG, WebP, or GIF, up to 25 MB). Query strings and fragments are stripped from stored metadata so presigned credentials are never echoed back.
{
"model": "echo-2",
"input": {
"type": "url",
"image_url": "https://example.com/room.jpg"
}
}
3. Uploaded file (type: "file_id")
References a file_... uploaded via POST /v1/files (supports files up to 100 MB, valid for 24 hours):
{
"model": "echo-2",
"input": {
"type": "file_id",
"file_id": "file_abc123"
}
}
4. Inline Base64 (type: "base64")
Accepts a data:image/...;base64,... URI (up to 25 MB after decoding):
{
"model": "echo-2",
"input": {
"type": "base64",
"image_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}
}
5. Equirectangular 360° panorama (is_pano: true)
Add "is_pano": true on any url, file_id, or base64 input when supplying a true 2:1 equirectangular 360° panorama. Suitability validation is skipped automatically, and credit cost drops by 45 credits (115 on Echo-2, 755 on Echo HQ):
{
"model": "echo-2",
"input": {
"type": "file_id",
"file_id": "file_pano123",
"is_pano": true
}
}
6. Edited panorama (type: "panorama_id")
Reconstructs a 3D world from a pano_... artifact returned by POST /v1/panoramas/edit:
{
"model": "echo-2",
"title": "Restyled courtyard",
"input": {
"type": "panorama_id",
"panorama_id": "pano_def456"
}
}
Request options
{
"model": "echo-2",
"input": { "type": "url", "image_url": "https://example.com/room.jpg" },
"title": "Living room",
"output_format": "spz",
"validation": { "skip": true, "error_on_fail": false },
"visibility": { "is_public": false, "is_listed": false },
"webhook": { "url": "https://your-server.example.com/webhooks/spaitial" }
}
| Field | Default | Description |
|---|---|---|
model | Required | Slug from GET /v1/models (echo-2, echo-hq, echo-3). |
title | Unset | Display title up to 200 characters. |
output_format | "spz" | Primary splat format served at /splat: "spz" (smallest), "sog" (PlayCanvas-ready, adds ~25s), or "ply" (standard uncompressed PLY). |
validation | { "skip": true, "error_on_fail": false } | Optional image suitability check. See Validation. |
visibility | { "is_public": false, "is_listed": false } | World privacy. is_listed: true requires is_public: true. |
webhook.url | Unset | Public https:// endpoint notified on terminal job and export events. See Webhooks. |
Idempotent submission
Send an Idempotency-Key header (for example a UUID v4) on POST /v1/worlds so network timeouts can be retried without creating duplicate jobs or double-charging credits:
curl -sX POST https://api.spaitial.ai/v1/worlds \
-H "Authorization: Bearer $SPAITIAL_API_KEY" \
-H "Idempotency-Key: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" \
-H "Content-Type: application/json" \
-d '{ "model": "echo-2", "input": { "type": "text", "prompt": "Cozy stone library" } }'
- Same key + identical body: Replays the original
202response without launching a second job. - Same key + different body: Rejects with
409 IDEMPOTENCY_KEY_REUSED. - To retry after a job ends as
FAILED, send a newIdempotency-Key.
Poll status and read the result
Poll GET /v1/worlds/requests/{request_id}/status every 5 to 10 seconds. Responses are cached for ~3 seconds:
{
"request_id": "req_abc123",
"status": "PROCESSING",
"progress": 0.45,
"estimated_duration_seconds": 522,
"error": null
}
Once status reaches COMPLETED, call GET /v1/worlds/requests/{request_id} for the full result:
{
"request_id": "req_abc123",
"model": "echo-2",
"status": "COMPLETED",
"created_at": "2026-11-20T12:00:00Z",
"updated_at": "2026-11-20T12:08:42Z",
"completed_at": "2026-11-20T12:08:42Z",
"world": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Living room",
"output_type": "splat",
"splat_url": "https://api.spaitial.ai/v1/worlds/requests/req_abc123/splat",
"splat_format": "spz",
"mesh": null,
"thumbnail_url": "https://img.spaitial.ai/.../thumbnail.webp",
"panorama_url": "https://api.spaitial.ai/v1/worlds/requests/req_abc123/panorama",
"viewer_url": "https://app.spaitial.ai/worlds/550e8400-e29b-41d4-a716-446655440000",
"cameras_url": null,
"visibility": { "is_public": false, "is_listed": false },
"camera": {
"hfov_deg": 103.93,
"roll_deg": 1.34,
"pitch_deg": -10.23
},
"created_at": "2026-11-20T12:00:01Z",
"updated_at": "2026-11-20T12:08:42Z",
"completed_at": "2026-11-20T12:08:42Z"
},
"validation": { "passed": true, "issues": [] },
"input": { "type": "url", "image_url": "https://example.com/room.jpg" },
"error": null
}
splat_url,panorama_url, andcameras_urlare permanent authenticated API proxy URLs. EachGETreturns a302redirect to a fresh 5-minute signed URL, so store the API URL in your database rather than the signed redirect target.camerareports the estimated horizontal field of view, roll, and pitch (in degrees) of a flat input image, ornullwhen starting from a panorama or capture.
Update, cancel, or delete
- Update metadata (
PATCH /v1/worlds/requests/{request_id}): Modifytitleorvisibilityon aCOMPLETEDworld (409 RESOURCE_NOT_READYwhile still running). - Cancel (
POST /v1/worlds/requests/{request_id}/cancel): Stops aPENDINGorPROCESSINGjob (409 REQUEST_NOT_CANCELLABLEonce terminal). Safe to retry. - Delete (
DELETE /v1/worlds/requests/{request_id}): Permanently removes the world, its uploaded input files, splats, panorama, thumbnails, and exports. Active jobs return409 RESOURCE_NOT_DELETABLE, so cancel them first.