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,
"ragIgnore": false,
"userTimezone": "America/New_York"
}
}
'import requests
url = "https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream"
payload = {
"inputs": ["What is machine learning?"],
"requestArgs": {
"institutionPublicId": "f831501f-b645-481a-9cbb-331509aaf8c1",
"assistantId": "6856fa89cbafcff8d98680f5",
"selectedCourse": {
"course_id": 1750532703472,
"course_name": "AI Fundamentals"
},
"ragOnly": False,
"ragIgnore": False,
"userTimezone": "America/New_York"
}
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: ['What is machine learning?'],
requestArgs: {
institutionPublicId: 'f831501f-b645-481a-9cbb-331509aaf8c1',
assistantId: '6856fa89cbafcff8d98680f5',
selectedCourse: {course_id: 1750532703472, course_name: 'AI Fundamentals'},
ragOnly: false,
ragIgnore: false,
userTimezone: 'America/New_York'
}
})
};
fetch('https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'What is machine learning?'
],
'requestArgs' => [
'institutionPublicId' => 'f831501f-b645-481a-9cbb-331509aaf8c1',
'assistantId' => '6856fa89cbafcff8d98680f5',
'selectedCourse' => [
'course_id' => 1750532703472,
'course_name' => 'AI Fundamentals'
],
'ragOnly' => false,
'ragIgnore' => false,
'userTimezone' => 'America/New_York'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream"
payload := strings.NewReader("{\n \"inputs\": [\n \"What is machine learning?\"\n ],\n \"requestArgs\": {\n \"institutionPublicId\": \"f831501f-b645-481a-9cbb-331509aaf8c1\",\n \"assistantId\": \"6856fa89cbafcff8d98680f5\",\n \"selectedCourse\": {\n \"course_id\": 1750532703472,\n \"course_name\": \"AI Fundamentals\"\n },\n \"ragOnly\": false,\n \"ragIgnore\": false,\n \"userTimezone\": \"America/New_York\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n \"What is machine learning?\"\n ],\n \"requestArgs\": {\n \"institutionPublicId\": \"f831501f-b645-481a-9cbb-331509aaf8c1\",\n \"assistantId\": \"6856fa89cbafcff8d98680f5\",\n \"selectedCourse\": {\n \"course_id\": 1750532703472,\n \"course_name\": \"AI Fundamentals\"\n },\n \"ragOnly\": false,\n \"ragIgnore\": false,\n \"userTimezone\": \"America/New_York\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n \"What is machine learning?\"\n ],\n \"requestArgs\": {\n \"institutionPublicId\": \"f831501f-b645-481a-9cbb-331509aaf8c1\",\n \"assistantId\": \"6856fa89cbafcff8d98680f5\",\n \"selectedCourse\": {\n \"course_id\": 1750532703472,\n \"course_name\": \"AI Fundamentals\"\n },\n \"ragOnly\": false,\n \"ragIgnore\": false,\n \"userTimezone\": \"America/New_York\"\n }\n}"
response = http.request(request)
puts response.read_body"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""data: {\"type\":\"error\",\"error\":{\"message\":\"Input text required\",\"status\":400}}\ndata: {\"type\":\"done\"}\n""data: {\"type\":\"error\",\"error\":{\"message\":\"Authentication Required\",\"status\":401}}\ndata: {\"type\":\"done\"}\n""data: {\"type\":\"error\",\"error\":{\"message\":\"Internal server error\",\"status\":500}}\ndata: {\"type\":\"done\"}\n"Conversation
Send a message with HTTP SSE streaming response
Alternative to Socket.IO streaming - uses standard HTTP Server-Sent Events (SSE). Ideal for server-side integrations, SDKs, and environments where WebSockets aren’t available.
Response Format
Returns text/event-stream; charset=utf-8 with SSE-formatted JSON chunks.
Each line is prefixed with data: followed by a JSON object and two newlines.
data: {"type":"connected","message":"Stream connected"}
data: {"type":"stream","prompt":"The capital","delta":"The capital"}
data: {"type":"stream","prompt":"The capital of France is Paris.","delta":" of France is Paris."}
data: {"type":"tool_call","call_id":"tooluse_abc123","name":"search_uploads","arguments":null,"displayInfo":{"icon":"search","label":"Searching documents"}}
data: {"type":"tool_result","call_id":"tooluse_abc123","name":"search_uploads","arguments":{"query":"France capital"},"response":"...","responseLength":512,"responseDurationMs":150,"success":true}
data: {"type":"complete","success":true,"usage":1234,"outputs":["The capital of France is Paris."],"model":"us.anthropic.claude-sonnet-4-5-20250929-v1:0","cached":0,"completion":42}
data: {"type":"done"}
Event Types
| Type | Description | Key Fields |
|---|---|---|
connected | Stream established | message |
stream | Text chunk from AI | prompt (cumulative), delta (incremental) |
tool_call | Tool invocation started | call_id, name, arguments, displayInfo |
tool_result | Tool execution completed | call_id, name, response, success, responseDurationMs |
complete | Final response with metrics | success, usage, outputs, model, cached, completion |
error | Processing error | error.message, error.status |
done | Stream ended | (none) |
Response Headers
Content-Type: text/event-stream; charset=utf-8
Cache-Control: no-cache, no-transform
Connection: keep-alive
Content-Encoding: none
Transfer-Encoding: chunked
X-Accel-Buffering: no
Cancellation
Close the HTTP connection to cancel the request. The server will detect the disconnect and abort any in-progress AI generation.
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,
"ragIgnore": false,
"userTimezone": "America/New_York"
}
}
'import requests
url = "https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream"
payload = {
"inputs": ["What is machine learning?"],
"requestArgs": {
"institutionPublicId": "f831501f-b645-481a-9cbb-331509aaf8c1",
"assistantId": "6856fa89cbafcff8d98680f5",
"selectedCourse": {
"course_id": 1750532703472,
"course_name": "AI Fundamentals"
},
"ragOnly": False,
"ragIgnore": False,
"userTimezone": "America/New_York"
}
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputs: ['What is machine learning?'],
requestArgs: {
institutionPublicId: 'f831501f-b645-481a-9cbb-331509aaf8c1',
assistantId: '6856fa89cbafcff8d98680f5',
selectedCourse: {course_id: 1750532703472, course_name: 'AI Fundamentals'},
ragOnly: false,
ragIgnore: false,
userTimezone: 'America/New_York'
}
})
};
fetch('https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputs' => [
'What is machine learning?'
],
'requestArgs' => [
'institutionPublicId' => 'f831501f-b645-481a-9cbb-331509aaf8c1',
'assistantId' => '6856fa89cbafcff8d98680f5',
'selectedCourse' => [
'course_id' => 1750532703472,
'course_name' => 'AI Fundamentals'
],
'ragOnly' => false,
'ragIgnore' => false,
'userTimezone' => 'America/New_York'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream"
payload := strings.NewReader("{\n \"inputs\": [\n \"What is machine learning?\"\n ],\n \"requestArgs\": {\n \"institutionPublicId\": \"f831501f-b645-481a-9cbb-331509aaf8c1\",\n \"assistantId\": \"6856fa89cbafcff8d98680f5\",\n \"selectedCourse\": {\n \"course_id\": 1750532703472,\n \"course_name\": \"AI Fundamentals\"\n },\n \"ragOnly\": false,\n \"ragIgnore\": false,\n \"userTimezone\": \"America/New_York\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"inputs\": [\n \"What is machine learning?\"\n ],\n \"requestArgs\": {\n \"institutionPublicId\": \"f831501f-b645-481a-9cbb-331509aaf8c1\",\n \"assistantId\": \"6856fa89cbafcff8d98680f5\",\n \"selectedCourse\": {\n \"course_id\": 1750532703472,\n \"course_name\": \"AI Fundamentals\"\n },\n \"ragOnly\": false,\n \"ragIgnore\": false,\n \"userTimezone\": \"America/New_York\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/ai/personal-stream/qanda-stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputs\": [\n \"What is machine learning?\"\n ],\n \"requestArgs\": {\n \"institutionPublicId\": \"f831501f-b645-481a-9cbb-331509aaf8c1\",\n \"assistantId\": \"6856fa89cbafcff8d98680f5\",\n \"selectedCourse\": {\n \"course_id\": 1750532703472,\n \"course_name\": \"AI Fundamentals\"\n },\n \"ragOnly\": false,\n \"ragIgnore\": false,\n \"userTimezone\": \"America/New_York\"\n }\n}"
response = http.request(request)
puts response.read_body"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""data: {\"type\":\"error\",\"error\":{\"message\":\"Input text required\",\"status\":400}}\ndata: {\"type\":\"done\"}\n""data: {\"type\":\"error\",\"error\":{\"message\":\"Authentication Required\",\"status\":401}}\ndata: {\"type\":\"done\"}\n""data: {\"type\":\"error\",\"error\":{\"message\":\"Internal server error\",\"status\":500}}\ndata: {\"type\":\"done\"}\n"Authorizations
JWT token passed in x-access-token header
Body
application/json
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.
Event type indicator:
connected: Stream established successfullystream: AI-generated text chunk (cumulative + delta)tool_call: Tool/function invocation started (RAG, web search, etc.)tool_result: Tool/function execution completed with resultscomplete: Final response with usage metrics and full outputerror: Error occurred during processingdone: Stream terminated — no more events will follow
Available options:
connected, stream, tool_call, tool_result, complete, error, done Was this page helpful?
Send a message to the AI assistantSend a message to the AI assistant (experimental — Soul Document prompt)
⌘I