computer/schema/computer-api.v1.json; API schema lists its operations, objects, events and errors. The relay, a process on the computer (SP_WIRE_LISTEN, default 127.0.0.1:7071), serves the WebSocket and the workspace file routes. The client is the opc CLI.
Transport
WebSocket
Open/connect with the subprotocol opc.v1 (without it: close 4400). Messages are JSON-RPC 2.0 text frames; binary frames carry terminal data.
The server’s first frame:
HTTP
Routes are in the schema’sx-methods map, for example POST /sessions/{id}/turns for turns.send. Path parameters replace the id fields of the method’s params. opc sends them under /api/managed-agents/computer of its API URL.
Authentication
Scopes
A credential without a scope list has every scope.
A scope may also name sessions (
sessionIds), be read-only (readOnly) and expire (until).
Session journal
Every state change in a session is an event with aseq, an integer from 1 that increases by one. Session, Turn, Ask and Subagent objects are computed from the events. Reads and most writes work on a suspended session.
Idempotency keys
Every write takes anidempotencyKey of 1 to 255 characters; over HTTP opc sends it as the Idempotency-Key header. A key is scoped to one member and one operation, shared by the operation’s WebSocket method and HTTP route, and kept 24 hours.
Errors
Over WebSocket an API error is JSON-RPC error-32000 whose data is the error body; over HTTP it is {"error": {...}} with the matching status.
All codes: API schema.