stream error: stream disconnected before completion: stream closed before response.complete; retrying...
What version of Codex is running?
codex-cli 0.7.0
Which model were you using?
codex-mini-latest
What platform is your computer?
Linux 6.8.0-63-generic x86_64 x86_64
What steps can reproduce the bug?
Send any prompt after codex login
What is the expected behavior?
Model response
What do you see instead?
Additional information
No response
same error on macos anyone help?
Same error on WSL...
Same error on WSL...
Will anyone take care of this problem?
+1
- same problem
same issue in macOS with azure APIs
same issue version 0.7
@bolinfest
After endless searching and experimenting, I got past this issue. I don't think it's as much Codex's fault as the transition going on at Azure right now. I went to Azure AI Foundry and pieced together this config that works with codex with plain ol' gpt-4o.
model_provider = "azure"
provider = "azure"
model = "<deployment name>" # Your deployment name, not the ai model name.
# This From AI Foundry:
# https://<your resource>.openai.azure.us/openai/deployments/<deployment name>/chat/completions?api-version=2025-01-01-preview
[model_providers.azure]
name = "Azure OpenAI" # Not certain if this name matters.
base_url = "https://<resource>.openai.azure.us/openai/deployments/<deployment name>"
env_key = "AZURE_OPENAI_API_KEY"
#wire_api = "responses" # Don't think this works with GPT-4o
query_params = { api-version = "2025-01-01-preview" } # Get this from AI Foundry URL. Azure AI Services had the wrong version, which sent me down the wrong path for half a day.
I have tested this with the latest npm version (0.7.0)
Just to clarify, do you have any amount of money topped up to your credit? Check it here: https://platform.openai.com/settings/organization/billing/overview I had the same issue, but as soon as I topped up my balance with $5, the error message is gone. Even though I have/had $38 in credit grants.
ı have 120$ but not working
I have an Azure student license for context. The only configuration that does something for me is:
# Default settings ── used when you run plain `codex`
model_provider = "azure"
provider = "azure"
model = "o4-mini" # pick whatever you want as your day-to-day default
[model_providers.azure]
name = "Azure OpenAI"
# NOTE: leave **only** the part up to /openai
base_url = "https://<resource>.cognitiveservices.azure.com/openai"
env_key = "AZURE_OPENAI_API_KEY"
wire_api = "responses"
query_params = { api-version = "2025-04-01-preview" }
Where my "resource" name is the "folder" with multiple models deployed, I did not find a way to access an individual deployed model. Moreover, any other api-version fails. With this configuration o3-mini seems to work for more than one message (o4-mini always fails after the first response, always). see:
With o4-mini:
The set up it's just too messy. I'm working with the 0.7.0 version installed via brew.
https://grok.com/share/bGVnYWN5_291468fe-b9cd-44a4-928e-dbc5be3b4542
I did build the latest main branch up until now, the codex cli interface is different (OpenAI Codex (research preview) v0.0.0-dev ). And now nothing works with the config I shared before, which I had to convert to JSON since for some reason the .toml version is ignored. See:
At least it loads faster and you can try more messages once past the error. I'm giving up.
Same for me
Same error as everyone above. I have $ in my api credit.
when I logged in initially I got:
Credit redemption request failed: HTTP Error 400: Bad Request Successfully logged in
For me, if I use the default model it works just fine, but if I update config.toml to have model = "o3" then I receive this error endlessly. Similarly, if I launch with codex -m o3, will get the same error. It seems specific to using o3 for me. I have a Plus subscription so I wouldn't expect there to be an issue with credits, etc.
For me ocurred the same when using the models: codex-mini-latest and o4-mini.
But when using o3-mini it started working. Is codex cli limited to specific models for the moment?
As a small update - I found that after I went through Verification in my Organization (using third party Persona svc) I was able to use o3 via codex/cli for quite some time (hours). I did however once again just start observing the same issue consistently, 3 or 4 retries resulting in BackgroundEvent { message: "stream error: stream disconnected before completion..." }