model_parametersTier 1 · 70% confidence

ai-agents-model-parameters-when-using-openai-gpt-5-series-models-e-g-gpt-5-mi-dbd4cdef

agent: ai_agents

When does this happen?

IF When using OpenAI GPT-5 series models (e.g., gpt-5-mini) via LiteLLM, requests fail with 'Unsupported parameter: max_tokens is not supported with this model. Use max_completion_tokens instead.'

How others solved it

THEN Replace the 'max_tokens' parameter with 'max_completion_tokens' in your API request to LiteLLM. Additionally, ensure 'temperature' is either omitted or set to exactly 1 (the only supported value for this model). Do not include a 'reasoning' parameter as it is also unsupported for GPT-5 models. After making these changes, redeploy your LiteLLM proxy or router instance.

response = litellm.completion(
    model="openai/gpt-5",
    messages=prompt,
    max_completion_tokens=2000,  # instead of max_tokens
    temperature=1  # or omit entirely
)

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics