Omniscio

OmniscioGuidesEmpty or malformed response

Claude Code: API returned an empty or malformed response

Last checked against Anthropic's documentation on November 18, 2026. By the Omniscio team. Updated .

What is the exact message?

API returned an empty or malformed response (HTTP 200) — check for a proxy or gateway intercepting the request.

The opening is followed by a Response: clause and a sentence naming the failed request, so the full line is longer than this and differs run to run.

What does it mean?

After a streaming request fails, Claude Code retries it once as a plain request with no streaming. This time the reply carried an HTTP success status, but its body was not a Claude API message: an HTML error or sign-in page, an empty body, or JSON in another format.

Anthropic says a proxy, a gateway, or a network sign-in page answering in the API's place is the usual source. Claude Code does not retry the request, and the turn ends with this error.

What the rest of the line tells you

  • The Response: clause carries the content type and the kind of body, such as body is an HTML page or empty body, plus its size in bytes.
  • Whether the response carried an Anthropic request id. An API reply has one; a proxy's own error page does not.
  • A named server or intermediary header. When the response names a recognizable server such as nginx or cloudflare, or carries a header such as cf-ray or via, the clause lists it.
  • The failed streaming request. A closing sentence names its request id and the failure that triggered the retry. When a stream had opened before the failure, it also reports how many stream events arrived and how long the stream had been silent when it broke.

How do I fix it?

  1. Read the Response: clause to see which system answered. An HTML body, no Anthropic request id, or a named server such as nginx or cloudflare means something between Claude Code and the API replied instead of it.
  2. On a network with a sign-in page, sign in first. Guest Wi-Fi intercepts requests until you complete its portal in a browser. Do that, then resend.
  3. Behind an LLM gateway, test the route directly. Send one request past the gateway to the API. When the direct route answers in the API's format, fix the hop that returns the non-API response.
  4. If the non-streaming route is the one being intercepted, turn it off. Set CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 before launching so that retry is never used. A 404 from the streaming endpoint still triggers it.

How do I know it is fixed?

  • The next request streams a normal reply instead of ending the turn with this line.
  • A direct request to the API returns the API's JSON, not an HTML page.
  • Pasting the same prompt on the same network produces a streamed reply rather than an HTML page.

Where these answers come from

  • The message, quoted word for word, the Response: clause, the causes and the four steps: Anthropic's error reference, read November 18, 2026.
  • The 404 exception to the fallback switch: the same error reference entry. The variable itself is on Environment variables, read the same day.
  • Before v2.1.234 the message ended after intercepting the request; before v2.1.271 a valid API message under a non-JSON content type such as text/plain also ended the turn with this error. The same error reference entry, read the same day.

Common questions

Why does it say HTTP 200 when the request failed?

The status describes the answer the intermediary sent, not your request. Something in the path replied successfully with a page or body that is not an API message.

What does the Response line tell me?

The content type, the kind of body, its size in bytes, and whether an Anthropic request id came back. It names a recognizable server or intermediary header when it finds one.

Does Claude Code retry this error?

No. Anthropic's reference says Claude Code does not retry and the turn ends with the error. Clear it by fixing whatever answered in the API's place.

Could this be a login problem?

Only on a network that intercepts traffic. A sign-in page arriving where the API should answer is exactly what this message describes, and completing the sign-in clears it.