Sends a user message to an agent session. The request is synchronous — it waits for the agent to finish processing and returns the reply in the response body. The message is appended to the session’s conversation history. The session must be inDocumentation Index
Fetch the complete documentation index at: https://docs.litellm-agent-platform.ai/llms.txt
Use this file to discover all available pages before exploring further.
ready status. If the session is still creating, wait for GET /sessions/{id} to return status: "ready" before calling this endpoint.
This endpoint applies only to API harnesses (
opencode, claude-agent-sdk). TUI harnesses (claude-code, codex) expose a PTY via WebSocket (tty_url) and do not use this endpoint.Request
| Header | Value |
|---|---|
Authorization | Bearer <MASTER_KEY> |
Content-Type | application/json |
Path parameters
The unique ID of the session to send a message to.
Body parameters
Provide eithertext or parts — not both.
Plain-text message to send. The platform wraps this into a
{ type: "text", text: "..." } part before forwarding to the harness.Structured message parts in the harness wire format. Each part is an object with at minimum a
type field. Use this when you need to send multimodal content or tool results directly.Response
Returns the agent’s reply as a JSON object:Array of message parts from the agent. Each part has at minimum:
Error responses
| Status | Meaning |
|---|---|
404 | Session not found or not in ready state |
502 | Harness request failed (sandbox unreachable or returned 5xx) |
502 with a hard connect failure also marks the session dead immediately, so you can see the failure without waiting for the reconciler.