DEV Community

Alex Spinov
Alex Spinov

Posted on

LiveKit Has a Free API That Adds Video Calls to Your App in Minutes

LiveKit is the open-source WebRTC platform for real-time audio, video, and data. Build video calls, livestreaming, and screen sharing without managing media servers.

What Is LiveKit?

LiveKit is an open-source, end-to-end real-time communication stack. Self-host it or use LiveKit Cloud — works for 1:1 calls, group video, livestreaming, and AI voice agents.

Quick Start

# Docker
docker run --rm -p 7880:7880 -p 7881:7881 -p 7882:7882/udp \
  livekit/livekit-server --dev
Enter fullscreen mode Exit fullscreen mode

Server SDK (Generate Tokens)

import { AccessToken } from 'livekit-server-sdk'

function createToken(roomName: string, participantName: string) {
  const token = new AccessToken(
    process.env.LIVEKIT_API_KEY!,
    process.env.LIVEKIT_API_SECRET!,
    { identity: participantName }
  )
  token.addGrant({
    roomJoin: true,
    room: roomName,
    canPublish: true,
    canSubscribe: true,
  })
  return token.toJwt()
}

// API endpoint
app.post('/api/token', (req, res) => {
  const { room, username } = req.body
  const token = createToken(room, username)
  res.json({ token })
})
Enter fullscreen mode Exit fullscreen mode

React Component

import { LiveKitRoom, VideoConference } from '@livekit/components-react'
import '@livekit/components-styles'

function VideoCall({ room, token }: { room: string; token: string }) {
  return (
    <LiveKitRoom
      serverUrl={process.env.NEXT_PUBLIC_LIVEKIT_URL}
      token={token}
      connect={true}
    >
      <VideoConference />
    </LiveKitRoom>
  )
}
Enter fullscreen mode Exit fullscreen mode

That is it. Full video conferencing UI with camera, mic, screen share, chat, and participant list.

REST API

export LK_URL="http://localhost:7880"
export LK_TOKEN="your-admin-token"

# List rooms
curl -s "$LK_URL/twirp/livekit.RoomService/ListRooms" \
  -H "Authorization: Bearer $LK_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{}'

# Create room
curl -s "$LK_URL/twirp/livekit.RoomService/CreateRoom" \
  -H "Authorization: Bearer $LK_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name": "team-standup", "max_participants": 10}'

# List participants
curl -s "$LK_URL/twirp/livekit.RoomService/ListParticipants" \
  -H "Authorization: Bearer $LK_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"room": "team-standup"}'
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • Video calls: 1:1, group conferencing
  • Livestreaming: to thousands of viewers
  • AI agents: voice AI assistants with real-time audio
  • Screen sharing: collaborative debugging
  • Recording: save meetings to S3
  • Transcription: real-time speech-to-text

Free Tier (LiveKit Cloud)

Feature Free Growth
Participants 50K min/mo 500K min/mo
Recording 500 min/mo 5K min/mo
Egress Yes Yes
SFU regions 5 20+

Need video monitoring for scraping jobs? Scrapfly provides visual scraping dashboards. Email spinov001@gmail.com for custom monitoring.

Top comments (0)