Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

docs(realtime.md): add new /v1/realtime endpoint

Krrish Dholakia793593e735e8
diff --git a/docs/my-website/docs/realtime.md b/docs/my-website/docs/realtime.md
new file mode 100644
index 00000000000..2149387a669
--- /dev/null
+++ b/docs/my-website/docs/realtime.md
@@ -0,0 +1,86 @@
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Realtime Endpoints
+
+Use this to loadbalance across Azure + OpenAI.
+
+## Proxy Usage
+
+### Add model to config
+
+
+<Tabs>
+<TabItem value="openai" label="OpenAI">
+
+```yaml
+model_list:
+ - model_name: openai-gpt-4o-realtime-audio
+ litellm_params:
+ model: openai/gpt-4o-realtime-preview-2024-10-01
+ api_key: os.environ/OPENAI_API_KEY
+```
+</TabItem>
+<TabItem value="openai+azure" label="OpenAI + Azure">
+
+```yaml
+model_list:
+ - model_name: gpt-4o
+ litellm_params:
+ model: azure/gpt-4o-realtime-preview
+ api_key: os.environ/AZURE_SWEDEN_API_KEY
+ api_base: os.environ/AZURE_SWEDEN_API_BASE
+
+ - model_name: openai-gpt-4o-realtime-audio
+ litellm_params:
+ model: openai/gpt-4o-realtime-preview-2024-10-01
+ api_key: os.environ/OPENAI_API_KEY
+```
+
+</TabItem>
+</Tabs>
+
+### Start proxy
+
+```bash
+litellm --config /path/to/config.yaml
+
+# RUNNING on http://0.0.0.0:8000
+```
+
+### Test
+
+Run this script using node - `node test.js`
+
+```js
+// test.js
+const WebSocket = require("ws");
+
+const url = "ws://0.0.0.0:4000/v1/realtime?model=openai-gpt-4o-realtime-audio";
+// const url = "wss://my-endpoint-sweden-berri992.openai.azure.com/openai/realtime?api-version=2024-10-01-preview&deployment=gpt-4o-realtime-preview";
+const ws = new WebSocket(url, {
+ headers: {
+ "api-key": `f28ab7b695af4154bc53498e5bdccb07`,
+ "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);
+});
+```
\ No newline at end of file
diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.js
index 5920b8841b3..d83a4e1fba4 100644
--- a/docs/my-website/sidebars.js
+++ b/docs/my-website/sidebars.js
@@ -221,6 +221,7 @@ const sidebars = {
"rerank",
"assistants",
"batches",
+ "realtime",
"fine_tuning",
{
type: "link",