From 8a5feb18e3ec0f94c9f20b91cce9d1ca8550f99a Mon Sep 17 00:00:00 2001 From: Piotr Grabowski Date: Sat, 7 Feb 2026 08:17:04 +0100 Subject: [PATCH] fix(openrouter): fix crash of gpt-5.2-codex by using mode "chat" (#20577) Commit 1cdda28b6 changed "openrouter/openai/gpt-5.2-codex" to mode "responses", but this broke GPT-5.2-Codex with OpenRouter: ``` response = await litellm.acompletion( model="openrouter/openai/gpt-5.2-codex", messages=[{"role": "user", "content": "Hello"}], api_key=os.environ.get("OPENROUTER_API_KEY"), ) ``` crashes with: `OpenrouterException - argument of type 'NoneType' is not iterable` Responses API is in beta in OpenRouter and no other OpenRouter models use "responses" mode. The commit that changed this probably did it by mistake. Therefore change the mode to "chat" and fix the crash. --- litellm/model_prices_and_context_window_backup.json | 5 +---- model_prices_and_context_window.json | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index f6edcf7efd0..347a66c7dad 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -24707,11 +24707,8 @@ "max_input_tokens": 272000, "max_output_tokens": 128000, "max_tokens": 128000, - "mode": "responses", + "mode": "chat", "output_cost_per_token": 1.4e-05, - "supported_endpoints": [ - "/v1/responses" - ], "supported_modalities": [ "text", "image" diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index f6edcf7efd0..347a66c7dad 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -24707,11 +24707,8 @@ "max_input_tokens": 272000, "max_output_tokens": 128000, "max_tokens": 128000, - "mode": "responses", + "mode": "chat", "output_cost_per_token": 1.4e-05, - "supported_endpoints": [ - "/v1/responses" - ], "supported_modalities": [ "text", "image"