curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "Hello, I need help with leadership development",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123",
"isAuthenticated": true
}
}' \
--no-buffer
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "Can you give me some examples?",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123"
}
}' \
--no-buffer
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Hello, I need help with leadership development",
context: {
coachId: "coach_xyz789",
userId: "user_123",
isAuthenticated: true
}
})
});
// Get thread ID from headers
const threadId = response.headers.get('X-Thread-Id');
console.log('Thread ID:', threadId);
// Handle streaming response
const reader = response.body?.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
const lines = chunk.split('\n');
for (const line of lines) {
if (line.startsWith('data: ')) {
const text = line.slice(6);
console.log('Chunk:', text);
}
}
}
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Can you review this document?",
thread_id: "550e8400-e29b-41d4-a716-446655440000",
context: {
coachId: "coach_xyz789",
userId: "user_123"
},
attachments: [
{
id: "file-abc123xyz",
type: "application/pdf"
}
]
})
});
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Hola, necesito ayuda con desarrollo de liderazgo",
language: "es", // AI will respond in Spanish
context: {
coachId: "coach_xyz789",
userId: "user_123"
}
})
});
// AI responds: "¡Hola! Estaré encantado de ayudarte con el desarrollo de liderazgo..."
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "مرحبا، أحتاج مساعدة في تطوير القيادة",
"language": "ar",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123"
}
}' \
--no-buffer
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "שלום, אני צריך עזרה בפיתוח מנהיגות",
language: "he", // AI will respond in Hebrew (RTL)
context: {
coachId: "coach_xyz789",
userId: "user_123"
}
})
});
// AI responds: "!שלום! אשמח לעזור לך בפיתוח מנהיגות. בוא נתחיל..."
import requests
import json
url = "https://api.myweave.ai/functions/v1/chat"
headers = {
"Content-Type": "application/json",
"X-API-Key": "your-api-key-here"
}
payload = {
"message": "Hello, I need help with leadership development",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123",
"isAuthenticated": True
}
}
response = requests.post(url, headers=headers, json=payload, stream=True)
# Get thread ID from headers
thread_id = response.headers.get('X-Thread-Id')
print(f"Thread ID: {thread_id}")
# Stream the response
for line in response.iter_lines():
if line:
decoded_line = line.decode('utf-8')
if decoded_line.startswith('data: '):
text = decoded_line[6:]
print("Chunk:", text)
data: Hello! I'd be happy to help you with leadership development.
data: Let's start by understanding your current goals...
data:
[Response completes]
{
"error": "Missing required parameters: message and coachId"
}
{
"error": "User not authorized to create knowledge for this expert"
}
{
"error": "Coach not found"
}
Chat & Conversations
Human Intelligence API
Real-time conversations with personas powered by real human expertise
POST
/
functions
/
v1
/
chat
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "Hello, I need help with leadership development",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123",
"isAuthenticated": true
}
}' \
--no-buffer
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "Can you give me some examples?",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123"
}
}' \
--no-buffer
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Hello, I need help with leadership development",
context: {
coachId: "coach_xyz789",
userId: "user_123",
isAuthenticated: true
}
})
});
// Get thread ID from headers
const threadId = response.headers.get('X-Thread-Id');
console.log('Thread ID:', threadId);
// Handle streaming response
const reader = response.body?.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
const lines = chunk.split('\n');
for (const line of lines) {
if (line.startsWith('data: ')) {
const text = line.slice(6);
console.log('Chunk:', text);
}
}
}
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Can you review this document?",
thread_id: "550e8400-e29b-41d4-a716-446655440000",
context: {
coachId: "coach_xyz789",
userId: "user_123"
},
attachments: [
{
id: "file-abc123xyz",
type: "application/pdf"
}
]
})
});
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Hola, necesito ayuda con desarrollo de liderazgo",
language: "es", // AI will respond in Spanish
context: {
coachId: "coach_xyz789",
userId: "user_123"
}
})
});
// AI responds: "¡Hola! Estaré encantado de ayudarte con el desarrollo de liderazgo..."
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "مرحبا، أحتاج مساعدة في تطوير القيادة",
"language": "ar",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123"
}
}' \
--no-buffer
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "שלום, אני צריך עזרה בפיתוח מנהיגות",
language: "he", // AI will respond in Hebrew (RTL)
context: {
coachId: "coach_xyz789",
userId: "user_123"
}
})
});
// AI responds: "!שלום! אשמח לעזור לך בפיתוח מנהיגות. בוא נתחיל..."
import requests
import json
url = "https://api.myweave.ai/functions/v1/chat"
headers = {
"Content-Type": "application/json",
"X-API-Key": "your-api-key-here"
}
payload = {
"message": "Hello, I need help with leadership development",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123",
"isAuthenticated": True
}
}
response = requests.post(url, headers=headers, json=payload, stream=True)
# Get thread ID from headers
thread_id = response.headers.get('X-Thread-Id')
print(f"Thread ID: {thread_id}")
# Stream the response
for line in response.iter_lines():
if line:
decoded_line = line.decode('utf-8')
if decoded_line.startswith('data: '):
text = decoded_line[6:]
print("Chunk:", text)
data: Hello! I'd be happy to help you with leadership development.
data: Let's start by understanding your current goals...
data:
[Response completes]
{
"error": "Missing required parameters: message and coachId"
}
{
"error": "User not authorized to create knowledge for this expert"
}
{
"error": "Coach not found"
}
Overview
The Human Intelligence API enables real-time conversations with personas trained on real human expertise. It uses Server-Sent Events (SSE) for streaming responses and supports file attachments, course context, and authenticated/anonymous users.Request Body
string
required
The user’s message content
string
Existing thread ID. If not provided, a new thread will be created automatically. The thread ID is returned in the response headers (
X-Thread-Id) and in the message data.string
default:"en"
🧪 Experimental FeatureISO 639-1 language code for responses. The persona will respond naturally in the specified language while maintaining their authentic voice and real human expertise.Supported Languages (65): English, Spanish, French, German, Chinese, Japanese, Arabic, Hebrew, Hindi, Portuguese, Russian, Italian, Korean, and 52 more.RTL Languages: Arabic (
ar), Hebrew (he), Persian (fa), Urdu (ur) automatically render right-to-left.Examples: en (English), es (Spanish), fr (French), zh (Chinese), ar (Arabic), he (Hebrew)This feature is in experimental phase. Language quality may vary by language and coaching context.
object
required
Context information for the conversation
Show context properties
Show context properties
array
string
Special action to execute:
create_knowledge- Create knowledge content (requires coach authentication)
Response
The API returns a streaming response using Server-Sent Events (SSE). The thread ID is included in both:- Response header:
X-Thread-Id - SSE message data
header
Thread ID for the conversation (in response headers)
- Each chunk is prefixed with
data: - Contains text chunks from the persona’s response (powered by real human knowledge)
- Final chunk signals completion
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "Hello, I need help with leadership development",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123",
"isAuthenticated": true
}
}' \
--no-buffer
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "Can you give me some examples?",
"thread_id": "550e8400-e29b-41d4-a716-446655440000",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123"
}
}' \
--no-buffer
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Hello, I need help with leadership development",
context: {
coachId: "coach_xyz789",
userId: "user_123",
isAuthenticated: true
}
})
});
// Get thread ID from headers
const threadId = response.headers.get('X-Thread-Id');
console.log('Thread ID:', threadId);
// Handle streaming response
const reader = response.body?.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
const lines = chunk.split('\n');
for (const line of lines) {
if (line.startsWith('data: ')) {
const text = line.slice(6);
console.log('Chunk:', text);
}
}
}
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Can you review this document?",
thread_id: "550e8400-e29b-41d4-a716-446655440000",
context: {
coachId: "coach_xyz789",
userId: "user_123"
},
attachments: [
{
id: "file-abc123xyz",
type: "application/pdf"
}
]
})
});
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "Hola, necesito ayuda con desarrollo de liderazgo",
language: "es", // AI will respond in Spanish
context: {
coachId: "coach_xyz789",
userId: "user_123"
}
})
});
// AI responds: "¡Hola! Estaré encantado de ayudarte con el desarrollo de liderazgo..."
curl -X POST "https://api.myweave.ai/functions/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"message": "مرحبا، أحتاج مساعدة في تطوير القيادة",
"language": "ar",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123"
}
}' \
--no-buffer
const response = await fetch('https://api.myweave.ai/functions/v1/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your-api-key-here'
},
body: JSON.stringify({
message: "שלום, אני צריך עזרה בפיתוח מנהיגות",
language: "he", // AI will respond in Hebrew (RTL)
context: {
coachId: "coach_xyz789",
userId: "user_123"
}
})
});
// AI responds: "!שלום! אשמח לעזור לך בפיתוח מנהיגות. בוא נתחיל..."
import requests
import json
url = "https://api.myweave.ai/functions/v1/chat"
headers = {
"Content-Type": "application/json",
"X-API-Key": "your-api-key-here"
}
payload = {
"message": "Hello, I need help with leadership development",
"context": {
"coachId": "coach_xyz789",
"userId": "user_123",
"isAuthenticated": True
}
}
response = requests.post(url, headers=headers, json=payload, stream=True)
# Get thread ID from headers
thread_id = response.headers.get('X-Thread-Id')
print(f"Thread ID: {thread_id}")
# Stream the response
for line in response.iter_lines():
if line:
decoded_line = line.decode('utf-8')
if decoded_line.startswith('data: '):
text = decoded_line[6:]
print("Chunk:", text)
data: Hello! I'd be happy to help you with leadership development.
data: Let's start by understanding your current goals...
data:
[Response completes]
{
"error": "Missing required parameters: message and coachId"
}
{
"error": "User not authorized to create knowledge for this expert"
}
{
"error": "Coach not found"
}
Features
- Real-time Streaming: Server-sent events for live responses
- Multilingual Support: Personas respond in 65 languages including RTL languages (Arabic, Hebrew, Persian, Urdu)
- Human Expertise: Each persona trained on real human knowledge and expertise
- Automatic Thread Management: Threads created automatically, ID returned in headers
- File Attachments: Support for images, PDFs, and documents
- Course Integration: Connect conversations to structured courses and lessons
- Mode-based Conversations: Different consultation modes per persona
- Anonymous & Authenticated: Works for both user types
- Knowledge Creation: Special
create_knowledgeaction for persona owners (requires authentication)
Thread Management
First Message (New Thread):- Don’t include
thread_idin request - API creates new thread automatically
- Thread ID returned in
X-Thread-Idheader - Store this ID for continuing the conversation
- Include
thread_idfrom previous response - Continues the conversation in same thread
- Maintains full conversation context
Authentication
- For Users: No authentication required for basic chat
- For Persona Owners: Bearer token required when using
action: "create_knowledge"- Include
Authorization: Bearer <jwt_token>header - Must be authenticated as the persona owner specified in
coachId
- Include
Use Cases
- 1-on-1 Conversations: Real-time persona consultations powered by real human expertise
- Course Learning: Contextual help within structured courses built on human knowledge
- Document Review: Upload files for persona feedback based on real expertise
- Knowledge Creation: Persona owners can create training content via chat
- Global Multilingual Support: Personas respond in user’s native language while maintaining authentic human voice
Supported Languages (65) 🧪 Experimental
The Chat API supports 65 languages for AI responses. Simply include thelanguage parameter with the ISO 639-1 code.
Experimental Feature: Multilingual support is currently in beta. While the AI can respond in all listed languages, quality and accuracy may vary. We recommend testing thoroughly for production use cases.
Language Codes Reference
| Code | Language | Native Name | Flag | Notes |
|---|---|---|---|---|
en | English | English | 🌍 | Default language |
sq | Albanian | Shqip | 🇦🇱 | |
am | Amharic | አማርኛ | 🇪🇹 | |
ar | Arabic | العربية | 🇸🇦 | RTL |
hy | Armenian | Հայերեն | 🇦🇲 | |
bn | Bengali | বাংলা | 🇧🇩 | |
bs | Bosnian | Bosanski | 🇧🇦 | |
bg | Bulgarian | Български | 🇧🇬 | |
my | Burmese | မြန်မာ | 🇲🇲 | |
ca | Catalan | Català | 🇪🇸 | |
zh | Chinese | 中文 | 🇨🇳 | |
hr | Croatian | Hrvatski | 🇭🇷 | |
cs | Czech | Čeština | 🇨🇿 | |
da | Danish | Dansk | 🇩🇰 | |
nl | Dutch | Nederlands | 🇳🇱 | |
et | Estonian | Eesti | 🇪🇪 | |
fi | Finnish | Suomi | 🇫🇮 | |
fr | French | Français | 🇫🇷 | |
ka | Georgian | ქართული | 🇬🇪 | |
de | German | Deutsch | 🇩🇪 | |
el | Greek | Ελληνικά | 🇬🇷 | |
gu | Gujarati | ગુજરાતી | 🇮🇳 | |
he | Hebrew | עברית | 🇮🇱 | RTL |
hi | Hindi | हिन्दी | 🇮🇳 | |
hu | Hungarian | Magyar | 🇭🇺 | |
is | Icelandic | Íslenska | 🇮🇸 | |
id | Indonesian | Bahasa Indonesia | 🇮🇩 | |
it | Italian | Italiano | 🇮🇹 | |
ja | Japanese | 日本語 | 🇯🇵 | |
kn | Kannada | ಕನ್ನಡ | 🇮🇳 | |
kk | Kazakh | Қазақша | 🇰🇿 | |
ko | Korean | 한국어 | 🇰🇷 | |
lv | Latvian | Latviešu | 🇱🇻 | |
lt | Lithuanian | Lietuvių | 🇱🇹 | |
mk | Macedonian | Македонски | 🇲🇰 | |
ms | Malay | Bahasa Melayu | 🇲🇾 | |
ml | Malayalam | മലയാളം | 🇮🇳 | |
mr | Marathi | मराठी | 🇮🇳 | |
mn | Mongolian | Монгол | 🇲🇳 | |
no | Norwegian | Norsk | 🇳🇴 | |
fa | Persian | فارسی | 🇮🇷 | RTL |
pl | Polish | Polski | 🇵🇱 | |
pt | Portuguese | Português | 🇵🇹 | |
pa | Punjabi | ਪੰਜਾਬੀ | 🇮🇳 | |
ro | Romanian | Română | 🇷🇴 | |
ru | Russian | Русский | 🇷🇺 | |
sr | Serbian | Српски | 🇷🇸 | |
sk | Slovak | Slovenčina | 🇸🇰 | |
sl | Slovenian | Slovenščina | 🇸🇮 | |
so | Somali | Soomaali | 🇸🇴 | |
es | Spanish | Español | 🇪🇸 | |
sw | Swahili | Kiswahili | 🇰🇪 | |
sv | Swedish | Svenska | 🇸🇪 | |
tl | Tagalog | Tagalog | 🇵🇭 | |
ta | Tamil | தமிழ் | 🇮🇳 | |
te | Telugu | తెలుగు | 🇮🇳 | |
th | Thai | ไทย | 🇹🇭 | |
tr | Turkish | Türkçe | 🇹🇷 | |
uk | Ukrainian | Українська | 🇺🇦 | |
ur | Urdu | اردو | 🇵🇰 | RTL |
vi | Vietnamese | Tiếng Việt | 🇻🇳 |
Right-to-Left (RTL) Languages
Four languages automatically render right-to-left:- Arabic (
ar) - 🇸🇦 العربية - Hebrew (
he) - 🇮🇱 עברית - Persian (
fa) - 🇮🇷 فارسی - Urdu (
ur) - 🇵🇰 اردو
Usage Notes
- Defaults to English: If
languageparameter is omitted or invalid, defaults toen - Case Sensitive: Use lowercase codes (
es, notES) - Natural Responses: AI maintains coaching style while responding in selected language
- No Translation Needed: User can send messages in any language; specify response language with
languageparameter
Was this page helpful?

