Skip to main content
A reply is one decision. It carries the same answers and usage as a posted read.

Example

websockets is installed here because the vlmrun[ws] extra ships in the next SDK release. The --ws and --fps CLI flags arrive with that release. The Python tab works on the current release.
VLMRun(...) defaults to https://gateway.vlm.run/v1. Set VLMRUN_GATEWAY_URL for another gateway. The socket URL is derived 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.
A FrameDecision carries index, timestamp_s, and response. Results stay in input order.

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 it is throttled to 2.
Node’s built-in WebSocket cannot set request headers. It cannot send Authorization. Use ws.
Decision
The schema is prefix-cached across frames. Most of each prompt returns as cached_tokens. Those tokens bill at the cache rate.

Messages

session.create fields:

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

The socket does not appear in the OpenAPI schema, because the schema does not describe WebSocket routes.

System One

Question types, inputs, confidence, and cost levers.

System One API

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