Перейти к навигации

Why does SillyTavern Custom OpenAI-compatible return 400 Bad Request or show an API warning?

Просмотр в формате Markdown

SillyTavern’s Custom (OpenAI-compatible) source leaves Prompt Post-Processing set to None by default. With None, SillyTavern forwards consecutive messages from the same role, multiple system messages, or an assistant greeting with no preceding user message. Strict models on BeatAPI (including Gemini, DeepSeek, and MiniMax) reject those message arrays with 400 Bad Request.

Fix 400 role-order errors with Prompt Post-Processing

In SillyTavern’s API Connections panel under Custom (OpenAI-compatible), switch Prompt Post-Processing from None to the least restrictive mode that clears the 400 error:

Prompt Post-Processing modeAction on the promptWhen to use
Merge consecutive messagesMerges back-to-back messages from the same role into one turnConsecutive user turns or multi-block presets
Semi-strictMerges consecutive roles and keeps one system message at the topDefault choice for Gemini, DeepSeek, GLM, and MiniMax on Custom endpoints
StrictApplies Semi-strict rules and ensures the first non-system turn is a user messageCharacter cards starting with an assistant greeting when the model rejects assistant-first history

If your SillyTavern setup uses tool calling or function calling, select the (with tools) variant of Merge, Semi-strict, or Strict. The standard variants strip tool calls from outgoing requests.

Clear false connection status warnings

If Test Message returns a valid reply while SillyTavern still displays a red API status warning, enable Bypass API status check in the API Connections panel. Enabling Bypass API status check disables SillyTavern’s status probe without affecting chat completions or model listing.