Skip to main content
POST
Sends a prompt to a session that is already in running state. The response is a Server-Sent Events (SSE) stream of the agent’s output (tool calls, plan, intermediate results) terminated by a done event. Use this when you want to stream output in real time. If you’d rather kick off the prompt as a background task and poll for completion, POST /api/v0/sessions/launch and then poll GET /api/v0/sessions/{id} is the better pattern. The session must be in running state - call POST /api/v0/sessions first if you haven’t already. Required scope: sessions:prompt

Path Parameters

string
required
The session ID.

Headers

string
required
Bearer token. Example: Bearer runtm_xxx
string
text/event-stream (recommended for SSE clients).

Body

string
required
The prompt to send (0–100,000 characters).
string
Model override: sonnet, opus, haiku, opusplan. Defaults to sonnet.
boolean
default:false
Run in plan mode (read-only - agent analyzes without making changes).
string
Claude Code session ID for conversation continuity.
boolean
default:false
Force a new agent session instead of resuming the previous one.
array
Up to 5 base64-encoded files included as content blocks. Each entry: { "filename": "diagram.png", "media_type": "image/png", "data": "<base64>" }.

Response

200 text/event-stream. Each event has the shape:
Common event_type values:

Example