Send a message to a session and get the agent’s turn back. SetDocumentation Index
Fetch the complete documentation index at: https://docs.karta.sh/llms.txt
Use this file to discover all available pages before exploring further.
stream to
choose the response shape.
POST /v1/sessions/{session_id}/messages ·
POST /v1/projects/{project_ref}/sessions/{session_id}/messages
Request
The message to send.
The sending participant; messages are
attributed to it.
human or ai.Surface extended-thinking /
reasoning events.true → Server-Sent Events. false → a single accumulated JSON response.Unary response (stream: false)
Streaming response (stream: true)
text,
tool_use, reasoning, step_start, step_finish, input_required,
error, done. A turn may pause with input_required to request approval —
resolve it via Inputs.
Status codes
| Status | When |
|---|---|
200 | Success (unary or stream start). |
401 | Missing/invalid credential. |
402 | Budget exhausted — returned before the turn runs. |
403 | Session token scoped to another project (project route). |
404 | Session not found or another org’s. |
409 | Project route: no active/materialized release. |
422 | BYOK key rejected (unary). In streaming, this is an error event. |
Want to drive a project with an existing OpenAI or Anthropic client instead of
this native shape? Use a consumer adapter
— same turn, re-framed into those wire formats.