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_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
},
"llm_overrides": [
{
"model_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
}
],
"allowed_tool_ids": [
123
],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": [
"<string>"
],
"created_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"updated_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z"
},
"deep_research": false,
"mcp_headers": {},
"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,
"incognito": false,
"incognito_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"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_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
},
"llm_overrides": [
{
"model_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
}
],
"allowed_tool_ids": [123],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": ["<string>"],
"created_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"updated_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z"
},
"deep_research": False,
"mcp_headers": {},
"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,
"incognito": False,
"incognito_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"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_configuration_id: 123,
model_provider: '<string>',
model_version: '<string>',
temperature: 123,
display_name: '<string>'
},
llm_overrides: [
{
model_configuration_id: 123,
model_provider: '<string>',
model_version: '<string>',
temperature: 123,
display_name: '<string>'
}
],
allowed_tool_ids: [123],
forced_tool_id: 123,
file_descriptors: [],
internal_search_filters: {
source_type: [],
document_set: ['<string>'],
created_at_range: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
updated_at_range: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
tags: [{tag_key: '<string>', tag_value: '<string>'}],
time_cutoff: '2023-11-07T05:31:56Z'
},
deep_research: false,
mcp_headers: {},
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,
incognito: false,
incognito_session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
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_configuration_id' => 123,
'model_provider' => '<string>',
'model_version' => '<string>',
'temperature' => 123,
'display_name' => '<string>'
],
'llm_overrides' => [
[
'model_configuration_id' => 123,
'model_provider' => '<string>',
'model_version' => '<string>',
'temperature' => 123,
'display_name' => '<string>'
]
],
'allowed_tool_ids' => [
123
],
'forced_tool_id' => 123,
'file_descriptors' => [
],
'internal_search_filters' => [
'source_type' => [
],
'document_set' => [
'<string>'
],
'created_at_range' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'updated_at_range' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
],
'time_cutoff' => '2023-11-07T05:31:56Z'
],
'deep_research' => false,
'mcp_headers' => [
],
'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,
'incognito' => false,
'incognito_session_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'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_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n },\n \"llm_overrides\": [\n {\n \"model_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n }\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 \"created_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"updated_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\"\n },\n \"deep_research\": false,\n \"mcp_headers\": {},\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 \"incognito\": false,\n \"incognito_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n },\n \"llm_overrides\": [\n {\n \"model_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n }\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 \"created_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"updated_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\"\n },\n \"deep_research\": false,\n \"mcp_headers\": {},\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 \"incognito\": false,\n \"incognito_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n },\n \"llm_overrides\": [\n {\n \"model_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n }\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 \"created_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"updated_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\"\n },\n \"deep_research\": false,\n \"mcp_headers\": {},\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 \"incognito\": false,\n \"incognito_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"answer_citationless": "<string>",
"top_documents": [
{
"document_id": "<string>",
"chunk_ind": 123,
"semantic_identifier": "<string>",
"blurb": "<string>",
"source_type": "ingestion_api",
"boost": 123,
"hidden": true,
"metadata": {},
"match_highlights": [
"<string>"
],
"link": "<string>",
"score": 123,
"is_relevant": true,
"relevance_explanation": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"primary_owners": [
"<string>"
],
"secondary_owners": [
"<string>"
],
"is_internet": false,
"file_id": "<string>"
}
],
"citation_info": [
{
"citation_number": 123,
"document_id": "<string>",
"type": "citation_info"
}
],
"message_id": 123,
"pre_answer_reasoning": "<string>",
"tool_calls": [],
"chat_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"incognito": false,
"error_msg": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}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): 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_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
},
"llm_overrides": [
{
"model_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
}
],
"allowed_tool_ids": [
123
],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": [
"<string>"
],
"created_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"updated_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z"
},
"deep_research": false,
"mcp_headers": {},
"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,
"incognito": false,
"incognito_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"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_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
},
"llm_overrides": [
{
"model_configuration_id": 123,
"model_provider": "<string>",
"model_version": "<string>",
"temperature": 123,
"display_name": "<string>"
}
],
"allowed_tool_ids": [123],
"forced_tool_id": 123,
"file_descriptors": [],
"internal_search_filters": {
"source_type": [],
"document_set": ["<string>"],
"created_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"updated_at_range": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z"
},
"deep_research": False,
"mcp_headers": {},
"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,
"incognito": False,
"incognito_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"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_configuration_id: 123,
model_provider: '<string>',
model_version: '<string>',
temperature: 123,
display_name: '<string>'
},
llm_overrides: [
{
model_configuration_id: 123,
model_provider: '<string>',
model_version: '<string>',
temperature: 123,
display_name: '<string>'
}
],
allowed_tool_ids: [123],
forced_tool_id: 123,
file_descriptors: [],
internal_search_filters: {
source_type: [],
document_set: ['<string>'],
created_at_range: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
updated_at_range: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
tags: [{tag_key: '<string>', tag_value: '<string>'}],
time_cutoff: '2023-11-07T05:31:56Z'
},
deep_research: false,
mcp_headers: {},
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,
incognito: false,
incognito_session_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
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_configuration_id' => 123,
'model_provider' => '<string>',
'model_version' => '<string>',
'temperature' => 123,
'display_name' => '<string>'
],
'llm_overrides' => [
[
'model_configuration_id' => 123,
'model_provider' => '<string>',
'model_version' => '<string>',
'temperature' => 123,
'display_name' => '<string>'
]
],
'allowed_tool_ids' => [
123
],
'forced_tool_id' => 123,
'file_descriptors' => [
],
'internal_search_filters' => [
'source_type' => [
],
'document_set' => [
'<string>'
],
'created_at_range' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'updated_at_range' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
],
'time_cutoff' => '2023-11-07T05:31:56Z'
],
'deep_research' => false,
'mcp_headers' => [
],
'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,
'incognito' => false,
'incognito_session_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'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_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n },\n \"llm_overrides\": [\n {\n \"model_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n }\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 \"created_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"updated_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\"\n },\n \"deep_research\": false,\n \"mcp_headers\": {},\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 \"incognito\": false,\n \"incognito_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n },\n \"llm_overrides\": [\n {\n \"model_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n }\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 \"created_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"updated_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\"\n },\n \"deep_research\": false,\n \"mcp_headers\": {},\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 \"incognito\": false,\n \"incognito_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n },\n \"llm_overrides\": [\n {\n \"model_configuration_id\": 123,\n \"model_provider\": \"<string>\",\n \"model_version\": \"<string>\",\n \"temperature\": 123,\n \"display_name\": \"<string>\"\n }\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 \"created_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"updated_at_range\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\"\n },\n \"deep_research\": false,\n \"mcp_headers\": {},\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 \"incognito\": false,\n \"incognito_session_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"stream\": true,\n \"include_citations\": true,\n \"additional_context\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"answer": "<string>",
"answer_citationless": "<string>",
"top_documents": [
{
"document_id": "<string>",
"chunk_ind": 123,
"semantic_identifier": "<string>",
"blurb": "<string>",
"source_type": "ingestion_api",
"boost": 123,
"hidden": true,
"metadata": {},
"match_highlights": [
"<string>"
],
"link": "<string>",
"score": 123,
"is_relevant": true,
"relevance_explanation": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"primary_owners": [
"<string>"
],
"secondary_owners": [
"<string>"
],
"is_internet": false,
"file_id": "<string>"
}
],
"citation_info": [
{
"citation_number": 123,
"document_id": "<string>",
"type": "citation_info"
}
],
"message_id": 123,
"pre_answer_reasoning": "<string>",
"tool_calls": [],
"chat_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"incognito": false,
"error_msg": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}write:chat), which basic includes, so any signed-in user has it.
A limited Personal Access Token needs the Chat — Write scope.
A service account in no group also holds it. Anonymous users can call this when anonymous access is enabled.llm_overrides with more than one entry runs the models in parallel and
requires stream=true; combining it with stream=false returns 400 {"error_code": "INVALID_INPUT"}.
A single-entry llm_overrides list is ignored — use llm_override for an ordinary single-model override.Authorizations
Authorization header with Bearer token
Body
Per-request LLM settings that override persona defaults.
All fields are optional — only the fields that differ from the persona's configured LLM need to be supplied. Used both over the wire (API requests) and for multi-model comparison, where one override is supplied per model.
Attributes:
model_configuration_id: Exact model configuration to use. Preferred
over the name-based fields — provider display names are not
unique, so only the id routes unambiguously.
model_provider: LLM provider display name. When None, the
persona's default provider is used.
model_version: Specific model version string (e.g. "gpt-4o").
When None, the persona's default model is used.
temperature: Sampling temperature in [0, 2]. When None, the
persona's default temperature is used.
display_name: Human-readable label shown in the UI for this model,
e.g. "GPT-4 Turbo". Optional; falls back to model_version
when not set.
Show child attributes
Show child attributes
Two or three LLM overrides to run in parallel (multi-model mode), one entry per model. Requires stream=true: a request carrying more than one entry with stream=false is rejected with a 400 INVALID_INPUT error. A list with a single entry is ignored — use llm_override to change the model for an ordinary single-model request.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Headers forwarded to MCP tool calls made while answering this message, e.g. {"Authorization": "Bearer <user_jwt>", "X-User-ID": "user123"}. Use this to pass end-user credentials through to MCP servers that require them.
Show child attributes
Show child attributes
Origin of a chat message for telemetry tracking.
webapp, chrome_extension, api, slackbot, widget, discordbot, mobile, 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
If stream=true, returns text/event-stream.
If stream=false, returns application/json (ChatFullResponse).
Complete non-streaming response with all available data.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?