Skip to main content
POST
/
ai
/
{v}
/
message
/
kallm
Post message KaLLM (deprecated)
curl --request POST \
  --url https://platform.ai.gloo.com/ai/{v}/message/kallm \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chat_id": "",
  "query": "What is your name?",
  "character_limit": 123,
  "sources_limit": 10,
  "stream": false,
  "publishers": []
}
'
import requests

url = "https://platform.ai.gloo.com/ai/{v}/message/kallm"

payload = {
"chat_id": "",
"query": "What is your name?",
"character_limit": 123,
"sources_limit": 10,
"stream": False,
"publishers": []
}
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({
chat_id: '',
query: 'What is your name?',
character_limit: 123,
sources_limit: 10,
stream: false,
publishers: []
})
};

fetch('https://platform.ai.gloo.com/ai/{v}/message/kallm', 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://platform.ai.gloo.com/ai/{v}/message/kallm",
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([
'chat_id' => '',
'query' => 'What is your name?',
'character_limit' => 123,
'sources_limit' => 10,
'stream' => false,
'publishers' => [

]
]),
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://platform.ai.gloo.com/ai/{v}/message/kallm"

payload := strings.NewReader("{\n \"chat_id\": \"\",\n \"query\": \"What is your name?\",\n \"character_limit\": 123,\n \"sources_limit\": 10,\n \"stream\": false,\n \"publishers\": []\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://platform.ai.gloo.com/ai/{v}/message/kallm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chat_id\": \"\",\n \"query\": \"What is your name?\",\n \"character_limit\": 123,\n \"sources_limit\": 10,\n \"stream\": false,\n \"publishers\": []\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://platform.ai.gloo.com/ai/{v}/message/kallm")

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 \"chat_id\": \"\",\n \"query\": \"What is your name?\",\n \"character_limit\": 123,\n \"sources_limit\": 10,\n \"stream\": false,\n \"publishers\": []\n}"

response = http.request(request)
puts response.read_body
{
  "query_id": "q3c870f25-63fc-451f-a9ce-9a5abed55aa0",
  "message_id": "mbc51c1d8-29e7-416f-85fc-9f4209d9887b",
  "message": "My name is Gloo AI Chat, and I'm here to assist you!",
  "timestamp": "2025-02-04T23:55:03.573767"
}
{
"detail": "Failed to find chat"
}
Deprecated Endpoint: This endpoint is part of the Chat API which is deprecated.Please migrate to the Completions v2 API for new projects.Migration Guide →
By providing chat_id a new message will be added to the chat session. If no chat_id is provided, a new chat session will be created. Default behavior:
  • Gloo AI will perform a sentiment analysis on your prompt.
  • Gloo AI will provide suggestion follow ups
  • Depending on your prompt, Gloo AI will return sources that have influenced the response from our trusted partners.
You can choose to override the defaults with the query params: intent, enable_sources, enable_suggestions. Example 1: You want a rich answer that is based on trusted sources and provides you follow up suggestions. Omit all query params. Example 2: You know that your prompt is going to require trusted sources as a part of the answer. You also want to not have follow up suggestions. intent: 1, enable_suggestions: 0 Example 3: You know that your prompt is not going to require trusted sources. You also want to not have follow up suggestions. intent: 0, enable_suggestions: 0

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

v
enum<string>
required
Available options:
v1

Query Parameters

chat_id
string | null
default:""
intent
enum<integer> | null
Available options:
0,
1
enable_sources
enum<integer> | null
default:1
Available options:
0,
1,
2
enable_suggestions
enum<integer> | null
default:1
Available options:
0,
1

Body

application/json
chat_id
string | null
default:""

chat_id can also be provided as a query param

query
string
default:What is your name?

Chat with KALLM.

character_limit
integer | null

Limit the response length.

sources_limit
integer | null
default:10

Limit the sources search.

stream
boolean | null
default:false

Stream response as soon as tokens are generated by the model.

publishers
string[] | null

List of Publisher Names

Response

Successful response

The response is of type Response Post-Message-Kallm · object.