Skip to main content
GET

Overview

Use this endpoint for realtime sessions such as streaming speech recognition, speech synthesis, speech translation, or realtime multimodal models. A standard GET request returns endpoint metadata, while a WebSocket upgrade request opens a realtime session for the selected model.

Supported surface

TokenLab exposes a realtime WebSocket endpoint at GET /v1/realtime for metadata checks and WebSocket upgrades. Treat it as a WebSocket subset: it forwards supported realtime model events, and it does not support OpenAI Realtime REST helper surfaces such as session creation, client_secrets, Calls call-control APIs, or legacy beta session APIs. For browser or mobile apps, keep long-lived API keys on your server. This endpoint does not issue short-lived Realtime client secrets.
Choose a current realtime model from /v1/models and verify /v1/models/{model} before setting TOKENLAB_REALTIME_MODEL. Session events and configuration depend on that model. The JSON response example below is for an ordinary HTTP GET, not a WebSocket session event.

Connection

string
required
Realtime model ID. Use a model whose model details lists realtime support.
string
required
Bearer API key. WebSocket clients should send Authorization: Bearer sk-your-api-key during the upgrade request.

Messages

TokenLab relays WebSocket messages between your client and the selected realtime model. Use the event format documented for that model, and include model in the query string rather than in each event.

Billing and closing

Sessions are billed against your API key balance: TokenLab reserves an estimate at the start, then settles the actual usage at the end and refunds any difference. Close the client socket when the session is complete. If the service closes the session first, TokenLab sends a safe close event/code to your client when possible.

Response example

Important fields

string
realtime.endpoint (HTTP GET).
string
/v1/realtime?model={model} (HTTP GET).
string
tokenlab_realtime_proxy (HTTP GET).
string
Event or message type returned by the API.
string
Realtime session ID for logs and support.

Authorizations

Authorization
string
header
required

API Key authentication. Create or manage API keys in Dashboard > API > API Keys.

Query Parameters

model
string

Realtime model ID to route the WebSocket session. Required for WebSocket upgrade requests; optional for plain HTTP metadata checks.

Response

WebSocket connection established