Skip to main content
POST

Request Body

agent_id
string
required
Target agent ID (ag_*)
message
string
required
User message text
session_id
string
Session ID for conversation memory. Reuse to continue a conversation
stream
boolean
default:"false"
Enable streaming response (use Stream endpoint instead)
metadata
object
default:"null"
Additional context passed to the agent (e.g., user info, page URL)

Response 200

Response Fields

response
string
Agent’s text response
session_id
string
Session ID — reuse for follow-up messages
usage.input_tokens
integer
Tokens consumed by the prompt
usage.output_tokens
integer
Tokens in the agent’s response
usage.total_tokens
integer
Total tokens consumed (billed)
tool_calls
array
Tools the agent invoked during this response

Example with Metadata


Errors

Authorizations

Authorization
string
header
required

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

Headers

origin
string | null

Body

application/json

Request schema for embed chat messages.

publish_id
string
required
message
string
required
session_id
string | null

Response

Successful Response