Playground key
create a key →

Getting started

Quickstart.

From zero to a live, controllable stream in five calls. Paste an API key with streams:write, tokens:mint and controller:write into the bar above, then run each step right here.

1 — Create a stream

Save the streamKey from the response — it's shown only once and goes onto your device. Note the stream.id for the next steps.

POST/v1/streamsstreams:writeTry it

2 — Bring the camera online

Your device exchanges the stream key for a camera token (no API key). Paste the streamKey from step 1, or just open the test publisher to stream your webcam through this exact path.

POST/v1/streams/tokenstream keyTry it

3 — Mint a viewer token for an end-user

Drop in the stream id from step 1. Hand the returned token + url to a browser running livekit-client.

POST/v1/streams/:id/tokenstokens:mintTry it

4 — Hand control to that user

Promote the same identity. If they're connected as a viewer, they gain control live — no reconnect.

POST/v1/streams/:id/controllercontroller:writeTry it

5 — Confirm the state

Read the stream back. status reads live once a camera has connected, such as the test publisher from step 2, and controller.identity is your user.

GET/v1/streams/:idstreams:readTry it

The same flow in your backend

quickstart.ts
const API = "https://platform.droidhub.cloud/api";
const headers = {
  Authorization: `Bearer ${process.env.DROIDHUB_API_KEY}`,
  "Content-Type": "application/json",
};

// 1. Create the stream
const { stream, streamKey } = await fetch(`${API}/v1/streams`, {
  method: "POST",
  headers,
  body: JSON.stringify({ name: "Quickstart rover" }),
}).then((r) => r.json());

// 3. Mint a viewer token (your device used streamKey for step 2)
const viewer = await fetch(`${API}/v1/streams/${stream.id}/tokens`, {
  method: "POST",
  headers,
  body: JSON.stringify({ identity: "viewer-1", role: "viewer" }),
}).then((r) => r.json());

// 4. Promote them to controller
await fetch(`${API}/v1/streams/${stream.id}/controller`, {
  method: "POST",
  headers,
  body: JSON.stringify({ identity: "viewer-1" }),
});

Next

Build a real control queue in the control-queue recipe, or wire up webhooks to react to stream and controller events.