hermes - 💡(How to fix) Fix [Bug]: DeepSeek provider returns HTTP 400 on first message with deepseek-v4-flash (v0.14.0)

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…

Error Message

⚠️ API call failed (attempt 1/3): BadRequestError [HTTP 400] 🔌 Provider: deepseek Model: deepseek-v4-flash 🌐 Endpoint: https://api.deepseek.com/v1 📝 Error: HTTP 400: Error code: 400 ⚠️ Non-retryable error (HTTP 400) — trying fallback... ❌ Non-retryable client error (HTTP 400). Aborting.

Root Cause

The built-in deepseek provider likely adds extra parameters (possibly related to thinking mode / reasoning_content handling, extra_body, or tool schema formatting) that the current DeepSeek V4 API does not accept. Using provider: custom bypasses all provider-specific logic and sends a clean OpenAI-compatible request, which DeepSeek accepts without issue.

Also noted: regardless of the base_url value in the config, the deepseek provider always resolves to https://api.deepseek.com/v1 as the endpoint.

Fix Action

Workaround

Use provider: custom instead of provider: deepseek:

model:
  default: deepseek-v4-flash
  provider: custom
  base_url: https://api.deepseek.com
  api_key: sk-xxxxx
  api_mode: openai-completions

Code Example

model:
  default: deepseek-v4-flash
  provider: deepseek
  base_url: https://api.deepseek.com
  api_key: sk-xxxxx

---

⚠️  API call failed (attempt 1/3): BadRequestError [HTTP 400]
   🔌 Provider: deepseek  Model: deepseek-v4-flash
   🌐 Endpoint: https://api.deepseek.com/v1
   📝 Error: HTTP 400: Error code: 400
⚠️ Non-retryable error (HTTP 400) — trying fallback...
Non-retryable client error (HTTP 400). Aborting.

---

curl https://api.deepseek.com/chat/completions \
  -H "Authorization: Bearer sk-xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hello"}]}'
# Returns 200 OK with valid response

---

model:
  default: deepseek-v4-flash
  provider: custom
  base_url: https://api.deepseek.com
  api_key: sk-xxxxx
  api_mode: openai-completions

---

model:
  default: deepseek-v4-flash
  provider: custom
  base_url: https://api.deepseek.com
  api_key: sk-xxxxx
  api_mode: openai-completions
RAW_BUFFERClick to expand / collapse

[Bug]: DeepSeek provider returns HTTP 400 on first message with deepseek-v4-flash (v0.14.0)

Bug Description

Using provider: deepseek with deepseek-v4-flash model, every API call fails with HTTP 400 on the very first message. The error occurs immediately — not on multi-turn, not on tool calls — just a simple "hello" triggers it.

The same API key and model work perfectly with curl directly against https://api.deepseek.com/chat/completions.

Workaround: Switching to provider: custom with api_mode: openai-completions fixes the issue, confirming that the built-in deepseek provider is sending parameters that DeepSeek's API rejects.

Steps to Reproduce

  1. Configure Hermes with:
model:
  default: deepseek-v4-flash
  provider: deepseek
  base_url: https://api.deepseek.com
  api_key: sk-xxxxx
  1. Run hermes and send any message (e.g., "hello")

  2. Observe:

⚠️  API call failed (attempt 1/3): BadRequestError [HTTP 400]
   🔌 Provider: deepseek  Model: deepseek-v4-flash
   🌐 Endpoint: https://api.deepseek.com/v1
   📝 Error: HTTP 400: Error code: 400
⚠️ Non-retryable error (HTTP 400) — trying fallback...
❌ Non-retryable client error (HTTP 400). Aborting.
  1. Verify API key works with curl:
curl https://api.deepseek.com/chat/completions \
  -H "Authorization: Bearer sk-xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hello"}]}'
# Returns 200 OK with valid response
  1. Switch to custom provider — works immediately:
model:
  default: deepseek-v4-flash
  provider: custom
  base_url: https://api.deepseek.com
  api_key: sk-xxxxx
  api_mode: openai-completions

Expected Behavior

provider: deepseek should work the same as provider: custom for basic chat completions with deepseek-v4-flash.

Actual Behavior

provider: deepseek sends parameters that the DeepSeek API rejects with HTTP 400. The error log only shows Error code: 400 with no detailed message from DeepSeek, making it very difficult to diagnose.

Root Cause Analysis

The built-in deepseek provider likely adds extra parameters (possibly related to thinking mode / reasoning_content handling, extra_body, or tool schema formatting) that the current DeepSeek V4 API does not accept. Using provider: custom bypasses all provider-specific logic and sends a clean OpenAI-compatible request, which DeepSeek accepts without issue.

Also noted: regardless of the base_url value in the config, the deepseek provider always resolves to https://api.deepseek.com/v1 as the endpoint.

Affected Component

Agent Core / DeepSeek Provider

Operating System

macOS (Apple Silicon)

Python Version

Python 3.11.4

Hermes Version

Hermes Agent v0.14.0 (2026.5.16)

Workaround

Use provider: custom instead of provider: deepseek:

model:
  default: deepseek-v4-flash
  provider: custom
  base_url: https://api.deepseek.com
  api_key: sk-xxxxx
  api_mode: openai-completions

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

hermes - 💡(How to fix) Fix [Bug]: DeepSeek provider returns HTTP 400 on first message with deepseek-v4-flash (v0.14.0)