Skip to content

Start a generation that outlives the page that asked for it.

POST
/api/runs
curl --request POST \
--url http://localhost:5173/api/runs \
--cookie authjs.session-token=<authjs.session-token>

Returns as soon as the run has an identity, not when the model has answered: the turn then belongs to the server, which writes what it produces into the conversation, and the client follows it over the event stream to draw it. A client never has to store what a run produced, and must not: the stream is what the turn looks like, not where it is kept. The conversation must already exist, which is what makes the question older than the answer. Answers 409 with the existing run when the conversation already has one going.

The run that was started.

No such conversation.

That conversation is already generating.