Skip to main content
POST
/
api
/
v1
/
AQL
/
stream
/
chat
/
completions
Stream Chat Completion
curl --request POST \
  --url https://gateway.widebot.net/api/v1/AQL/stream/chat/completions \
  --header 'Content-Type: application/json' \
  --header 'x-bot: <api-key>' \
  --header 'x-user-auth: <api-key>' \
  --data '
{
  "Message": "اكتب لي مقالاً قصيراً عن أهمية الذكاء الاصطناعي في التعليم",
  "Config": {
    "Temperature": 0.8,
    "MaxTokens": 2048
  },
  "PromptStyle": 5
}
'
"data: {\"chunk\": \"# أهمية الذكاء الاصطناعي في التعليم\\n\\n\"}\n\ndata: {\"chunk\": \"يشهد قطاع التعليم تطوراً\"}\n\ndata: {\"chunk\": \" مذهلاً بفضل تقنيات الذكاء الاصطناعي\"}\n\ndata: {\"final\": true, \"metadata\": {\"total_tokens\": 456}, \"consumption\": \"456/10000000\"}\n"

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
Message
string

The message to send to the AQL model

Example:

"ما هي عاصمة مصر وما أهم معالمها السياحية؟"

ChatHistory
object[]

Optional previous messages for context-aware conversations

Config
object

Configuration parameters for text generation

PromptStyle
integer

Style of response generation:

  • 0: Base (standard responses)
  • 1: Expert (technical/formal)
  • 2: Conversational (casual, dialogic)
  • 3: Structured (organized with sections)
  • 4: Concise (brief, to-the-point)
  • 5: Detailed (comprehensive explanations)
Required range: 0 <= x <= 5
Example:

3

Response

200 - text/event-stream

Streaming response via server-sent events

Server-sent events stream