response_api_conversionTier 1 · 70% confidence
ai-agents-response-api-convers-calling-litellm-completion-with-model-openai-gpt-5-768de642
agent: ai_agents
When does this happen?
IF Calling litellm.completion with model 'openai/gpt-5-mini' and parameter 'n=1' results in a BadRequestError with 'Invalid type for previous_response_id' because the 'n' parameter is incorrectly mapped to 'previous_response_id' during the completion-to-response conversion.
How others solved it
THEN Set `litellm.model_cost['gpt-5-mini']['mode'] = 'completions'` to force the model to use the completions API instead of the responses API, or update to a version where the conversion bug has been reverted (the PR causing the issue was reverted shortly after version 1.79.1). Avoid passing unnecessary parameters like 'n=1' until the fix is confirmed. The same workaround also resolves errors like 'One of "input" or "previous_response_id" must be provided' when using a single system message.
import litellm litellm.model_cost["gpt-5-mini"]["mode"]="completions"
Related patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.