Realtime WebSockets & Ephemeral Sessions
Create short-lived ephemeral client secrets for low-latency Realtime WebSockets audio sessions.
Realtime WebSockets & Ephemeral Sessions
POST/v1/realtime/sessions
Inference Key (Bearer zrv_...)
The Realtime Sessions API mints short-lived, ephemeral client secrets (ek_...) allowing browser or mobile clients to establish direct WebSockets connections for real-time speech-to-speech audio interactions without exposing your master inference key.
Inference Key TesterInteractive
Paste your Zorveus key to dynamically update all code snippets below.
Minting an Ephemeral Session Token
Your backend requests an ephemeral session token, specifying the permitted model and voice parameters:
import requests
response = requests.post(
"https://api.zorveus.com/v1/realtime/sessions",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer zrv_your_inference_key",
},
json={
"model": "openai/gpt-4o-realtime-preview",
"voice": "verse",
},
)
session_data = response.json()
# Ephemeral token safe to send to client browser: session_data['client_secret']['value']
print("Ephemeral Client Secret:", session_data["client_secret"]["value"])Was this page helpful?
Edit this page on GitHub