[GH-ISSUE #13101] feat: Add Support for Adjusting Reasoning Intensity in OpenAI-Compatible Mode #32339

Closed
opened 2026-04-25 06:14:09 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @L0stInFades on GitHub (Apr 21, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13101

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

In the OpenAI-compatible SDK format, Claude (developed by Anthropic) currently lacks support for enabling reasoning modes or controlling the reasoning token budget.

Desired Solution you'd like

Actually,Anthropic's documentation demonstrates how to enable and configure reasoning by adding an extra_body parameter to API requests, like this:
response = client.chat.completions.create(
model="claude-3-7-sonnet-20240229",
messages=[...],
extra_body={
"thinking": {
"type": "enabled",
"budget_tokens": 2000
}
}
)
However, this functionality relies on Anthropic-specific extensions and may not be natively available or properly implemented in standard OpenAI-compatible environments. As a result, users are unable to leverage these reasoning controls when interacting with Claude through generic OpenAI SDKs.
For more details, please refer to: https://docs.anthropic.com/en/api/openai-sdk .

I hope you can provide updates in this area to better support the use of Claude.

Alternatives Considered

No response

Additional Context

No response

Originally created by @L0stInFades on GitHub (Apr 21, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/13101 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description In the OpenAI-compatible SDK format, Claude (developed by Anthropic) currently lacks support for enabling reasoning modes or controlling the reasoning token budget. ### Desired Solution you'd like Actually,Anthropic's documentation demonstrates how to enable and configure reasoning by adding an extra_body parameter to API requests, like this: response = client.chat.completions.create( model="claude-3-7-sonnet-20240229", messages=[...], extra_body={ "thinking": { "type": "enabled", "budget_tokens": 2000 } } ) However, this functionality relies on Anthropic-specific extensions and may not be natively available or properly implemented in standard OpenAI-compatible environments. As a result, users are unable to leverage these reasoning controls when interacting with Claude through generic OpenAI SDKs. For more details, please refer to: [https://docs.anthropic.com/en/api/openai-sdk ](https://docs.anthropic.com/en/api/openai-sdk). I hope you can provide updates in this area to better support the use of Claude. ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@tjbck commented on GitHub (Apr 21, 2025):

reasoning_effort param is supported.

<!-- gh-comment-id:2818489077 --> @tjbck commented on GitHub (Apr 21, 2025): reasoning_effort param is supported.
Author
Owner

@L0stInFades commented on GitHub (Apr 22, 2025):

Actually, the reasoning_effort parameter cannot enable Claude's reasoning mode. Claude ignores the reasoning_effort parameter. The official documentation confirms this.

reasoning_effort param is supported.

<!-- gh-comment-id:2821427867 --> @L0stInFades commented on GitHub (Apr 22, 2025): Actually, the reasoning_effort parameter cannot enable Claude's reasoning mode. Claude ignores the reasoning_effort parameter. The official documentation confirms this. > reasoning_effort param is supported.
Author
Owner

@Classic298 commented on GitHub (Apr 22, 2025):

@L0stInFades Open WebUI is meant to support only OpenAI API compatible AI endpoints.

reasoning_effort is an OpenAI API endpoint.
If Anthropic doesn't support this you have two options (or three)

  1. Implement the connection to Anthropic's models yourself using functions, which accept the reasoning_effort param (or you just hardcode it into the param) and done (examples on openwebui.com/functions)
  2. Use a middleware like LiteLLM - I am actually not sure if LiteLLM supports the reasoning_effort param in incoming requests, but you can configure it for each model individually so it would be a fix for you too
  3. use openrouter

So, yes, Anthropic doesn't support reasoning_effort. But it is not Open WebUI's goal to implement all the small differences across the 100+ AI providers out there. It is too much work to implement all the different APIs, let alone maintain it. I bet there'll be providers on a weekly basis that add features or make small changes on the API that could break things for Open WebUI. Impossible to maintain. -> That's where your own custom built functions (or community functions) or middlewares like LiteLLM come into play.

If they don't manage to come up with a unified API then that's their problem if they don't want to be customer-friendly.

Even Google learned this lesson and offers a beta version of an OpenAI API compatiple endpoint now for all their models.

And if you are reliant on other providers who do not follow the OpenAI API schema, then use a middleware like LiteLLM or use openrouter.

In the OpenAI-compatible SDK format, Claude (developed by Anthropic) currently lacks support for enabling reasoning modes or controlling the reasoning token budget.
Actually,Anthropic's documentation demonstrates how to enable and configure reasoning by adding an extra_body parameter to API requests, like this:
response = client.chat.completions.create(
model="claude-3-7-sonnet-20240229",
messages=[...],
extra_body={
"thinking": {
"type": "enabled",
"budget_tokens": 2000
}

And this is not OpenAI API compatible, like you claimed.
OpenAI's docs show this:

reasoning_effort
string or null

Optional
Defaults to medium
o-series models only

Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

So actually Anthropic does NOT follow OpenAI API compatible API schemas.

<!-- gh-comment-id:2821459086 --> @Classic298 commented on GitHub (Apr 22, 2025): @L0stInFades Open WebUI is meant to support only OpenAI API compatible AI endpoints. reasoning_effort is an OpenAI API endpoint. If Anthropic doesn't support this you have two options (or three) 1) Implement the connection to Anthropic's models yourself using functions, which accept the reasoning_effort param (or you just hardcode it into the param) and done (examples on [openwebui.com/functions](https://openwebui.com/functions)) 2) Use a middleware like LiteLLM - I am actually not sure if LiteLLM supports the reasoning_effort param in incoming requests, but you can configure it for each model individually so it would be a fix for you too 3) use openrouter So, yes, Anthropic doesn't support reasoning_effort. **But it is not Open WebUI's goal to implement all the small differences across the 100+ AI providers out there**. It is too much work to implement all the different APIs, let alone maintain it. I bet there'll be providers on a weekly basis that add features or make small changes on the API that could break things for Open WebUI. **Impossible to maintain.** -> That's where your own custom built functions (or community functions) or middlewares like LiteLLM come into play. If they don't manage to come up with a unified API then that's their problem if they don't want to be customer-friendly. Even Google learned this lesson and offers a beta version of an OpenAI API compatiple endpoint now for all their models. And if you are reliant on other providers who do not follow the OpenAI API schema, then use a middleware like LiteLLM or use openrouter. > In the OpenAI-compatible SDK format, Claude (developed by Anthropic) currently lacks support for enabling reasoning modes or controlling the reasoning token budget. > Actually,Anthropic's documentation demonstrates how to enable and configure reasoning by adding an extra_body parameter to API requests, like this: > response = client.chat.completions.create( > model="claude-3-7-sonnet-20240229", > messages=[...], > extra_body={ > "thinking": { > "type": "enabled", > "budget_tokens": 2000 > } And this is not OpenAI API compatible, like you claimed. OpenAI's docs show this: ``` reasoning_effort string or null Optional Defaults to medium o-series models only Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. ``` So actually Anthropic does NOT follow OpenAI API compatible API schemas.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#32339