⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 4/5 in 1.471s while I am running free models from openrouter

Resolved 💬 18 comments Opened Aug 23, 2025 by Priyabhunia Closed Aug 26, 2025
💡 Likely answer: A maintainer (oyiakoumis, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.23.0

Which model were you using?

etc.. opensource free models like quencoder and kimi

What platform is your computer?

windows 11 x64

What steps can reproduce the bug?

Just run any free or opensource model from openrouter.

What is the expected behavior?

This should behave normal like working like a agent and give me ans .

What do you see instead?

After 1 minute or use this is not even working not even giving a reply only one error is showing .

---------------------------------------------------------------------------------------------------------------------------------------
⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 1/5 in 207ms…

⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 2/5 in 429ms…

⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 3/5 in 743ms…

⚠ stream error: unexpected status 400 Bad Request: {"error":{"message":"Provider returned error","code":400,"metadata":{"raw":"{\"details\":{\"_errors\":[],\"tools\":
{\"0\":{\"_errors\":[],\"function\":{\"_errors\":[\"Unrecognized key(s) in object: 'strict'\"]}},\"1\":{\"_errors\":[],\"function\":{\"_errors\":[\"Unrecognized key(s)
in object: 'strict'\"]}},\"_errors\":[]}},\"issues\":[{\"code\":\"unrecognized_keys\",\"keys\":[\"strict\"],\"path\":[\"tools\",0,\"function\"],\"message\":\"Unrecognized      
key(s) in object: 'strict'\"},{\"code\":\"unrecognized_keys\",\"keys\":[\"strict\"],\"path\":[\"tools\",1,\"function\"],\"message\":\"Unrecognized key(s) in object:
'strict'\"}]}","provider_name":"Venice"}},"user_id":"user_2xURwxNi7G6RUn2NG0Ur7kQvKDb"}; retrying 4/5 in 1.754s…
⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 5/5 in 3.253s…
🖐 exceeded retry limit, last status: 429 Too Many Requests


### Additional information

After that this thing never worked .

⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 1/5 in 211ms…

⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 2/5 in 373ms…

⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 3/5 in 864ms…

⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 4/5 in 1.555s…

⚠ stream error: exceeded retry limit, last status: 429 Too Many Requests; retrying 5/5 in 3.312s…

🖐 exceeded retry limit, last status: 429 Too Many Requests               

Even the OSS models are not working.

View original on GitHub ↗

18 Comments

milisp · 11 months ago

This is not a bug. You can use Gemini or ollama as a model_provider.

You can try my Codex GUI - https://github.com/milisp/codexia - missing GUI/IDE for the openai Codex CLI built with Tauri v2. @file from FileTree and notes system

Medard-prog · 11 months ago

That's just from openrouter rate limiting....

oyiakoumis contributor · 11 months ago

Worked for me on MacOS:
my ~/.codex/config.toml:

[model_providers.openrouter]
name = "OpenRouter"
base_url = "https://openrouter.ai/api/v1"
env_key = "OPENROUTER_API_KEY"

[profiles.qwen3coder]
model_provider = "openrouter"
model = "qwen/qwen3-coder:free"

then:
codex --profile qwen3coder

As Medard-prog mentioned, it could be also OpenRouter's rate limit.

Priyabhunia · 11 months ago
This is not a bug. You can use Gemini or ollama as a model_provider. Get google Gemini api key from http://aistudio.google.com just download https://ollama.com and then get some models from ollama You can try my Codex GUI - https://github.com/milisp/codexia - missing GUI/IDE for the openai Codex CLI built with Tauri v2. @file from FileTree and notes system
definitely not working with  and with-out openai layer ---
# [profiles.gemini]
model_provider = "googlegemini"
model = "gemini-1.5-flash"
# Configuration for Codex
[model_providers.googlegemini]
name = "Google Gemini"
base_url = "https://generativelanguage.googleapis.com/v1beta/openai/"
# or base_url = "https://generativelanguage.googleapis.com/v1beta/models/"
env_key = "GEMINI_API_KEY"
milisp · 11 months ago

just use gemini

Required set system env GEMINI_API_KEY

export GEMINI_API_KEY=xxx

Edit ~/.codex/config.toml

[model_providers.gemini]
name = "gemini"
base_url = "https://generativelanguage.googleapis.com/v1beta/openai"
env_key = "GEMINI_API_KEY"

[profiles.gemini]
model_provider = "gemini"
model = "gemini-2.5-flash-lite"

Run one of these

codex --profile gemini
codex --profile gemini -m gemini-2.5-flash
codex --profile gemini -m gemini-2.5-pro
Priyabhunia · 11 months ago

I did exact same thing but still this error
error: profile gemini is not defined

btw I have two toml file one is from this cloned repo and other is from my C drive .
this cloned repo one mostly not working thats why I am using the application version (.codex).

<img width="458" height="61" alt="Image" src="https://github.com/user-attachments/assets/3556ee1e-f598-49ca-9b29-a06af934f72b" />

milisp · 11 months ago

Maybe you put it at the wrong directory

You should create a .codex at home then create config.toml

on Windows

C:\Users\USERNAME\.codex\config.toml
Priyabhunia · 11 months ago

I know thats the right one . I am already doing in that. but still not working

milisp · 11 months ago

I tried at windows 11 C:\Users\username\.codex\config.toml it works.

Do you forget set env or restart the terminal cmd/powershell

Maybe you should delete the .codex folder and try again.

cmd

set GEMINI_API_KEY=xxx

powershell

$env:GEMINI_API_KEY=xxx

Or are you using VPN?

Your config path seems not right from the screenshot

You should show the absolute path not the screenshot.

Priyabhunia · 11 months ago

C:\Users\priya\.codex\config.toml -I am using this one
and other one is E:\openai\codex\codex\.github\codex\home\config.toml . this is the one I am not using because this is not working.

here is my path and yes I set the api key every time .

No why should I be using vpn . I am just using the vscode powershell and cmd.

milisp · 11 months ago

It seems you missed a \

It should be C:\Users\priya\.codex\config.toml

Priyabhunia · 11 months ago

<img width="1174" height="1163" alt="Image" src="https://github.com/user-attachments/assets/8e7518ee-f1bb-4fe1-bb7f-35fc3127db0d" />
I know what should i say but i pasted the right thing

milisp · 11 months ago

Screenshot your vscode with C:\Users\priya\.codex\config.toml content

Maybe it's the problem of vscode, you can try to use powershell or cmd to see if they are working

Priyabhunia · 11 months ago

<img width="803" height="353" alt="Image" src="https://github.com/user-attachments/assets/de913f77-1c30-4ccb-94e9-49c1df46910a" />

bro I almost tried everything

<img width="1228" height="91" alt="Image" src="https://github.com/user-attachments/assets/2e27e4ad-30ff-4dcf-bdbc-61523b15827f" />

I still dont know why is that even. I tried in administrator powershell and cmd and every free model

milisp · 11 months ago

I ask ChatGPT because you use cargo, you should do it like this, it work for me on macOS:

cargo run --bin codex -- --profile gemini
Priyabhunia · 11 months ago

<img width="681" height="353" alt="Image" src="https://github.com/user-attachments/assets/5b834153-88b4-4a39-b244-3faf69be19c2" />

this is showing working something but still this error

milisp · 11 months ago

Because of The URL has an extra / at the end.

It should be:

https://generativelanguage.googleapis.com/v1beta/openai

Priyabhunia · 11 months ago

<img width="471" height="211" alt="Image" src="https://github.com/user-attachments/assets/9e8d59c2-3203-40c8-94cb-ac146208bda6" />

bro there must be something wrong with me 😭😭.. Thanks.

btw just to be curious is this case for every baseurl.

its time to move on from chatgpt free tier

<img width="980" height="462" alt="Image" src="https://github.com/user-attachments/assets/3e888af3-28d0-4ccb-9a0e-165a0b40db0f" />