Skip to main content
POST
/
api
/
v1
/
RAG
/
Answer
Answer Question
curl --request POST \
  --url https://gateway.widebot.net/api/v1/RAG/Answer \
  --header 'Content-Type: application/json' \
  --header 'x-bot: <api-key>' \
  --header 'x-user-auth: <api-key>' \
  --data '
{
  "Question": "ما هو الاسم الكامل لمحمد صلاح؟",
  "IndexNames": [
    "Mohamed Salah"
  ],
  "Limit": 10,
  "Temperature": 0.1,
  "MaxOutputTokens": 1024,
  "IsStream": false
}
'
{
  "StatusCode": 200,
  "Response": {
    "answer": "محمد صلاح حامد محروس غالي",
    "chat_history": "<array>",
    "retrieved_documents": [
      {
        "text": "<string>",
        "score": 123,
        "metadata": {
          "file_id": "<string>",
          "Section Title": "<string>"
        }
      }
    ]
  },
  "Consumption": "3600/10000000"
}

Authorizations

x-user-auth
string
header
required

Your API key from account settings

x-bot
string
header
required

Your bot ID from account settings

Body

application/json
Question
string
required

The question to answer using indexed documents

Example:

"ما هو الاسم الكامل لمحمد صلاح؟"

IndexNames
string[]

Names of document indexes to search

Example:
["Mohamed Salah"]
Limit
integer

Number of document chunks to retrieve

Required range: 1 <= x <= 50
Example:

10

MaxLimit
integer

Maximum number of documents to process

Required range: 1 <= x <= 50
Example:

10

Temperature
number<float>

Controls creativity in answer generation

Required range: 0 <= x <= 1
Example:

0.1

MaxOutputTokens
integer

Maximum tokens in generated answer

Required range: 1 <= x <= 4096
Example:

1024

UpdateGlobal
boolean

Whether to update global context

Example:

false

IsStream
boolean

Whether to stream the response

Example:

false

Response

200 - application/json

RAG answer with retrieved documents and sources

StatusCode
integer
Example:

200

Response
object
Consumption
string

Usage tracking

Example:

"3600/10000000"