Create viewer token
curl --request POST \
--url https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"view": {
"type": "livekit",
"url": "<string>",
"token": "<string>",
"expires_in_seconds": 300
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": {
"error": "region_error",
"expected_region": "us-west1",
"requested_region": "us-central1"
}
}Streams
Create viewer token
Issue a short-lived, subscribe-only LiveKit token so the stream owner can watch the exact video feed the model is ingesting.
POST
/
streams
/
{stream_id}
/
viewer-token
Create viewer token
curl --request POST \
--url https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.overshoot.ai/v1beta/streams/{stream_id}/viewer-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"view": {
"type": "livekit",
"url": "<string>",
"token": "<string>",
"expires_in_seconds": 300
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": {
"error": "region_error",
"expected_region": "us-west1",
"requested_region": "us-central1"
}
}What it’s for
Watching your own stream — a monitoring dashboard, a debug view, or any UI that should show the video the model sees. The token is subscribe-only: it cannot publish media or data-channel messages, so it is safe to hand to a display-only client. Only the stream owner can request one; other API keys get a404.
How to use it
Connect with any LiveKit client SDK and render the remote video track:import { Room } from 'livekit-client';
const { view } = await createViewerToken(streamId);
const room = new Room();
await room.connect(view.url, view.token);
room.on('trackSubscribed', (track) => track.attach(videoElement));
view.expires_in_seconds (currently 300). A connected session survives token expiry, but reconnecting after expiry requires a fresh token — request a new one from this endpoint.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.