litellm/tests/llm_responses_api_testing
Cesar Garcia 1fec48499f
fix: Pass extra_body to provider in Responses API requests (#16320)
## Problem
The `extra_body` parameter in `litellm.responses()` and `litellm.aresponses()`
was being accepted but never passed to the HTTP request sent to the LLM provider.
This prevented users from sending custom/experimental parameters to provider APIs.

## Changes
- Added `data.update(extra_body)` in `async_response_api_handler` (line 2138)
- Added `data.update(extra_body)` in `response_api_handler` (line 2012)
- Added tests to `test_openai_responses_api.py` for extra_body functionality

## Testing
- Tests verify extra_body params are passed in both sync and async modes
- Existing Responses API tests continue to pass
- Manually verified with OpenAI API that custom params are sent correctly

## Impact
Users can now pass custom/experimental parameters via extra_body:
```python
litellm.aresponses(
    model="gpt-4o",
    input="hello",
    extra_body={"custom_param": "value"}  # Now works!
)
```

This aligns with the OpenAI SDK pattern and matches behavior in other
LiteLLM endpoints (completion, embedding, etc.) that already support extra_body.
2025-11-06 14:54:40 -08:00
..
base_responses_api.py fix: Fix Responses API streaming tests usage field names and cost (#16236) 2025-11-04 15:57:59 -08:00
conftest.py [Perf] Improvements for Async Success Handler (Logging Callbacks) - Approx +130 RPS (#13905) 2025-08-23 13:13:23 -07:00
test_anthropic_responses_api.py test fix claude-sonnet-4-5-20250929 2025-10-28 19:05:13 -07:00
test_azure_responses_api.py TestAzureResponsesAPITest 2025-10-25 16:22:52 -07:00
test_base_responses_api_streaming_iterator.py [Bug Fix] Responses api session management for streaming responses (#13396) 2025-08-07 20:13:24 -07:00
test_google_ai_studio_responses_api.py [Fix] /responses API - add cancel endpoint + allow non-admins to use this as an llm api endpoint (#14594) 2025-09-15 18:49:54 -07:00
test_openai_responses_api.py fix: Pass extra_body to provider in Responses API requests (#16320) 2025-11-06 14:54:40 -08:00