Skip to main content
POST
/
ai-agent
Run an AI agent
curl --request POST \
  --url https://app.myhero.so/ai-agent \
  --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>"
}
'
{
  "chatMessages": [
    {
      "type": "user",
      "text": "<string>",
      "metadata": {}
    }
  ]
}

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 returns the complete response as a chatMessages array. Use the streaming endpoint (/stream) when incremental output is preferred. 429 responses carry a gate message as a chatMessages array rather than an error object.

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

200 response

chatMessages
object[]
required