Stream Answer
curl --request POST \
--url https://gateway.widebot.net/api/v1/RAG/Stream/Answer \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"Question": "اشرح لي تاريخ الحضارة المصرية القديمة",
"IndexNames": [
"Ancient_Egypt",
"Egyptian_History"
],
"Temperature": 0.3,
"MaxOutputTokens": 2048,
"IsStream": true
}
'import requests
url = "https://gateway.widebot.net/api/v1/RAG/Stream/Answer"
payload = {
"Question": "اشرح لي تاريخ الحضارة المصرية القديمة",
"IndexNames": ["Ancient_Egypt", "Egyptian_History"],
"Temperature": 0.3,
"MaxOutputTokens": 2048,
"IsStream": True
}
headers = {
"x-user-auth": "<api-key>",
"x-bot": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-auth': '<api-key>',
'x-bot': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Question: 'اشرح لي تاريخ الحضارة المصرية القديمة',
IndexNames: ['Ancient_Egypt', 'Egyptian_History'],
Temperature: 0.3,
MaxOutputTokens: 2048,
IsStream: true
})
};
fetch('https://gateway.widebot.net/api/v1/RAG/Stream/Answer', 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://gateway.widebot.net/api/v1/RAG/Stream/Answer",
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([
'Question' => 'اشرح لي تاريخ الحضارة المصرية القديمة',
'IndexNames' => [
'Ancient_Egypt',
'Egyptian_History'
],
'Temperature' => 0.3,
'MaxOutputTokens' => 2048,
'IsStream' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bot: <api-key>",
"x-user-auth: <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://gateway.widebot.net/api/v1/RAG/Stream/Answer"
payload := strings.NewReader("{\n \"Question\": \"اشرح لي تاريخ الحضارة المصرية القديمة\",\n \"IndexNames\": [\n \"Ancient_Egypt\",\n \"Egyptian_History\"\n ],\n \"Temperature\": 0.3,\n \"MaxOutputTokens\": 2048,\n \"IsStream\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-auth", "<api-key>")
req.Header.Add("x-bot", "<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://gateway.widebot.net/api/v1/RAG/Stream/Answer")
.header("x-user-auth", "<api-key>")
.header("x-bot", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Question\": \"اشرح لي تاريخ الحضارة المصرية القديمة\",\n \"IndexNames\": [\n \"Ancient_Egypt\",\n \"Egyptian_History\"\n ],\n \"Temperature\": 0.3,\n \"MaxOutputTokens\": 2048,\n \"IsStream\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.widebot.net/api/v1/RAG/Stream/Answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-auth"] = '<api-key>'
request["x-bot"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Question\": \"اشرح لي تاريخ الحضارة المصرية القديمة\",\n \"IndexNames\": [\n \"Ancient_Egypt\",\n \"Egyptian_History\"\n ],\n \"Temperature\": 0.3,\n \"MaxOutputTokens\": 2048,\n \"IsStream\": true\n}"
response = http.request(request)
puts response.read_body<string>Stream Answer
Streaming RAG answers for real-time response generation with document citations and progressive content delivery.
Key Features:
- Real-time answer streaming
- Progressive document retrieval
- Source citations in stream
- Lower latency for long answers
Note: Example requests/responses shown here are illustrative. When using the live “Try it” tool, you may see two responses: an HTTP status preview from the client and the API’s streaming output.
POST
/
api
/
v1
/
RAG
/
Stream
/
Answer
Stream Answer
curl --request POST \
--url https://gateway.widebot.net/api/v1/RAG/Stream/Answer \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"Question": "اشرح لي تاريخ الحضارة المصرية القديمة",
"IndexNames": [
"Ancient_Egypt",
"Egyptian_History"
],
"Temperature": 0.3,
"MaxOutputTokens": 2048,
"IsStream": true
}
'import requests
url = "https://gateway.widebot.net/api/v1/RAG/Stream/Answer"
payload = {
"Question": "اشرح لي تاريخ الحضارة المصرية القديمة",
"IndexNames": ["Ancient_Egypt", "Egyptian_History"],
"Temperature": 0.3,
"MaxOutputTokens": 2048,
"IsStream": True
}
headers = {
"x-user-auth": "<api-key>",
"x-bot": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-auth': '<api-key>',
'x-bot': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Question: 'اشرح لي تاريخ الحضارة المصرية القديمة',
IndexNames: ['Ancient_Egypt', 'Egyptian_History'],
Temperature: 0.3,
MaxOutputTokens: 2048,
IsStream: true
})
};
fetch('https://gateway.widebot.net/api/v1/RAG/Stream/Answer', 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://gateway.widebot.net/api/v1/RAG/Stream/Answer",
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([
'Question' => 'اشرح لي تاريخ الحضارة المصرية القديمة',
'IndexNames' => [
'Ancient_Egypt',
'Egyptian_History'
],
'Temperature' => 0.3,
'MaxOutputTokens' => 2048,
'IsStream' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-bot: <api-key>",
"x-user-auth: <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://gateway.widebot.net/api/v1/RAG/Stream/Answer"
payload := strings.NewReader("{\n \"Question\": \"اشرح لي تاريخ الحضارة المصرية القديمة\",\n \"IndexNames\": [\n \"Ancient_Egypt\",\n \"Egyptian_History\"\n ],\n \"Temperature\": 0.3,\n \"MaxOutputTokens\": 2048,\n \"IsStream\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-auth", "<api-key>")
req.Header.Add("x-bot", "<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://gateway.widebot.net/api/v1/RAG/Stream/Answer")
.header("x-user-auth", "<api-key>")
.header("x-bot", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Question\": \"اشرح لي تاريخ الحضارة المصرية القديمة\",\n \"IndexNames\": [\n \"Ancient_Egypt\",\n \"Egyptian_History\"\n ],\n \"Temperature\": 0.3,\n \"MaxOutputTokens\": 2048,\n \"IsStream\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.widebot.net/api/v1/RAG/Stream/Answer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-auth"] = '<api-key>'
request["x-bot"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Question\": \"اشرح لي تاريخ الحضارة المصرية القديمة\",\n \"IndexNames\": [\n \"Ancient_Egypt\",\n \"Egyptian_History\"\n ],\n \"Temperature\": 0.3,\n \"MaxOutputTokens\": 2048,\n \"IsStream\": true\n}"
response = http.request(request)
puts response.read_body<string>Authorizations
Body
application/json
Response
200 - text/event-stream
Streaming RAG response with progressive content and citations
Server-sent events with answer chunks and metadata
Was this page helpful?

