When using custom/local model_provider we still need to either login with ChatGPT or provide API key

Resolved 💬 3 comments Opened Oct 23, 2025 by danechitoaie Closed Oct 23, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.47.0

What subscription do you have?

API

Which model were you using?

gpt-5 / gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

When using custom/local model_provider we still need to either login with ChatGPT or provide API key.
It works even if we add a bogus API key, like "ABC" but doesn't make sense to require one.

What steps can reproduce the bug?

Run codex with custom/local model_provider

What is the expected behavior?

We should have a new option "3. Use custom model provider" (which doesn't do anything, just uses the custom model provider defined in config) next to the current ones "1. Login with ChatGPT", "2. Use API key"

Additional information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5409
  • #5282

Powered by Codex Action

etraut-openai contributor · 10 months ago

Thanks for the bug report.

When you use a custom model provider, you shouldn't see the login flow unless the provider is configured to required OpenAI auth (requires_openai_auth = true).

I just attempted to repro the problem, and it appears to be working for me. I added the following to my config.toml, relaunched codex. It bypassed the login screen and was able to use the model.

model_provider = "test"

[model_providers.test]
base_url = "https://api.openai.com/v1"
env_key = "OPENAI_API_KEY"
name = "test"
wire_api = "responses"

Please review your config to make sure the custom model is being specified correctly. If you're still seeing a problem, let us know if there are any additional repro steps.

danechitoaie · 10 months ago

Yes, just tested again and seems to be working.
I'm not really sure what I did that prompted me to auth.

We can close this. Thank you.