curl --request POST \
--url https://cloud.onyx.app/api/chat/send-chat-message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"llm_override": {
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123
},
"allowed_tool_ids": [
123
],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": [
"<string>"
],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"deep_research": false,
"origin": "unset",
"parent_message_id": -1,
"chat_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_session_info": {
"persona_id": 0,
"description": "<string>",
"project_id": 123
},
"stream": true,
"include_citations": true,
"additional_context": "<string>"
}
'import requests
url = "https://cloud.onyx.app/api/chat/send-chat-message"
payload = {
"message": "<string>",
"llm_override": {
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123
},
"allowed_tool_ids": [123],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": ["<string>"],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"deep_research": False,
"origin": "unset",
"parent_message_id": -1,
"chat_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_session_info": {
"persona_id": 0,
"description": "<string>",
"project_id": 123
},
"stream": True,
"include_citations": True,
"additional_context": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
llm_override: {model_provider: '<string>', model_version: '<string>', temperature: 123},
allowed_tool_ids: [123],
forced_tool_id: 123,
file_descriptors: [],
internal_search_filters: {
source_type: [],
document_set: ['<string>'],
time_cutoff: '2023-11-07T05:31:56Z',
tags: [{tag_key: '<string>', tag_value: '<string>'}]
},
deep_research: false,
origin: 'unset',
parent_message_id: -1,
chat_session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
chat_session_info: {persona_id: 0, description: '<string>', project_id: 123},
stream: true,
include_citations: true,
additional_context: '<string>'
})
};
fetch('https://cloud.onyx.app/api/chat/send-chat-message', 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://cloud.onyx.app/api/chat/send-chat-message",
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([
'message' => '<string>',
'llm_override' => [
'model_provider' => '<string>',
'model_version' => '<string>',
'temperature' => 123
],
'allowed_tool_ids' => [
123
],
'forced_tool_id' => 123,
'file_descriptors' => [
],
'internal_search_filters' => [
'source_type' => [
],
'document_set' => [
'<string>'
],
'time_cutoff' => '2023-11-07T05:31:56Z',
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
]
],
'deep_research' => false,
'origin' => 'unset',
'parent_message_id' => -1,
'chat_session_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'chat_session_info' => [
'persona_id' => 0,
'description' => '<string>',
'project_id' => 123
],
'stream' => true,
'include_citations' => true,
'additional_context' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://cloud.onyx.app/api/chat/send-chat-message"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"llm_override\": {\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123\n },\n \"allowed_tool_ids\": [\n 123\n ],\n \"forced_tool_id\": 123,\n \"file_descriptors\": [],\n \"internal_search_filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"deep_research\": false,\n \"origin\": \"unset\",\n \"parent_message_id\": -1,\n \"chat_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"chat_session_info\": {\n \"persona_id\": 0,\n \"description\": \"<string>\",\n \"project_id\": 123\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://cloud.onyx.app/api/chat/send-chat-message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"llm_override\": {\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123\n },\n \"allowed_tool_ids\": [\n 123\n ],\n \"forced_tool_id\": 123,\n \"file_descriptors\": [],\n \"internal_search_filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"deep_research\": false,\n \"origin\": \"unset\",\n \"parent_message_id\": -1,\n \"chat_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"chat_session_info\": {\n \"persona_id\": 0,\n \"description\": \"<string>\",\n \"project_id\": 123\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.onyx.app/api/chat/send-chat-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"llm_override\": {\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123\n },\n \"allowed_tool_ids\": [\n 123\n ],\n \"forced_tool_id\": 123,\n \"file_descriptors\": [],\n \"internal_search_filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"deep_research\": false,\n \"origin\": \"unset\",\n \"parent_message_id\": -1,\n \"chat_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"chat_session_info\": {\n \"persona_id\": 0,\n \"description\": \"<string>\",\n \"project_id\": 123\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Handle Send Chat Message
This endpoint is used to send a new chat message.
Args: chat_message_req (SendMessageRequest): Details about the new chat message.
- When stream=True (default): Returns StreamingResponse with SSE
- When stream=False: Returns ChatFullResponse with complete data request (Request): The current HTTP request context. user (User | None): The current user, obtained via dependency injection. _ (None): Rate limit check is run if user/group/global rate limits are enabled.
Returns: StreamingResponse | ChatFullResponse: Either streams or returns complete response.
curl --request POST \
--url https://cloud.onyx.app/api/chat/send-chat-message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"llm_override": {
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123
},
"allowed_tool_ids": [
123
],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": [
"<string>"
],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"deep_research": false,
"origin": "unset",
"parent_message_id": -1,
"chat_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_session_info": {
"persona_id": 0,
"description": "<string>",
"project_id": 123
},
"stream": true,
"include_citations": true,
"additional_context": "<string>"
}
'import requests
url = "https://cloud.onyx.app/api/chat/send-chat-message"
payload = {
"message": "<string>",
"llm_override": {
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123
},
"allowed_tool_ids": [123],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": ["<string>"],
"time_cutoff": "2023-11-07T05:31:56Z",
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
]
},
"deep_research": False,
"origin": "unset",
"parent_message_id": -1,
"chat_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chat_session_info": {
"persona_id": 0,
"description": "<string>",
"project_id": 123
},
"stream": True,
"include_citations": True,
"additional_context": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
message: '<string>',
llm_override: {model_provider: '<string>', model_version: '<string>', temperature: 123},
allowed_tool_ids: [123],
forced_tool_id: 123,
file_descriptors: [],
internal_search_filters: {
source_type: [],
document_set: ['<string>'],
time_cutoff: '2023-11-07T05:31:56Z',
tags: [{tag_key: '<string>', tag_value: '<string>'}]
},
deep_research: false,
origin: 'unset',
parent_message_id: -1,
chat_session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
chat_session_info: {persona_id: 0, description: '<string>', project_id: 123},
stream: true,
include_citations: true,
additional_context: '<string>'
})
};
fetch('https://cloud.onyx.app/api/chat/send-chat-message', 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://cloud.onyx.app/api/chat/send-chat-message",
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([
'message' => '<string>',
'llm_override' => [
'model_provider' => '<string>',
'model_version' => '<string>',
'temperature' => 123
],
'allowed_tool_ids' => [
123
],
'forced_tool_id' => 123,
'file_descriptors' => [
],
'internal_search_filters' => [
'source_type' => [
],
'document_set' => [
'<string>'
],
'time_cutoff' => '2023-11-07T05:31:56Z',
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
]
],
'deep_research' => false,
'origin' => 'unset',
'parent_message_id' => -1,
'chat_session_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'chat_session_info' => [
'persona_id' => 0,
'description' => '<string>',
'project_id' => 123
],
'stream' => true,
'include_citations' => true,
'additional_context' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://cloud.onyx.app/api/chat/send-chat-message"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"llm_override\": {\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123\n },\n \"allowed_tool_ids\": [\n 123\n ],\n \"forced_tool_id\": 123,\n \"file_descriptors\": [],\n \"internal_search_filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"deep_research\": false,\n \"origin\": \"unset\",\n \"parent_message_id\": -1,\n \"chat_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"chat_session_info\": {\n \"persona_id\": 0,\n \"description\": \"<string>\",\n \"project_id\": 123\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://cloud.onyx.app/api/chat/send-chat-message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"llm_override\": {\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123\n },\n \"allowed_tool_ids\": [\n 123\n ],\n \"forced_tool_id\": 123,\n \"file_descriptors\": [],\n \"internal_search_filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"deep_research\": false,\n \"origin\": \"unset\",\n \"parent_message_id\": -1,\n \"chat_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"chat_session_info\": {\n \"persona_id\": 0,\n \"description\": \"<string>\",\n \"project_id\": 123\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.onyx.app/api/chat/send-chat-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\",\n \"llm_override\": {\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123\n },\n \"allowed_tool_ids\": [\n 123\n ],\n \"forced_tool_id\": 123,\n \"file_descriptors\": [],\n \"internal_search_filters\": {\n \"source_type\": [],\n \"document_set\": [\n \"<string>\"\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ]\n },\n \"deep_research\": false,\n \"origin\": \"unset\",\n \"parent_message_id\": -1,\n \"chat_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"chat_session_info\": {\n \"persona_id\": 0,\n \"description\": \"<string>\",\n \"project_id\": 123\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Authorization header with Bearer token
Body
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Origin of a chat message for telemetry tracking.
webapp, chrome_extension, api, slackbot, widget, unknown, unset Show child attributes
Show child attributes
A string of extra context injected into the LLM call for this request. The context is passed to the model but is not stored in the database and will not appear in the chat history. Use this to supply ephemeral, request-scoped information (e.g. the user's current page URL, session metadata, or any runtime context) without polluting the persistent conversation history. Pass null or omit the field to use no additional context.
Response
Successful Response