Stream Chat (Workflow + Sandbox)
Streams an agent loop running as a durable Vercel Workflow against the session’s sandbox. The agent uses sandbox-only tools (bash, read, write, grep, glob, todo, task, ask_user_question, skill, fetch) — no MCP or Composio. Requires a sandbox provisioned via POST /api/sandbox. Parallel to POST /api/chat — does not replace it.
Documentation Index
Fetch the complete documentation index at: https://developers.recoupable.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Your Recoup API key. Learn more.
Body
Chat workflow request
Request body for the sandbox-driven, Workflow-backed chat endpoint. Requires an existing session, chat, and provisioned sandbox. The Bearer key from the Authorization header is forwarded into the sandbox for skill-based callbacks to the Recoup API — no separate access-token field needed.
Conversation history as an array of UIMessage objects, matching the Vercel AI SDK UIMessage shape. The last entry is typically the new user turn — the agent loop reads the entire array and persists the latest user message before the workflow starts.
UUID of an existing chat under sessionId. The chat's active_stream_id column is used for compare-and-set race control across concurrent requests.
UUID of the session that owns both the chat and the sandbox. The session must have a non-null sandbox_state — call POST /api/sandbox first if not.
Optional per-prompt context overrides forwarded into the agent loop.
Response
Server-Sent Events stream of UI message parts compatible with the Vercel AI SDK createUIMessageStreamResponse. The x-workflow-run-id response header carries the durable workflow run ID for resume/stop operations.
Server-Sent Events stream containing UI message parts
