POST
/api/v1/chats
Create a chat
Starts a tutoring conversation. Provide a subject and topic (or let us auto-detect them from the first message), an optional persona, and the student’s first message. Set stream: true to receive the reply as Server-Sent Events.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
user_id |
string | required | Your identifier for the student (billing) |
chat.subject_id |
uuid | optional | Subject; auto-detected from the message if omitted |
chat.topic_id |
uuid | optional | Topic within the subject |
chat.persona_id |
uuid | optional | Persona to use; a sensible default is chosen otherwise |
chat.message |
string | required | The student’s first message |
chat.file |
file/url | optional | An image or PDF to attach to the message |
stream |
boolean | optional | Stream the reply as SSE (default false) |
Returns
The chat object with the first exchange. When streaming, emits start, message_start, content chunks, then done.