Gemini Realtime API - Google AI Studio
| Feature | Description | Comments | 
|---|---|---|
| Proxy | โ | |
| SDK | โ๏ธ | Experimental access via litellm._arealtime. | 
Proxy Usageโ
Add model to configโ
model_list:
  - model_name: "gemini-2.0-flash"
    litellm_params:
      model: gemini/gemini-2.0-flash-live-001
    model_info:
      mode: realtime
Start proxyโ
litellm --config /path/to/config.yaml 
# RUNNING on http://0.0.0.0:8000
Testโ
Run this script using node - node test.js
// test.js
const WebSocket = require("ws");
const url = "ws://0.0.0.0:4000/v1/realtime?model=openai-gemini-2.0-flash";
const ws = new WebSocket(url, {
    headers: {
        "api-key": `${LITELLM_API_KEY}`,
        "OpenAI-Beta": "realtime=v1",
    },
});
ws.on("open", function open() {
    console.log("Connected to server.");
    ws.send(JSON.stringify({
        type: "response.create",
        response: {
            modalities: ["text"],
            instructions: "Please assist the user.",
        }
    }));
});
ws.on("message", function incoming(message) {
    console.log(JSON.parse(message.toString()));
});
ws.on("error", function handleError(error) {
    console.error("Error: ", error);
});
Limitationsโ
- Does not support audio transcription.
- Does not support tool calling
Supported OpenAI Realtime Eventsโ
- session.created
- response.created
- response.output_item.added
- conversation.item.created
- response.content_part.added
- response.text.delta
- response.audio.delta
- response.text.done
- response.audio.done
- response.content_part.done
- response.output_item.done
- response.done