Skip to main content
Watch: I Built an AI App Without Leaving Databricks

OpenAI Codex CLI error

Codex CLI: stream disconnected before completion: error sending request for url...

Error message
stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)

Status: OpenLast verified 3 documented fixes2 sources

What it means

Codex could not send the request to the Codex responses endpoint at all, so it shows "Reconnecting" and fails after its retry attempts.

Causes

  • Maintainer etraut-openai on #13245: from uploaded logs this looks like a basic network connectivity issue; seen frequently with VPNs and proxies, or simple connection flakiness.
  • Maintainers also asked users without a VPN whether a corporate proxy or firewall was in the path (#13245).

How to fix it

  1. Fix 1.

    Check VPNs, proxies, corporate proxies and firewalls between your machine and chatgpt.com (maintainer etraut-openai on #13245).

  2. Fix 2.

    If your network uses a corporate TLS proxy or private root CA, point Codex at the PEM bundle; the same CA settings apply to login, normal HTTPS requests and WebSocket connections (official auth docs).

    Terminal
    export CODEX_CA_CERTIFICATE=/path/to/corporate-root-ca.pem
  3. Fix 3.

    If it persists, run /feedback to upload logs and share the thread ID with maintainers.

    Slash command
    /feedback

More Codex CLI errors

All 14 Codex CLI errors

FAQ

What does "stream disconnected before completion: error sending request for url..." mean in Codex CLI?

Codex could not send the request to the Codex responses endpoint at all, so it shows "Reconnecting" and fails after its retry attempts.

How do I fix "stream disconnected before completion: error sending request for url..."?

There are 3 documented fixes. Start with the first: Check VPNs, proxies, corporate proxies and firewalls between your machine and chatgpt.com (maintainer etraut-openai on #13245).

Is this Codex CLI error fixed?

Status: Open. Still open upstream. Any documented fixes are workarounds so far. Affected versions: Reported March 2026 (#13245); no version-specific fix announced

Sources

Last verified against 2 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.