(workspace × x-session-id) conversation is persisted server-side, and reusing the same x-session-id resumes it. Set statelessMode: true on the workspace to turn this off entirely — nothing about the conversation is stored, and the caller supplies prior turns on each request.
This is configured on the workspace endpoints (POST /api/v1/mcp/workspaces and PATCH /api/v1/mcp/workspaces/{id}). The environment (sandbox/production) is always derived from the API key — sk_test_* keys operate on sandbox, sk_live_* on production.
Want to route the workspace through your own LLM key and model as well? See the Bring Your Own LLM guide. The two controls are independent and can be combined on the same workspace.
Enable stateless mode
statelessMode is a workspace-level boolean (default false). It can also be set on create. It cannot be overridden per chat request.
What stops being stored
WhenstatelessMode is true, POST /api/v1/mcp/{workspaceId}/chat persists nothing:
- no chat session is created or looked up (the
x-session-idheader is ignored), - no messages are stored,
- no tool inputs/outputs are stored,
- no end-user context is written.
- Usage metadata (token and request counts) is still recorded for billing.
- Analytics events are content-free (no message text is captured).
contextis still injected into the agent for that request, but it is not stored.
Supplying history
Because nothing is persisted, the caller supplies prior turns on every request via thehistory array. The current message stays in the normal message field — history is prior turns only.
In stateless mode there is no per-conversation end-user identity, so tool/provider connections resolve at the workspace level — every stateless call to the workspace shares the same connections.