Connection URL
{instance_id} is the computer’s instance_id, returned by Create computer. It is also the last path segment of the computer’s connection_url.
Authentication
Pass the computer’s password as thetoken query parameter. Retrieve it from Get VNC password before connecting. That endpoint takes the computer’s UUID, not its instance_id. You need both identifiers: the UUID to fetch the password, the instance_id to build this URL.
Send the password in ?token=, from a server or a browser. An Authorization header does not work on this socket, whether it carries an API key or the password: orgo-web accepts it, but it is not forwarded to the computer, which authenticates only ?token=. The connection opens and then closes with 1000. An API key in ?token= fails the same way, and from a browser (any connection with an Origin header) it is refused with 4001. Never put an account key in browser code.
A connection with no usable credential is closed with code 4001. See Close codes.
Query parameters
string
required
Computer password, from Get VNC password. Optional only when the request carries a signed-in orgo.ai session cookie, in which case orgo-web supplies the password for you.
number
default:"24000"
Capture sample rate in Hz. On Linux any positive integer is accepted. On Windows only 8000 to 48000 is accepted. A missing, unparseable, or out-of-range value falls back to 24000.
number
default:"1"
Number of channels. Only
1 (mono) and 2 (stereo) are accepted; any other value is ignored and the default of 1 is used.Audio format
Raw PCM: no codec, no container. Frame size follows the settings you request:
sample_rate × channels × 2 × 0.02 bytes.
Protocol
Connection flow
- Client connects with
?token=. - Server validates the credential.
- Server sends a JSON text frame echoing the configuration actually in use:
- Server starts capture and sends binary frames of raw PCM. If capture fails to start, an
errortext frame arrives instead and the connection closes normally. - Client decodes and plays via the Web Audio API or any PCM-capable player.
Client → server messages
stop
stop
Stop capture and close the connection.
ping
ping
Ask for a
pong.A frame that parses as JSON but carries an unrecognised
type is discarded silently. On Linux, a frame that is not valid JSON gets an error reply with the message invalid JSON, and the connection stays open. On Windows it is discarded silently.Server → client messages
started
started
Binary frames
Binary frames
Raw PCM audio data. Each binary frame contains signed 16-bit little-endian samples.At the default 24 kHz mono, each 20 ms frame is 960 bytes (480 samples × 2 bytes per sample).
pong
pong
Response to a
ping.error
error
Capture could not be started, or (on Linux) a client frame was not valid JSON.A capture failure is followed immediately by a normal (
string
Always
"error".string
Human-readable error description.
invalid JSON for an unparseable client frame, on Linux only. When capture could not start, failed to start audio capture: … on Linux and audio capture unavailable: … on Windows.1000) close, not by an error close code. Watch for this frame in your message handler. A client that only inspects close codes sees a clean disconnect and never learns why. An invalid JSON reply does not close the connection.Examples
Playback tips
Browser autoplay
Browsers require a user gesture before
AudioContext can play. Create the context inside a click handler, or call ctx.resume() after a user interaction.Drift correction
Schedule buffers slightly ahead of real time and reset when drift exceeds ~150 ms. This prevents gaps and keeps latency low.
Heartbeat
Send a
ping every 30 seconds to detect a dead connection early. Each message you send, ping included, also counts as activity for the idle timeout.Sample rate
The default 24 kHz mono suits voice and system sounds. Pass
sample_rate=48000 for higher fidelity, and size your playback buffers from the started frame rather than assuming the default.Audio streaming requires the computer to be running; a stopped computer is closed with code
4003. Audio is captured from the computer’s speaker output, so any sound the computer produces is streamed: browser media, system alerts, application audio.Idle disconnect
An idle audio socket is closed with code4008. The audio the server streams does not count as activity. Messages you send on this socket do, including ping. It also borrows the activity of the other connections you hold to the same computer: a VNC or terminal session you are actively using keeps it open. In production the window is 30 minutes. Reconnect to resume.