API reference
Use the Spacefolder HTTP API to create Worlds, Fold application events, and Navigate predictions with a workspace API key.
API conventions
Base URL: https://api.spacefolder.com/v1. /api/v1 is also accepted. Requests and responses use JSON.
Browse Worlds, Fold, and Navigate below, or download OpenAPI JSON. The domain schemas are generated from the Rust contracts used by the API and SDKs.
Authentication
Send Authorization: Bearer YOUR_API_KEY on each request. Obtain a workspace key in the platform. Keys grant workspace access until expiry or signing-key rotation; individual revocation is unavailable. Never distribute an operator/admin credential to users.
Create keys in the platform before making API requests. Each key is scoped to its workspace.
Requests
Create a World before folding or navigating. JSON request bodies are limited to 8 MiB. Use a batch size your application can retry comfortably. Keep event IDs stable when retrying Fold requests. Supply the same required nav_id for a recurring decision in a World. Each Navigate request creates its own run_id, including retries.
Navigate context
Every POST /navigate request requires a context JSON object containing the user or task information available at decision time. Keys are application-defined. Context describes the immediate situation alongside the World’s folded history; continue folding observed events and outcomes.
For example, a prediction without action alternatives can include the movie currently shown to a viewer:
{
"world_id": "my_app",
"nav_id": "watch_after_impression",
"entity_id": "user_123",
"context": {
"movie_id": "movie_456",
"screen": "movie_details"
},
"predictions": {
"watch": {
"event": "movie_watched",
"horizon": "1h"
}
}
}
When updating an older request, give the recurring decision a stable nav_id and add "context": {} if no decision-time information is available. This applies to HTTP, SDK, and CLI requests, including predictions without actions. Omitting context, passing null, or passing an array or scalar is invalid. See Context and the Navigate request schema.
Dates and times are RFC 3339 strings with a timezone, such as 2026-01-09T12:00:00Z. Elapsed times such as duration_ms are numbers.
Navigate confidence
Read confidence on each scored prediction under predictions or actions.<action>.predictions. A score is a number from 0 to 1, rounded to hundredths. It measures support from comparable World observations. For an event, probability estimates the likelihood of occurrence and confidence describes support for that estimate. A numeric series has one score for its least-supported interval.
Treat 0 as a valid score. A null or absent field carries no score. A saved run returns the original forecast and confidence along with the latest verification values. See Confidence.
Pagination
World listing uses limit (1–100) and a cursor from the previous page. Continue using next_cursor until it is null.
Fold and Navigate history require world_id. Each row identifies one run. Pass next_cursor back as cursor, keeping the World and any nav_id filter consistent. Read a saved result at GET /navigate/{id}. It returns the forecast with current verification values. Add ?trace=true to inspect its original execution.
Errors
| Status | Meaning |
|---|---|
| 400 / 422 | Invalid input, query, or unsupported request |
| 401 / 403 | Missing/invalid credentials or rejected access |
| 404 | Record not found |
| 409 | Conflict, inactive World, or permanently deleted World ID |
| 501 | No verified model runtime configured |
| 503 | Runtime, state, storage, or authentication dependency unavailable |
A non-successful response includes an explanation in its body. Error bodies vary by route: some use an error string, others an error object. Inspect the HTTP status and returned body. The SDKs preserve status and payload in SpacefolderApiError; CLI failures use JSON on stderr.
Deletion can return 202 while cleanup is in progress. Inspect state and retry the same confirmed deletion; a 202 is not proof cleanup has completed.
Agents
Read /llms.txt for the documentation index, /llms-full.txt for the full text, or append .md to a page URL. Use /spacefolder-api.openapi.json for the machine-readable API contract.
https://api.spacefolder.com/v1Worlds
- POSTCreate a world
/worlds - GETList worlds
/worlds - GETGet a world
/worlds/{id} - PATCHRename a world
/worlds/{id} - DELETEDelete a world
/worlds/{id}