Skip to main content
POST
/
api
/
ai
/
personal-stream
/
qanda-stream
Send a message with HTTP SSE streaming response
curl --request POST \
  --url https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "inputs": [
    "What is machine learning?"
  ],
  "requestArgs": {
    "institutionPublicId": "f831501f-b645-481a-9cbb-331509aaf8c1",
    "assistantId": "6856fa89cbafcff8d98680f5",
    "selectedCourse": {
      "course_id": 1750532703472,
      "course_name": "AI Fundamentals"
    },
    "ragOnly": false,
    "userTimezone": "America/New_York"
  }
}
'
"data: {\"type\":\"connected\",\"message\":\"Stream connected\"}\n\ndata: {\"type\":\"stream\",\"prompt\":\"Machine\",\"delta\":\"Machine\"}\n\ndata: {\"type\":\"stream\",\"prompt\":\"Machine learning is\",\"delta\":\" learning is\"}\n\ndata: {\"type\":\"stream\",\"prompt\":\"Machine learning is a branch of AI...\",\"delta\":\" a branch of AI...\"}\n\ndata: {\"type\":\"complete\",\"success\":true,\"usage\":1234,\"outputs\":[\"Machine learning is a branch of AI...\"],\"model\":\"us.anthropic.claude-sonnet-4-5-20250929-v1:0\",\"cached\":0,\"completion\":42}\n\ndata: {\"type\":\"done\"}\n"

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Body

application/json

Request payload for SSE streaming Q&A

inputs
string[]
required

User messages to send to the AI

Example:
["What is machine learning?"]
requestArgs
object

Optional context arguments

Response

SSE stream of AI response chunks

Server-Sent Event payload structure for HTTP streaming. Each event is a JSON object sent as data: {json}\n\n. The type field determines which other fields are present.

type
enum<string>

Event type indicator:

  • connected: Stream established successfully
  • stream: AI-generated text chunk (cumulative + delta)
  • tool_call: Tool/function invocation started (RAG, web search, etc.)
  • tool_result: Tool/function execution completed with results
  • complete: Final response with usage metrics and full output
  • error: Error occurred during processing
  • done: Stream terminated — no more events will follow
Available options:
connected,
stream,
tool_call,
tool_result,
complete,
error,
done