opentok
OpenTok server-side SDK
What it is and what it does
The OpenTok Python SDK is a server-side library for interacting with the Tokbox/OpenTok platform, which provides real-time video and audio communication infrastructure. It lets you programmatically create sessions, generate access tokens for clients, start and manage session recordings (archives), and configure session parameters like media routing and end-to-end encryption. The library wraps HTTP calls to the OpenTok API using standard dependencies like requests and JWT signing via pyjwt and rsa.
You use it in a backend service to provision sessions and tokens that your client applications (web, mobile, desktop) then use to connect to video rooms. It handles the server-side orchestration—session creation, token generation with role-based access control, archive management—while the actual media streaming happens client-side. The package is designed specifically for the Tokbox platform; the description notes that new projects should consider the Vonage Server SDK for Python instead, which supports the newer unified Vonage Video API.
Use it for:
- Generate secure session tokens in a backend API to provision video rooms for client applications.
- Start and manage session recordings (archives) with configurable output modes and resolution settings.
- Create sessions with specific media routing and archiving modes for different application requirements.
- Add or remove individual streams from an active archive during a session.
- Implement role-based access control by generating tokens with different roles (moderator, subscriber) for session participants.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Server-side SDK for generating OpenTok sessions, tokens, and managing session archives via the Tokbox/OpenTok platform API.
Yes, if you are actively using the Tokbox/OpenTok platform and need server-side session and token management. The package is stable, actively maintained, has low install friction, and carries no known vulnerabilities. However, if you are starting a new project, verify whether you should use the newer Vonage Server SDK for Python instead, which supports the unified Vonage Video API platform.
Install
opentok on PyPI
pip
pip install opentokuv
uv add opentokpoetry
poetry add opentokInstalling opentok
Before you install
Low install friction with five lightweight runtime dependencies (requests, six, pytz, pyjwt, rsa). Package is actively maintained with recent releases and a stable codebase.
License in practice
MIT license (permissive) allows use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install opentok
from opentok import Client
opentok = Client(api_key, api_secret)
session = opentok.create_session()
token = session.generate_token()
Requires valid Tokbox/OpenTok API credentials (api_key and api_secret) to authenticate with the platform.
Verify before relying
- Whether the package works with Python versions older than 3.9 despite classifiers listing 3.9–3.13.
- Current status of Tokbox platform relative to the newer Vonage unified platform and whether migration is recommended for new projects.
Package facts
| License | LICENSE.txt (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — requests, six, pytz, pyjwt, rsa |
| Maintenance | actively maintained — 50 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,023,853/month — #4,488 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: opentok-3.14.0-py2.py3-none-any.whl
Keywords: video, chat, tokbox, tok, opentok, python, media, webrtc, archiving, realtime
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
vonage-videoPython client library for Vonage's Video API,…
permissive · top 15,000 on PyPI
vonage-jwtGenerates and verifies JWTs for Vonage API…
permissive · top 15,000 on PyPI
daily-pythonA Python SDK for building video and audio…
permissive · top 15,000 on PyPI
vonageVonage provides a unified Python interface to…
permissive · top 15,000 on PyPI
vonage-voiceProvides Python bindings to Vonage's Voice API…
permissive · top 15,000 on PyPI
vonage-network-authGenerates authenticated JWTs for Vonage Network…
permissive · top 15,000 on PyPI
vonage-http-clientProvides a synchronous HTTP client for…
permissive · top 15,000 on PyPI
vonage-accountProvides Python bindings for Vonage's Account…
permissive · top 15,000 on PyPI
vonage-usersManages users in Vonage's communications…
permissive · top 15,000 on PyPI
livekitPython SDK for building real-time video, audio,…
permissive · top 5,000 on PyPI