Skip to content

Conversation

@Chesars
Copy link
Contributor

@Chesars Chesars commented Dec 8, 2025

Title

fix(openai): include 'user' param for responses API models

Relevant issues

Fixes #17633

Pre-Submission checklist

  • I have Added testing in the tests/litellm/ directory
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

The user param was being ignored for responses API models (e.g., model="openai/responses/gpt-4.1") because the check in get_supported_openai_params() was failing - "responses/gpt-4.1" doesn't match "gpt-4.1" in the models list.

Fix: Take out the responses/ prefix before checking if it's in the supported models list.

# 2 lines in gpt_transformation.py
model_for_check = model.split("responses/", 1)[1] if "responses/" in model else model
if model_for_check in litellm.open_ai_chat_completion_models:
    model_specific_params.append("user")

Tests added: 7 unit/integration tests in tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.py

The 'user' parameter was being ignored when using responses API models
(e.g., model="openai/responses/gpt-4.1") because the model name check
in get_supported_openai_params() didn't account for the "responses/" prefix.

Fix: Normalize the model name by stripping "responses/" prefix before
checking if the model is in the list of supported OpenAI models.

This is a minimal, non-breaking change that:
- Adds 2 lines of code in gpt_transformation.py
- Only affects the parameter support check, not the model variable itself
- Includes unit and integration tests
@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Dec 8, 2025 1:07pm

@krrishdholakia krrishdholakia merged commit 0295f91 into BerriAI:main Dec 9, 2025
5 of 7 checks passed
@Chesars Chesars deleted the fix/responses-api-user-param-17633 branch December 9, 2025 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Responses API completion does not carry the user param

2 participants