Skip to content

Get started

VoltKit RTC Quickstart

Create a project, call the API with your secret, and put two people in a live video room. The shortest path from sign-up to a working call.

This page takes you from an empty account to two people in a live room. It uses nothing but curl, so you can see every request before you write any code.

What you need

  • A VoltKit account. Create one if you have not. VoltKit may ask you to verify the account before you create a project; request verification from your profile.
  • A server you control. API secrets are used from your backend, never from a browser or a mobile app.

Step 1: Create a project

In your dashboard, open RTC > Projects and create a project. You get three things:

ValueWhat it isKeep it secret?
App IDNames your project, for example vk_4f2a9c0d1e3b5a67No. It is safe to show.
API secretAuthenticates your backend, begins sk_Yes. Shown once.
API base URLWhere your backend sends requestsNo

Your first project also starts with the account's free trial of 2,500 participant-minutes. See Usage and billing.

The credentials file

As soon as the project is created, your browser downloads a text file named voltkit-rtc-<App ID>-<Key ID>.txt. It holds the App ID, the Key ID, the API secret and the API base URL, and a block ready to paste into your server's .env file:

VOLTKIT_RTC_URL=https://your-api-base-url
VOLTKIT_RTC_APP_ID=vk_4f2a9c0d1e3b5a67
VOLTKIT_RTC_SECRET=sk_...

Copy these values into your server's environment or your secret manager, then delete the file. Do not commit it to a repository or send it to anyone.

To follow this page from a terminal, set the two values there too. Every example on these pages uses these two names:

export VOLTKIT_RTC_URL="https://your-api-base-url"      # from the credentials file
export VOLTKIT_RTC_SECRET="sk_..."                      # your API secret

Step 2: Create a room

A room is where a conversation happens. Your backend creates it when your host goes live:

curl -X POST "$VOLTKIT_RTC_URL/v1/rooms" \
  -H "X-API-Key: $VOLTKIT_RTC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"roomId":"my-first-room","hostIdentity":"host-1"}'
{
  "roomId": "my-first-room",
  "state": "live",
  "hostIdentity": "host-1",
  "hostToken": "eyJhbGciOi...",
  "wsUrl": "wss://your-api-base-url/ws",
  "expiresAt": 1755600600
}

hostToken lets host-1 join and publish camera and microphone. wsUrl is where the client connects.

Room ids belong to your project. You and another customer can both have a room called main and neither of you can see the other's.

Step 3: Admit a viewer

For everyone else, your backend mints a token and decides the role:

curl -X POST "$VOLTKIT_RTC_URL/v1/rooms/my-first-room/tokens" \
  -H "X-API-Key: $VOLTKIT_RTC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"identity":"viewer-1","role":"viewer"}'
{
  "token": "eyJhbGciOi...",
  "wsUrl": "wss://your-api-base-url/ws",
  "role": "viewer",
  "identity": "viewer-1",
  "roomId": "my-first-room",
  "expiresAt": 1755600600
}

The role is signed into the token. A client cannot promote itself by editing a request: every privileged action is checked against the role on the server.

Step 4: Connect from the client

Hand token and wsUrl to your app. With the JavaScript SDK:

import { StreamClient } from "@voltkit-rtc/client";

const client = new StreamClient(wsUrl, token);

client.on("track", ({ identity, track }) => {
  // A remote camera or microphone is ready to play.
  attachToVideoElement(identity, track);
});

const joined = await client.connect();

// Hosts and co-hosts publish; viewers only watch.
if (joined.role === "host" || joined.role === "cohost") {
  const media = await navigator.mediaDevices.getUserMedia({ video: { width: 1280, height: 720 }, audio: true });
  await client.publish(media);   // Captured at 720p; every quality is included. See Video quality for 30/60 fps.
}

Open the host in one browser window and the viewer in another. The viewer sees and hears the host.

Install it with npm install @voltkit-rtc/client. There are SDKs for the browser, Flutter and Node.js backends.

Step 5: Check your usage

curl "$VOLTKIT_RTC_URL/v1/usage" -H "X-API-Key: $VOLTKIT_RTC_SECRET"

The same figures, with a chart, are on the Overview tab of your project.

Where to go next

  • Authentication: secrets, tokens and the four roles.
  • Rooms: co-hosts, moderation and room lifetime.
  • Video quality: 1080p, 720p or 480p, and what each costs in data.
  • Chat: messaging in a room, or on its own.
  • Broadcast: one publisher to a large audience.

Last updated . Something unclear or wrong? Tell us.