Skip to main content

Send Message

string
required
User message, 1–2000 characters.
string
required
Actor role sending the message (non-empty string, e.g. "user").
string
Existing thread to continue. If omitted, a new thread is created.
string
Session identifier for grouping threads.
object
App-specific lesson context, passed through to prompt construction.
object
App-specific session context, passed through to prompt construction.
object
Free-form page/document context.
object[]
Prior messages to seed context, if not relying on threadId.
object

Response

string
string
string
The assistant’s reply
string
"assistant"
object
object

Send Message (Streaming)

Same request body as Send Message, plus:
object

Response

Content-Type: text/event-stream. Each data: event is one of:
Token chunk
Done (final event)
Error

Errors