Realtime Sessions
For low-latency audio and video interactions, the gateway mints a signed WebSocket URL backed by Gemini Live API. Your client connects to this URL and sends the normal Gemini Live setup and client messages through the proxy. Billing uses Live API usageMetadata — not rough duration estimates.
Create a session
Section titled “Create a session”curl https://llmtr.com/v1/realtime/sessions \ -H "Authorization: Bearer sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-3.1-flash-live-preview", "max_duration_seconds": 120, "max_budget_usd": 1.50 }'Response:
{ "session_id": "sess_xxx", "ws_url": "wss://realtime.llmtr.com/ws/sess_xxx?token=...", "expires_at": 1739200120}WebSocket connection
Section titled “WebSocket connection”Connect to ws_url via a WebSocket client. First message must be a Gemini Live setup:
{ "setup": { "generationConfig": { "responseModalities": ["AUDIO"] } }}After that, send audio chunks, text parts, or tool responses.
Parameters
Section titled “Parameters”| Field | Description |
|---|---|
max_duration_seconds | Max session duration |
max_budget_usd | Max spend before the session is closed |
response_modalities | ["AUDIO"], ["TEXT"], or both |
Billing
Section titled “Billing”Billed from Live API usageMetadata — actual input/output tokens and audio seconds, not estimated duration.