Demo API reference
Stateless, typed Nitro routes with validated inputs.
Stateless by design
All routes live under /api/demo. The server generates and validates records; visitor edits live in the browser. No function memory acts as a database. Invalid bodies return HTTP 400 and an errors array. Unknown auth actions return 404.
Bootstrap
GET /api/demo/bootstrap returns version 1 state: profile, workspaces, preferences, assistants, conversations, usage, recordings, and sessions. Faker uses seed 42 and a fixed reference date.
Chat and real-time
POST /api/demo/chat and POST /api/demo/realtime/turn accept prompt, workspaceId, preferences, optional assistant, and turn. They return message and usage. The client progressively reveals chat text; this is a simulated stream.
POST /api/demo/realtime/session accepts workspaceId and name and returns an empty session with a unique ID.
Editors
POST /api/demo/assistants/save accepts an assistant record and returns the validated record. POST /api/demo/settings/save accepts profile and preferences. Both use shared Yup schemas.
Audio
POST /api/demo/audio/transcribe accepts name, duration, mimeType, and workspaceId. It returns segments and simulated: true. It never accepts audio bytes.
Account flows
POST /api/demo/auth/login accepts email and password. Signup also accepts name. Both return a presentation-only profile. Forgot-password accepts email and returns a clearly labeled demo reset link. Reset-password accepts token and password. Logout returns success. No passwords are stored or emailed.
Example
{ "prompt": "Help me design onboarding", "workspaceId": "studio", "turn": 0, "preferences": { "modelId": "orbit-pro", "writingStyle": "concise", "format": "markdown", "temperature": 0.7, "maxTokens": 2048, "topP": 0.9 } }