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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(openai/responses): fallback to model construct, don't use it by default (causes downstream errors for nested values)
Krrish Dholakia0cb9ef5fb31c
diff --git a/litellm/llms/openai/responses/transformation.py b/litellm/llms/openai/responses/transformation.pyindex 4c82a35c119..1e949e434d3 100644--- a/litellm/llms/openai/responses/transformation.py+++ b/litellm/llms/openai/responses/transformation.py@@ -161,6 +161,10 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):) -> ResponsesAPIResponse:"""No transform applied since outputs are in OpenAI spec already"""try:+ logging_obj.post_call(+ original_response=raw_response.text,+ additional_args={"complete_input_dict": {}},+ )raw_response_json = raw_response.json()raw_response_json["created_at"] = _safe_convert_created_field(raw_response_json["created_at"]@@ -169,7 +173,13 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):raise OpenAIError(message=raw_response.text, status_code=raw_response.status_code)- return ResponsesAPIResponse.model_construct(**raw_response_json)+ try:+ return ResponsesAPIResponse(**raw_response_json)+ except Exception:+ verbose_logger.debug(+ f"Error constructing ResponsesAPIResponse: {raw_response_json}, using model_construct"+ )+ return ResponsesAPIResponse.model_construct(**raw_response_json)def validate_environment(self, headers: dict, model: str, litellm_params: Optional[GenericLiteLLMParams]diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yamlindex 95c6869b95b..778d52e5a49 100644--- a/litellm/proxy/_new_secret_config.yaml+++ b/litellm/proxy/_new_secret_config.yaml@@ -4,9 +4,9 @@ model_list:model: openai/gpt-4o-miniapi_base: "https://webhook.site/2f385e05-00aa-402b-86d1-efc9261471a5"api_key: dummy- - model_name: "byok-wildcard/*"+ - model_name: "gemini-2.5-flash"litellm_params:- model: openai/*+ model: gemini/gemini-2.5-flash- model_name: xai-grok-3litellm_params:model: xai/grok-3@@ -22,8 +22,3 @@ mcp_servers:spec_path: "/Users/krrishdholakia/Documents/temp_py_folder/example_openapi.json"auth_type: noneallowed_tools: ["getpetbyid", "my_api_mcp-findpetsbystatus"]---litellm_settings:- callbacks: ["prometheus"]- custom_prometheus_metadata_labels: ["metadata.initiative", "metadata.business-unit"]diff --git a/tests/llm_translation/test_openai.py b/tests/llm_translation/test_openai.pyindex eaf03777571..6894c4bc986 100644--- a/tests/llm_translation/test_openai.py+++ b/tests/llm_translation/test_openai.py@@ -726,3 +726,13 @@ def test_openai_safety_identifier_parameter_sync():assert "safety_identifier" in request_body# Verify safety_identifier is correctly sent to the APIassert request_body["safety_identifier"] == "user_code_123456"+++def test_gpt_5_reasoning():+ litellm._turn_on_debug()+ response = litellm.completion(+ model="openai/responses/gpt-5-mini",+ messages=[{"role": "user", "content": "Think of a poem, and then write it."}],+ reasoning_effort="low",+ )+ print("response: ", response)