Skip to main content
WS /v1/ws/systemone answers one set of System One questions for every frame you send. A reply is one decision. It carries the same answers and usage as a posted read. The lifecycle, close codes, and models are on Realtime.
WS /typesafe/ws is a deprecated alias of this socket, with the same protocol and bounds. The vlmrun SDK’s transport="ws" and the CLI’s --ws still connect to it. New raw-socket clients use /v1/ws/systemone.

Example

VLMRun(...) defaults to https://gateway.vlm.run/v1. Set VLMRUN_GATEWAY_URL for another gateway. The SDK derives the socket URL from it: https://gw.internal/v1 becomes wss://gw.internal/typesafe/ws.
Do not pass the Gateway URL as VLMRun(base_url=...). That argument is the platform API. The client health-checks it on construction. A Gateway URL there fails before a read is sent. Use VLMRUN_GATEWAY_URL for this route.
Each sample opens a session with one noul question, sends frames, and prints the has_people probability per frame. A FrameDecision from the SDK carries index, timestamp_s, and response. Results stay in input order. The raw samples print session.stats after session.close.

Why the socket

The saving is round trips. It grows with frame count. 60 frames from a 60 s clip: Tokens and cost match HTTP. Ask for the concurrency you want: a session that omits max_inflight reads one frame at a time.
Decision
The schema is prefix-cached across frames. Most of each prompt returns as cached_tokens. Those tokens bill at the cache rate. Every decision bills at least $0.001.

Messages

After session.create, each frame is one binary message. A read fires every stride frames over the newest window frames. Two more client events change a running session: state re-pins the state later frames read against, and decide runs one read with its own body. Every event and field is in the WS /v1/ws/systemone reference.

Backpressure

Backpressure drops. It never queues. A frame that arrives while max_inflight reads are running is dropped and reported on frame.dropped. Answering it would answer for a frame you have moved past. A decide message is never dropped.
Raise stride before max_inflight. Reading fewer frames costs less. Consecutive frames rarely change a decision.

Limits and billing

Each decision is one billing row, priced per token as a posted read, never by connection time. Skipped, dropped, and failed frames, and idle time, bill nothing. A session lasts up to 10 minutes, closes after 30 seconds idle, and stops at $5 of spend. Sessions per plan are on Rate Limits.

System One

Question types, inputs, confidence, and cost levers.

WS /v1/ws/systemone reference

Every client and server event, with its fields.

System One API

The HTTP route for the same questions. The socket reuses its answers and usage shapes.

Realtime Frames

A model reply per frame, for pose models.