Python
import os
from meibel import MeibelClient
from meibel.models import ChatMessageRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.agents.sessions.send_chat_message(
"sess_8f3a2b1c",
ChatMessageRequest(
user_message="What were our top three support issues last week?",
include_thinking=False,
include_tool_activity=True,
),
)
print(response.assistant_response)
print(response.response.follow_up_questions)import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const sessionId = "sess_7f3a9c2e1b8d";
const chatResponse = await client.agents.sessions.sendChatMessage(sessionId, {
userMessage: "What were our top-selling products last quarter?",
timeoutSeconds: 60,
includeThinking: false,
includeToolActivity: true,
});
console.log(chatResponse.assistantResponse);
console.log(chatResponse.response.sources);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Agents.Sessions.SendChatMessage(
context.Background(),
"sess_8f3a1c2d9b0e",
v2.ChatMessageRequest{
UserMessage: "What were our top selling products last quarter?",
IncludeThinking: v2.Bool(false),
IncludeToolActivity: v2.Bool(true),
},
)
if err != nil {
fmt.Println("error sending chat message:", err)
return
}
fmt.Println("signal ID:", resp.SignalID)
fmt.Println("assistant response:", resp.AssistantResponse)
}curl --request POST \
--url https://api.meibel.ai/v2/sessions/{session_id}/chat \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"user_message": "<string>",
"timeout_seconds": 123,
"include_thinking": true,
"include_tool_activity": true
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_message: '<string>',
timeout_seconds: 123,
include_thinking: true,
include_tool_activity: true
})
};
fetch('https://api.meibel.ai/v2/sessions/{session_id}/chat', 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://api.meibel.ai/v2/sessions/{session_id}/chat",
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([
'user_message' => '<string>',
'timeout_seconds' => 123,
'include_thinking' => true,
'include_tool_activity' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/sessions/{session_id}/chat")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_message\": \"<string>\",\n \"timeout_seconds\": 123,\n \"include_thinking\": true,\n \"include_tool_activity\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/sessions/{session_id}/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_message\": \"<string>\",\n \"timeout_seconds\": 123,\n \"include_thinking\": true,\n \"include_tool_activity\": true\n}"
response = http.request(request)
puts response.read_body{
"signal_id": "<string>",
"response": {
"message": "",
"sources": [
{
"title": "<string>",
"url": "<string>",
"snippet": "<string>",
"data_element_id": "<string>",
"relevance_score": 123
}
],
"follow_up_questions": [
"<string>"
],
"call_to_actions": [
{
"label": "<string>",
"action": "<string>",
"action_data": {}
}
],
"artifacts": [
{
"artifact_id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"content": "<string>",
"storage_url": "<string>",
"size_bytes": 123,
"created_at": "<string>"
}
]
},
"assistant_response": "<string>",
"tool_activity": [
{
"tool_id": "<string>",
"tool_name": "<string>",
"arguments": {},
"timestamp": "<string>",
"result": {}
}
],
"thinking": "<string>",
"token_usage": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Sessions
Send Chat Message
POST
/
sessions
/
{session_id}
/
chat
Python
import os
from meibel import MeibelClient
from meibel.models import ChatMessageRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.agents.sessions.send_chat_message(
"sess_8f3a2b1c",
ChatMessageRequest(
user_message="What were our top three support issues last week?",
include_thinking=False,
include_tool_activity=True,
),
)
print(response.assistant_response)
print(response.response.follow_up_questions)import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const sessionId = "sess_7f3a9c2e1b8d";
const chatResponse = await client.agents.sessions.sendChatMessage(sessionId, {
userMessage: "What were our top-selling products last quarter?",
timeoutSeconds: 60,
includeThinking: false,
includeToolActivity: true,
});
console.log(chatResponse.assistantResponse);
console.log(chatResponse.response.sources);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Agents.Sessions.SendChatMessage(
context.Background(),
"sess_8f3a1c2d9b0e",
v2.ChatMessageRequest{
UserMessage: "What were our top selling products last quarter?",
IncludeThinking: v2.Bool(false),
IncludeToolActivity: v2.Bool(true),
},
)
if err != nil {
fmt.Println("error sending chat message:", err)
return
}
fmt.Println("signal ID:", resp.SignalID)
fmt.Println("assistant response:", resp.AssistantResponse)
}curl --request POST \
--url https://api.meibel.ai/v2/sessions/{session_id}/chat \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"user_message": "<string>",
"timeout_seconds": 123,
"include_thinking": true,
"include_tool_activity": true
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_message: '<string>',
timeout_seconds: 123,
include_thinking: true,
include_tool_activity: true
})
};
fetch('https://api.meibel.ai/v2/sessions/{session_id}/chat', 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://api.meibel.ai/v2/sessions/{session_id}/chat",
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([
'user_message' => '<string>',
'timeout_seconds' => 123,
'include_thinking' => true,
'include_tool_activity' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/sessions/{session_id}/chat")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_message\": \"<string>\",\n \"timeout_seconds\": 123,\n \"include_thinking\": true,\n \"include_tool_activity\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/sessions/{session_id}/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_message\": \"<string>\",\n \"timeout_seconds\": 123,\n \"include_thinking\": true,\n \"include_tool_activity\": true\n}"
response = http.request(request)
puts response.read_body{
"signal_id": "<string>",
"response": {
"message": "",
"sources": [
{
"title": "<string>",
"url": "<string>",
"snippet": "<string>",
"data_element_id": "<string>",
"relevance_score": 123
}
],
"follow_up_questions": [
"<string>"
],
"call_to_actions": [
{
"label": "<string>",
"action": "<string>",
"action_data": {}
}
],
"artifacts": [
{
"artifact_id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"content": "<string>",
"storage_url": "<string>",
"size_bytes": 123,
"created_at": "<string>"
}
]
},
"assistant_response": "<string>",
"tool_activity": [
{
"tool_id": "<string>",
"tool_name": "<string>",
"arguments": {},
"timestamp": "<string>",
"result": {}
}
],
"thinking": "<string>",
"token_usage": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
application/json
Request body for chat message endpoints.
Response
Successful Response
Response from the non-streaming chat endpoint.
Unique ID for this message exchange
The structured response
Show child attributes
Show child attributes
The assistant response in text-format
Tool calls made during response generation
Show child attributes
Show child attributes
LLM thinking/reasoning content
Token usage statistics
Show child attributes
Show child attributes
Was this page helpful?
⌘I