Create stream
Create a new video inference stream. Returns connection details for the chosen transport.
Workflow: Create stream → connect video source → receive results on WebSocket → send keepalives → close when done.
Transport options:
- Native (default, recommended): Omit
source. Response includeslivekit.urlandlivekit.tokenfor publishing video. - WebRTC: Set
source.type: 'webrtc'with an SDP offer. Response includeswebrtcanswer andturn_servers. - LiveKit: Set
source.type: 'livekit'with your room URL and token.
Processing modes:
- Clip mode: Send
target_fps,clip_length_seconds,delay_secondsfor temporal analysis (motion, actions). - Frame mode: Send
interval_secondsfor static analysis (OCR, object detection).
Limits: 5 concurrent streams per API key. Requires credits.
What you get
The response carries:id— pass this in every later URL:/v1beta/streams/{id}/...plus stream URLs you embed in chat completion messages.publish.url+publish.token— feed these to a LiveKit client SDK to connect a video source. Any LiveKit publisher works (browser, native, server-to-server). The token is short-lived; use the one returned by/keepaliveif your publisher reconnects later.expires_at_ms+ttl_seconds— the lease deadline. Call/keepalivebefore it elapses (every ~2 minutes is safe). After expiry the stream’sstateflips toendedand stays there.
active state immediately, even before the first frame arrives. GET /streams/{id} returns last_frame_at_ms: null until a publisher actually delivers a frame.Authorizations
Every public HTTP request requires Authorization: Bearer <api_key>, except
GET /models and the public /billing/pricing endpoints.
401means the key is missing, unknown, or revoked.403means the key is valid but cannot access the requested resource.- The publish token returned by
POST /streamsis only for publishing media to LiveKit. It does not replace the API key for HTTP calls.
Headers
Optional hint to route the request to the region that owns the stream. If the
request reaches the wrong region the API returns 409 with a region_error body.
us-west1, us-central1 Response
Stream created.
Unique stream identifier. Use this in every subsequent stream URL.
Always active for a freshly created stream.
active WebRTC publish target. Connect with the LiveKit client SDK.
Wall-clock Unix ms when the lease will expire if not renewed via /keepalive.
Lease TTL in seconds. Currently 300 for all streams.
300