From 7ef78966b368a27bddf781024613893b4333381f Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 24 Jun 2026 12:33:40 -0700 Subject: [PATCH] feat(ai-gateway): realtime route uses UserApiKeyAuth extractor --- .../crates/ai-gateway/src/routes/realtime/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/litellm-rust/crates/ai-gateway/src/routes/realtime/mod.rs b/litellm-rust/crates/ai-gateway/src/routes/realtime/mod.rs index 658fa8d2dbe..86d9e6d06d3 100644 --- a/litellm-rust/crates/ai-gateway/src/routes/realtime/mod.rs +++ b/litellm-rust/crates/ai-gateway/src/routes/realtime/mod.rs @@ -20,7 +20,7 @@ use litellm_core::realtime::types::RealtimeEvent; use litellm_core::router::Router as ModelRouter; use serde::Deserialize; -use crate::auth::RequireMasterKey; +use crate::auth::UserApiKeyAuth; use crate::state::AppState; /// This route's contribution to the app router. @@ -33,11 +33,12 @@ struct RealtimeQuery { model: String, } -/// Auth runs via the `RequireMasterKey` extractor. We validate the model BEFORE -/// the upgrade so failures are clean HTTP (400/404), not a socket that opens then +/// Auth runs via the `UserApiKeyAuth` extractor (master key → admin, otherwise +/// cache then the swappable authenticator). We validate the model BEFORE the +/// upgrade so failures are clean HTTP (400/404), not a socket that opens then /// closes, then hand the socket to `bridge`. async fn handle( - _auth: RequireMasterKey, + _auth: UserApiKeyAuth, ws: WebSocketUpgrade, State(state): State, Query(query): Query,