From 3114eb336e4fbeb645bd3096cf27b144c39f2493 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 0da47634a94..4a505c0f43d 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -24610,11 +24610,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 4704549e716..f74d0978a2f 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -24640,11 +24640,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"