Stream an agent chat turn
POST
/api/agent/chat
const url = 'http://localhost:8080/api/agent/chat';const options = { method: 'POST', headers: {cookie: 'auth_session=<auth_session>', 'Content-Type': 'application/json'}, body: '{"additionalProperty":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/agent/chat \ --header 'Content-Type: application/json' \ --cookie auth_session=<auth_session> \ --data '{ "additionalProperty": "example" }'Runs an agent chat turn and streams the response using the Vercel AI SDK UI message stream protocol.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
key
additional properties
Example generated
{ "additionalProperty": "example"}Responses
Section titled “Responses”Streaming response (AI SDK UI message stream / SSE).
Media typetext/event-stream
string
Invalid request
Media typeapplication/json
object
success
boolean
error
string
Example
{ "error": "Error message"}Internal server error
Media typeapplication/json
object
success
boolean
error
string
Example
{ "error": "Error message"}