Removing requirement for OPENAI_API_KEY when running models locally

Resolved 💬 0 comments Opened Apr 22, 2025 by moppywhip Closed Apr 22, 2025

What is the type of issue?

Bug 🪲

What is the issue?

When using ollama as a model provider, codex still requires OPENAI_API_KEY to start up.

kevinzhao@hnt-07329 codex % codex --provider ollama

Missing OpenAI API key.

Set the environment variable OPENAI_API_KEY and re-run this command.
You can create a key here: https://platform.openai.com/account/api-keys 

This is not necessary as local LLMs do not require any authentication to use.

Where did you find it?

_No response_

View original on GitHub ↗