Skip to content

openai-compatible redundant reasoningEffort field in request body #8372

Closed

Description

@NitroRCr

Description

When using openai-compatible provider and specifying the reasoningEffort option, both reasoning_effort and reasoningEffort fields appear in the request body, with the latter being redundant. Some providers will raise an error due to this.

providerOptions: {
    'provider-name': { reasoningEffort: 'low' }
}
Image

When specifying reasoning_effort directly instead of reasoningEffort, both fields in the request body disappear:

providerOptions: {
    'provider-name': { reasoning_effort: 'low' }
}
Image

The key of the problem should be here:

seed,
...providerOptions?.[this.providerOptionsName],
reasoning_effort: compatibleOptions.reasoningEffort,
// messages:
messages: convertToOpenAICompatibleChatMessages(prompt),

There should be a way to add only the reasoning_effort field to the request body

AI SDK Version

  • ai: 5.0.22
  • @ai-sdk/openai-compatible: 1.0.11

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. jessevdp commented on Sep 1, 2025

    @jessevdp
    Contributor

    I just ran into this issue and concluded the same.

    It seems that the reasoningEffort option ends up next to the reasoning_effort option because of spread on line 187.

  2. added 3 commits that reference this issue on Sep 2, 2025
    d154b84
    4885c1f
    56236a7
  3. self-assigned this
    on Sep 2, 2025
  4. added
    bugSomething isn't working as documented
    and removed on Sep 2, 2025
  5. gr2m commented on Sep 2, 2025

    @gr2m
    Collaborator

    Thanks @jessevdp for fixing it! I'll get the fix released later today

  6. added
    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` label
    on Oct 15, 2025
  7. lgrammel commented on Jul 22, 2026

    @lgrammel
    Collaborator

    Identify issue type

    Identified as Bug
    Confidence: High

    Rationale

    This is a concrete request-serialization defect in existing provider behavior, confirmed by reproduction details and a subsequent fix.

    Evidence

    • Using reasoningEffort with @ai-sdk/openai-compatible 1.0.11 sends both reasoningEffort and reasoning_effort in the request body.
    • The redundant camelCase field can cause compatible providers to reject the request.
    • A commenter confirmed the spread operation caused the duplication, and a maintainer stated that a fix would be released.
  8. added theissue type on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelbugSomething isn't working as documentedmerged-mainprovider/openai-compatibleIssues related to the @ai-sdk/openai-compatible providertask-identify-issue-type-done

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions