session.create
Create a new conversation session.Request
Parameters
Optional title for the session
Response
Unique session identifier (UUID)
Full session state object (see
session.get for structure)Example
session.get
Retrieve the current state of a session.Request
Parameters
The session ID to retrieve
Response
Session ID
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
Whether the session is currently processing
Human-readable status:
"ready", "thinking...", "interrupting...", etc.Array of conversation messages
Full conversation history (internal format)
Queued prompts waiting to be processed
Number of pending steering interventions
The provider used for this conversation:
"openai", "openrouter", or "antigravity"Active Claude session ID (if any)
Estimated token count for current context
Source of token estimate
Provider used for token estimation
Detailed breakdown of token usage
Example
session.send
Send a user prompt to a session. The session will process the prompt asynchronously and emit events.Request
Parameters
The session ID to send the prompt to
The user prompt text (required unless images are provided)
Array of image inputs (paths or data URLs)
If
true, queue the prompt if session is busy. If false (default), return error if busy.Response
The session ID
Unique turn identifier (UUID)
Whether the prompt was accepted
Whether the prompt was queued (vs. started immediately)
Example
After sending a prompt, listen for
event notifications to track progress:session.status- Status updatessession.stream.chunk- Streaming response chunkssession.tool.call.started- Tool callssession.completed- Turn completedsession.error- Error occurred
session.steer
Inject a steering message during an active turn to guide the assistant’s behavior.Request
Parameters
The session ID to steer
Steering instruction text (must be non-empty)
Response
The session ID
Whether the steering was accepted (only works during active turns)
Example
session.interrupt
Interrupt an active session turn. The assistant will stop processing and emit asession.interrupted event.
Request
Parameters
The session ID to interrupt
Response
The session ID
Whether an active turn was interrupted. Returns
false if no turn was active.Example
session.queue.list
List queued prompts for a session.Request
Session ID
Response
Array of queued prompt objects
session.queue.clear
Clear all queued prompts for a session.Request
Session ID
Response
history.list
List saved chat sessions.Request
Maximum number of sessions to return (default: 50)
Pagination cursor (session index to start from)
Response
Array of session summaries with
id, title, created_at, updated_at, and message_counthistory.get
Load a saved chat session.Request
Session ID to load
If
true, load the most recent sessionOptional path to a specific JSONL session file
Response
Complete session object with
id, title, messages, and metadatahistory.clear_session
Clear conversation history for a specific session.Request
Session ID to clear
Response
Related
- Session events - Real-time session updates
- RPC overview - Protocol fundamentals
- System methods - System operations