Skip to main content

List sessions

GET /v1/agents/runtime/{runtime_id}/pty Returns every PTY session belonging to the runtime, including sessions that have exited but not yet been reaped.
Responds with {"sessions": [PtySession, ...]}.

Describe a session

GET /v1/agents/runtime/{runtime_id}/pty/{session_id}
Returns a PtySession. Poll this when you want to know whether a session has exited without holding a stream open.

Resize

POST /v1/agents/runtime/{runtime_id}/pty/{session_id}/resize Changes the terminal geometry and delivers SIGWINCH to the foreground job, so full screen programs redraw at the new size.

Send a signal

POST /v1/agents/runtime/{runtime_id}/pty/{session_id}/signal Signals the session’s process directly.
Names are accepted with or without the SIG prefix. Only these four signals are permitted.
Writing \x03 with send input goes through the terminal’s line discipline and interrupts the foreground job, leaving the shell running. This endpoint signals the session process itself. Use input for Ctrl-C semantics and this endpoint when you want to act on the session regardless of what is running in it.

Kill a session

DELETE /v1/agents/runtime/{runtime_id}/pty/{session_id} Terminates the session and releases its terminal, scrollback buffer and slot in the per-runtime session limit.
Sessions are also killed automatically when the runtime is stopped or deleted, so you do not need to clean up before tearing a runtime down. Kill sessions explicitly when a runtime is long lived and you are creating a session per task.