Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

PTY

Accessed via sandbox.pty.

await sandbox.pty.create(cols=80, rows=24, on_output=None)

Create an interactive terminal session. HTTP API →
body colsintdefault: 80
Terminal columns
body rowsintdefault: 24
Terminal rows
body on_outputCallable[[bytes], None]
Output callback
Returns: PtySession

PtySession

MemberTypeDescription
session_idstrSession ID
sandbox_idstrSandbox ID
send(data)methodSend input (str or bytes)
await recv()methodReceive output bytes (Python-unique)
await close()methodClose the PTY
recv() is Python-unique — a pull-based alternative to the on_output callback. Returns raw bytes.