openclaw - 💡(How to fix) Fix [Bug]: OpenRouter `deepseek/deepseek-v4-flash` returns 400 — plugin sends both `reasoning_effort` and `reasoning.effort` in the same payload [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When the OpenAI-compatible client built into OpenClaw calls openrouter/deepseek/deepseek-v4-flash, the request payload includes BOTH:

  • top-level reasoning_effort: <level>
  • nested reasoning: { effort: <level> }

OpenRouter rejects this combination with HTTP 400 ("only one of reasoning_effort, reasoning.effort allowed").

The model is then unusable via OpenRouter for any request that sets a thinking level.

Error Message

{"error":{"message":"only one of reasoning_effort or reasoning.effort allowed","type":"invalid_request_error"}}

Root Cause

DeepSeek V4 Flash is the project's go-to free fallback (replaced NVIDIA NIM after Apr 25 fallback chain edit). Losing it for any thinking-enabled request forces fallback to paid models.

Fix Action

Fixed

Code Example

{
  "model": "deepseek/deepseek-v4-flash",
  "messages": [...],
  "reasoning_effort": "medium",
  "reasoning": { "effort": "medium" },
  "stream": true
}

---

HTTP/1.1 400 Bad Request
{"error":{"message":"only one of reasoning_effort or reasoning.effort allowed","type":"invalid_request_error"}}
RAW_BUFFERClick to expand / collapse

Summary

When the OpenAI-compatible client built into OpenClaw calls openrouter/deepseek/deepseek-v4-flash, the request payload includes BOTH:

  • top-level reasoning_effort: <level>
  • nested reasoning: { effort: <level> }

OpenRouter rejects this combination with HTTP 400 ("only one of reasoning_effort, reasoning.effort allowed").

The model is then unusable via OpenRouter for any request that sets a thinking level.

Reproduce

  1. Pick any agent whose primary or fallback is openrouter/deepseek/deepseek-v4-flash.
  2. Set thinking level to low|medium|high (anything other than off).
  3. Issue a turn — observe HTTP 400 from OpenRouter.

Expected

Plugin sends only ONE of the two fields. The OpenRouter docs prefer nested reasoning.effort, but the OpenAI Responses API (which this transport is supposed to mimic) uses top-level reasoning_effort. Either is fine; both is broken.

Actual

Both fields are sent in the same payload, so OpenRouter 400s.

Sample request body (redacted)

{
  "model": "deepseek/deepseek-v4-flash",
  "messages": [...],
  "reasoning_effort": "medium",
  "reasoning": { "effort": "medium" },
  "stream": true
}

Sample response

HTTP/1.1 400 Bad Request
{"error":{"message":"only one of reasoning_effort or reasoning.effort allowed","type":"invalid_request_error"}}

Why this matters

DeepSeek V4 Flash is the project's go-to free fallback (replaced NVIDIA NIM after Apr 25 fallback chain edit). Losing it for any thinking-enabled request forces fallback to paid models.

Environment

OpenClaw 2026.5.7 (eeef486); macOS; OpenRouter routing via the OpenAI-compatible transport in the gateway.

Suggestion

In the request-builder for the OpenAI-compatible transport, when targeting deepseek-* (or any provider that errors on the duplicate), drop one of the two. Probably preserve reasoning.effort (nested form, OpenRouter's preferred shape) and drop reasoning_effort.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: OpenRouter `deepseek/deepseek-v4-flash` returns 400 — plugin sends both `reasoning_effort` and `reasoning.effort` in the same payload [2 pull requests]