Skip to main content
POST
/
api
/
chat
/
stream
Stream a chat run over server-sent events.
curl --request POST \
  --url https://openagents.com/api/chat/stream \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "content": "<string>",
      "id": "<string>",
      "parts": [
        {
          "text": "<string>",
          "type": "<string>"
        }
      ],
      "role": "user"
    }
  ]
}
'
"data: {\"type\":\"start\"}\n\ndata: [DONE]\n\n"

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Full client-side message history; backend executes using the latest user message. L402 tool contract: maxSpendMsats is canonical (maxSpendSats temporary alias) and requireApproval is canonical (approvalRequired temporary alias).

messages
object[]
required

Response

Server-sent event stream (Vercel AI data stream protocol)

The response is of type string.

Example:

"data: {\"type\":\"start\"}\n\ndata: [DONE]\n\n"