Skip to main content
POST
/
ai-agent
/
stream
Stream an AI agent
curl --request POST \
  --url https://app.myhero.so/ai-agent/stream \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chatMessages": [
    {
      "type": "user",
      "text": "<string>",
      "metadata": {}
    }
  ],
  "context": {
    "documentId": "<string>",
    "projectId": "<string>",
    "workspaceId": "<string>",
    "organizationId": "<string>",
    "mentions": [
      "<unknown>"
    ]
  },
  "options": {
    "provider": "<string>",
    "model": "<string>"
  },
  "attachments": [
    {
      "filename": "<string>",
      "mimeType": "<string>",
      "base64": "<string>",
      "size": 1
    }
  ],
  "sessionId": "<string>"
}
'
{
  "type": "delta",
  "data": "<unknown>"
}

Documentation Index

Fetch the complete documentation index at: https://developers.myhero.so/llms.txt

Use this file to discover all available pages before exploring further.

Runs the general AI agent and streams its response as Server-Sent Events over text/event-stream. Each event carries a type (delta, tool_call, tool_result, done, or error) and a per-type payload. The done event includes sessionId, hasUndo, and a changes summary of entities modified during the run.

Authorizations

Authorization
string
header
required

HERO personal access token

Body

application/json
chatMessages
object[]
required
Minimum array length: 1
context
object
options
object
attachments
object[]
sessionId
string

Response

SSE stream of EventStreamChunk events

type
enum<string>
required
Available options:
delta,
tool_call,
tool_result,
done,
error
data
any