Skip to main content
POST
/
chat
curl --request POST \
  --url https://asteragents.com/api/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agentId": 123,
  "message": {
    "role": "user",
    "parts": [
      {
        "type": "text",
        "text": "Summarize the latest quarterly report."
      }
    ]
  }
}
'
"<string>"

Authorizations

Authorization
string
header
required

JWT token from Clerk authentication.

Must be from a user with org:admin role.

Headers

X-Stream-Response
enum<string>

Set to false for the non-streaming 202 + poll pattern. Any other value (or omitted) streams an SSE response.

Available options:
false
Example:

"false"

Body

application/json
agentId
integer
required

ID of the agent to invoke (must belong to your organization).

Example:

123

message
object
required

The user message in v5 format.

threadId
string<uuid> | null

Existing conversation thread to continue. Omit to start a new conversation.

Example:

"550e8400-e29b-41d4-a716-446655440000"

timezone
string | null

IANA timezone used when rendering date/time prompt variables (e.g. "America/New_York").

Response

Streaming mode (header omitted). A Server-Sent Events stream of the AI SDK UI-message protocol. The X-Thread-ID header carries the thread ID.

The response is of type string.