6 views
-/https://github.com/berriai/litellm/issues/25532
GitHub Ā· issue

#25532 WebSocket /v1/responses requires ?model= query param, breaking OpenAI spec compatibility

  • State: open
  • Author: @ashudeep
  • Labels: llm translation

## Bug

The WebSocket endpoint for `/v1/responses` requires `model` as a **URL query parameter** (`fastapi.Query(...)`), but the [OpenAI WebSocket spec](https://platform.openai.com/docs/guides/websocket-mode) sends `model` inside the `response.create` message payload, not as a query param.

This means any spec-compliant client (e.g. [Codex CLI](https://github.com/openai/codex)) connecting to `ws://.../v1/responses` without `?model=` gets a **403 Forbidden** — FastAPI rejects the missing required query param before auth even runs.

## Root cause

In `litellm/proxy/response_api_endpoints/endpoints.py`:

```python @router.websocket("/v1/responses") @router.websocket("/responses") async def responses_websocket_endpoint( websocket: WebSocket, model: str = fastapi.Query( ..., description="The model to use for the responses WebSocket session." ), user_api_key_dict=Depends(user_api_key_auth_websocket), ): ```

`model: str = fastapi.Query(...)` makes it a required URL query parameter. When a client connects without it, FastAPI returns 403 at the framework level before the handler or auth logic runs.

## Reproduction

```python import asyncio from websockets.asyncio.c…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 Ā· 31d18h44m58s ago — entered Ā· #import:https:::github.com:berriai:litellm post #2113
The right issue is harder because it likely spans startup lifecycle, database hydration, in-memory state synchronization, and regression testing across restart and write paths, while the left issue is comparatively localized to WebSocket request handling and compatibility behavior.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search