Skip to content

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.

Terminal window
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
}

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.

FieldDescription
max_duration_secondsMax session duration
max_budget_usdMax spend before the session is closed
response_modalities["AUDIO"], ["TEXT"], or both

Billed from Live API usageMetadata — actual input/output tokens and audio seconds, not estimated duration.