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.
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
Your API key from account settings
Your bot ID from account settings
Body
The question to answer using indexed documents
"ما هو الاسم الكامل لمحمد صلاح؟"
Names of document indexes to search (each matches a knowledge unit title). Required for the streaming endpoint; optional for the standard endpoint.
["Mohamed Salah"]
Number of document chunks to retrieve
1 <= x <= 5010
Maximum number of documents to process
1 <= x <= 5010
Controls creativity in answer generation
0 <= x <= 10.1
Maximum tokens in generated answer
1 <= x <= 40961024
Whether to update global context
false
Must be true for streaming responses
true
Response
Streaming RAG response with progressive content and citations
Server-sent events with answer chunks and metadata
Was this page helpful?

