Start Chat Run
Start an asynchronous, headless chat-generation run on the durable agent workflow — the same engine as interactive POST /api/chat.
Related endpoints
POST /api/chat— use that for interactive, streaming turns on an existing chat; use this for headless/programmatic runs (no browser or pre-provisioned session needed).GET /api/chat/runs/{runId}— poll to learn whether the run finished (and if it succeeded).GET /api/chat/{chatId}/stream— watch the output live by passing the returnedchatId.
Authorizations
Your Recoup API key. Learn more.
Body
Chat generation request
Request body for chat generation. Exactly one of 'prompt' or 'messages' must be provided.
Single text prompt for the assistant. Required if 'messages' is not provided.
Array of UIMessage objects for context. Required if 'prompt' is not provided.
The unique identifier of the artist (optional)
The AI model to use for text generation (optional)
"openai/gpt-5-mini"
Response
Run accepted. A durable workflow run was started; runId identifies it. chatId / sessionId identify the persisted output — read the result via GET /api/chat/{chatId}/stream (resume the stream) or the chat's persisted messages. Poll GET /api/chat/runs/{runId} for status.
Confirmation that an asynchronous chat-generation run has been started on the durable agent workflow.
Durable workflow run id for the started generation. Same identifier surfaced as the x-workflow-run-id header on interactive POST /api/chat.
"wrun_01KVWZNM82NA7XKNEWWHG8VPHJ"
Chat the run writes its assistant messages to. Use with GET /api/chat/{chatId}/stream to resume the stream, or to fetch the persisted messages.
"24830c6c-76d8-43be-ae22-1dfd545421ab"
Session (workspace + sandbox) provisioned for the run.
"fa9c1516-35f0-4efd-a62c-01af26324e72"
