Skip to content

GPT-5 fails with maxTokens parameter #100

@gombosg

Description

@gombosg

Error:

"Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.”

Docs: https://platform.openai.com/docs/api-reference/chat/create

This value is now deprecated in favor of max_completion_tokens, and is not compatible with o-series models.

Renaming the field in CreateChatCompletionSettings would break a lot of clients I presume?

Another option is keeping CreateChatCompletionSettings intact, and changing only OpenAIChatCompletionService to send maxCompletionTokens instead. This way we wouldn't change the universal interface, only the OpenAI-specific implementation.

I'm opening a Draft PR to help the discussion!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions