API Error: 400 messages.N: system content must contain at least one block
Claude Code changes effort mid-session with an empty system message. A gateway that drops its output_config forwards an empty message the API rejects; update or bypass it.
Summary
- Anthropic's per-message effort is a system message with empty content and output_config.effort, placed inside messages.
- Gateways that rebuild requests have stripped output_config and forwarded the bare empty system message, which the API rejects.
- new-api and vm2api closed issues for this in September and October 2026; update the gateway or turn on body passthrough.
- Until then, CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 stops Claude Code sending the empty entries; a session that already fails needs /clear.
On this page
An effort change that lost its payload
API Error: 400 messages.1: system content must contain at least one block
The number after messages. is the position of an empty system message inside the messages array. Claude Code puts one there on purpose. Anthropic's per-message effort feature, in beta, changes the effort level mid-conversation without breaking the prompt cache, and its documented form is a role: "system" message with empty content and the new level in output_config:
{ "role": "system", "content": [], "output_config": { "effort": "high" } }
With the beta header, the API accepts that message. Strip the output_config and what remains is an empty system message with nothing in it, which is what this 400 rejects. Anthropic's gateway compatibility guide lists this exact symptom for Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1: a gateway that strips the field from an empty entry.
Check whether a gateway sits in between
The public reports that name an endpoint all go through a proxy or relay:
- new-api issue #7563: the gateway forwarded
{"role":"system","content":[]}without the per-messageoutput_config, because its message type only keptroleandcontentwhen it re-serialized the request. Closed as completed on 2026-09-25 with PR #7561. - vm2api issue #375: after switching from
mediumtohigheffort in one Claude Code session, requests failed atmessages.236,messages.48andmessages.194. Closed on 2026-10-12, citing a fix that drops empty system control turns. - claude-code issue #101181: on Claude Code 2.1.296 through CLIProxyAPI 8.0.0, the error appeared after a manual
/compactin a long session, and the captured message was{"role": "system", "content": [], "output_config": {"effort": "medium"}}. A direct request without the proxy was not tried.
Run /status in Claude Code. If the base URL is not Anthropic's, the gateway is the first suspect:
- If you run the gateway, update it to a release with the fix for your project, or turn on request body passthrough so it forwards fields it does not model. new-api's issue names passthrough being off as the condition.
- If someone else runs it, send them the error and the new-api or vm2api issue. A gateway that cannot carry
output_configshould drop the empty effort message rather than forward it.
Stop it from your side
While the gateway is unfixed, Anthropic's guide gives one switch that stops Claude Code from sending both the per-turn effort field and the empty entries:
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
Set it in the environment that starts Claude Code, or in the env block of ~/.claude/settings.json, then start a new session. It also turns off other pre-release features. If you would rather keep those, avoid the trigger instead; the reports tie the empty message to an effort change in the session, either from /effort or carried through /compact:
- Pick one effort level before you start and keep it. If you change it, or the error starts right after
/compact, start a new session. - A session that already fails keeps failing on retry, because the empty message is part of its history. Run
/clearor start a new session. - The #101181 reporter repaired a resumed session by editing its transcript, but the next manual
/compactbrought the error back, so treat that as a rescue only.
An older report, claude-code issue #80881 on Claude Code 2.1.218, saw the same text when launching parallel subagents in Plan Mode, without saying which endpoint was used. It was closed as not planned; commenters suggested leaving Plan Mode or running the agents one after another.
Related gateway errors
A gateway that rejects a system message inside messages outright gives a different message, covered on Invalid input at messages.1.role. If the gateway forwards the field but the account caps effort, see Invalid effort level. To check what a relay does to your requests in general, see how to check that an LLM API relay serves the model you pay for.
Sources and checks
- Effort (Claude API), per-message effort
- Claude Code gateway compatibility guide
- QuantumNous/new-api #7563: message-level output_config (per-message effort) dropped when forwarding, upstream returns 400
- dofastted/vm2api #375: upstream rejects empty system message after switching effort in one Claude Code session
- anthropics/claude-code #101181: Manual /compact emits empty system message and breaks resumed sessions in 2.1.296
- anthropics/claude-code #80881: system content must contain at least one block when launching parallel subagents in Plan Mode