Skip to main content
POST
/
v1
/
chat
/
chat
/
sessions
/
{sessionId}
/
messages
Send message
curl --request POST \
  --url https://api.agntix.ai/v1/chat/chat/sessions/{sessionId}/messages \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "content": "What is my current subscription plan?",
  "stream": true
}
'
"<string>"
Every endpoint on this page requires either a Clerk-issued JWT (Authorization: Bearer <token>) or an organization API key (x-api-key: pk_…). Anonymous calls return 401 Unauthorized. See Authentication for the full setup.

Streaming vs. non-streaming

By default ("stream": true), the agent’s reply is delivered as a Server-Sent Events stream. Set "stream": false to receive a single JSON response when you don’t need incremental rendering.

Code examples

curl -X POST https://api.agntix.ai/v1/chat/chat/sessions/ses_01j3m8xkqp8v2nw4f7g9hk0r/messages \
  -H "x-api-key: pk_live_••••" \
  -H "Content-Type: application/json" \
  --no-buffer \
  -d '{ "content": "What is my current subscription plan?", "stream": true }'

SSE stream format

When stream: true, the response is Content-Type: text/event-stream. Each event:
data: {"id":"msg_01j3m","delta":"Your "}

data: {"id":"msg_01j3m","delta":"plan is Pro."}

data: [DONE]
The stream ends with the literal data: [DONE] sentinel.

Non-streaming response

{
  "id": "msg_01j3m...",
  "content": "Your current plan is Pro.",
  "role": "ASSISTANT",
  "createdAt": "2026-04-29T09:10:00Z"
}

Authorizations

x-api-key
string
header
required

Organization API key. Obtain from the dashboard. Format: pk_live_…

Path Parameters

sessionId
string
required

Body

application/json
content
string
required

The user's message.

Example:

"What is my current subscription plan?"

stream
boolean
default:true

Stream the response over SSE. Set false for a single JSON response.

Response

Assistant reply (SSE stream when stream: true, JSON object when stream: false).

The response is of type string.