Renew stream lease
Renew the stream lease and pay for elapsed streaming time. Call every 10-20 seconds. Streams expire after ~45 seconds without a keepalive.
Each call charges for time since the last keepalive. If credits are insufficient (402), the lease is NOT renewed and the stream will expire.
For native transport, the response includes a refreshed livekit_token.
When to call
Streams expire 5 minutes after the last keepalive (or creation, if no keepalive has happened yet). Call/keepalive every ~2 minutes — clock skew is real and the cost of a missed renewal is the whole stream.
A keepalive on a stream that’s already ended returns 404. Streams cannot be revived; create a new one.
What you get back
Every successful keepalive returns:- A new
expires_at_msset tonow + ttl_seconds. - A fresh LiveKit
publish.token. Save it — if your publisher disconnects from the room, you’ll need a current token to rejoin without recreating the stream. Old tokens may stop working. - The current
stream_time_ms(matchesGET /streams/{id}).
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 Path Parameters
UUID returned by POST /streams.