Skip to main content
POST
https://api.myweave.ai
/
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
data: Hello! I'd be happy to help you with leadership development.
data:  Let's start by understanding your current goals...
data: 

[Response completes]

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

message
string
required
The user’s message content
thread_id
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.
language
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.
context
object
required
Context information for the conversation
attachments
array
File attachments for the message
action
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
X-Thread-Id
header
Thread ID for the conversation (in response headers)
SSE Event Format:
  • 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
data: Hello! I'd be happy to help you with leadership development.
data:  Let's start by understanding your current goals...
data: 

[Response completes]

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_knowledge action for persona owners (requires authentication)

Thread Management

First Message (New Thread):
  • Don’t include thread_id in request
  • API creates new thread automatically
  • Thread ID returned in X-Thread-Id header
  • Store this ID for continuing the conversation
Follow-up Messages (Existing Thread):
  • Include thread_id from 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

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 the language 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

CodeLanguageNative NameFlagNotes
enEnglishEnglish🌍Default language
sqAlbanianShqip🇦🇱
amAmharicአማርኛ🇪🇹
arArabicالعربية🇸🇦RTL
hyArmenianՀայերեն🇦🇲
bnBengaliবাংলা🇧🇩
bsBosnianBosanski🇧🇦
bgBulgarianБългарски🇧🇬
myBurmeseမြန်မာ🇲🇲
caCatalanCatalà🇪🇸
zhChinese中文🇨🇳
hrCroatianHrvatski🇭🇷
csCzechČeština🇨🇿
daDanishDansk🇩🇰
nlDutchNederlands🇳🇱
etEstonianEesti🇪🇪
fiFinnishSuomi🇫🇮
frFrenchFrançais🇫🇷
kaGeorgianქართული🇬🇪
deGermanDeutsch🇩🇪
elGreekΕλληνικά🇬🇷
guGujaratiગુજરાતી🇮🇳
heHebrewעברית🇮🇱RTL
hiHindiहिन्दी🇮🇳
huHungarianMagyar🇭🇺
isIcelandicÍslenska🇮🇸
idIndonesianBahasa Indonesia🇮🇩
itItalianItaliano🇮🇹
jaJapanese日本語🇯🇵
knKannadaಕನ್ನಡ🇮🇳
kkKazakhҚазақша🇰🇿
koKorean한국어🇰🇷
lvLatvianLatviešu🇱🇻
ltLithuanianLietuvių🇱🇹
mkMacedonianМакедонски🇲🇰
msMalayBahasa Melayu🇲🇾
mlMalayalamമലയാളം🇮🇳
mrMarathiमराठी🇮🇳
mnMongolianМонгол🇲🇳
noNorwegianNorsk🇳🇴
faPersianفارسی🇮🇷RTL
plPolishPolski🇵🇱
ptPortuguesePortuguês🇵🇹
paPunjabiਪੰਜਾਬੀ🇮🇳
roRomanianRomână🇷🇴
ruRussianРусский🇷🇺
srSerbianСрпски🇷🇸
skSlovakSlovenčina🇸🇰
slSlovenianSlovenščina🇸🇮
soSomaliSoomaali🇸🇴
esSpanishEspañol🇪🇸
swSwahiliKiswahili🇰🇪
svSwedishSvenska🇸🇪
tlTagalogTagalog🇵🇭
taTamilதமிழ்🇮🇳
teTeluguతెలుగు🇮🇳
thThaiไทย🇹🇭
trTurkishTürkçe🇹🇷
ukUkrainianУкраїнська🇺🇦
urUrduاردو🇵🇰RTL
viVietnameseTiế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 language parameter is omitted or invalid, defaults to en
  • Case Sensitive: Use lowercase codes (es, not ES)
  • 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 language parameter