You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenAI GPT-5 verification fails in openshell inference set due to max_tokens request parameter #517
openshell inference set works for older OpenAI chat-completions models like gpt-4.1, but verification fails for GPT-5-family models like gpt-5.4 because the validation request appears to send max_tokens, which OpenAI rejects for that model family.
openshell inference set --provider openai-api --model gpt-5.4
Output:
Error: × failed to verify inference endpoint for provider 'openai-api' and model 'gpt-5.4' at 'https://api.openai.com/v1': upstream rejected the validation request with HTTP 400 Bad Request. Response body: {
"error": {
"message": "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.",
"type": "invalid_request_error",
"param": "max_token"
Expected behavior
openshell inference set --provider openai-api --model gpt-5.4 should validate successfully for supported OpenAI GPT-5-family models, or OpenShell should adapt the verification request to the model family requirements.
Actual behavior
Verification appears to send a request shaped for older chat-completions semantics (max_tokens), which GPT-5-family models reject.
Notes
This does not appear to be a provider creation problem.
The same provider and base URL work for gpt-4.1.
As a workaround, --no-verify can be used, but that is not ideal for normal onboarding flows.
Likely fix area
OpenShell inference endpoint verification for OpenAI provider/model combinations likely needs model-aware request shaping for GPT-5-family models, specifically around max_completion_tokens vs max_tokens.
changed the title [-]OpenAI GPT-5 verification fails in due to request parameter[/-][+]OpenAI GPT-5 verification fails in openshell inference set due to max_tokens request parameter[/+]on Mar 21, 2026
The max_tokens field is actually deprecated on the chat/completions API and max_completion_tokens is now the supported one. I will verify that max_completion_tokens is supported in most common tools that provide OpenAI compat endpoints (litellm, ollama, LMStudio) and update our verification logic.
Activity
[-]OpenAI GPT-5 verification fails in due to request parameter[/-][+]OpenAI GPT-5 verification fails in openshell inference set due to max_tokens request parameter[/+]pimlock commentedon Mar 24, 2026
Thanks!
The
max_tokensfield is actually deprecated on the chat/completions API andmax_completion_tokensis now the supported one. I will verify thatmax_completion_tokensis supported in most common tools that provide OpenAI compat endpoints (litellm, ollama, LMStudio) and update our verification logic.https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create
fix(router): use max_completion_tokens for OpenAI GPT-5+ validation p…
fix(router): use max_completion_tokens for OpenAI GPT-5+ validation p…
fix(router): use max_completion_tokens for OpenAI GPT-5+ validation (N…
chore: upstream merge 2026-04-08 (Wave 3) (#5)