Codex cli OSS not working with openwebUI
Resolved 💬 6 comments Opened Aug 21, 2025 by vyj7 Closed Aug 28, 2025
What version of Codex is running?
codex-cli 0.23.0
Which model were you using?
gpt-oss:20b
What platform is your computer?
Macos
What steps can reproduce the bug?
Hello,
I was trying to run codex-cli with OSS flag and use openwebUI APIs(hosted in a server).
i set the following in environment variable
export OPENAI_API_KEY="openwebui key"
export OPENAI_API_BASE="https://url_of_openwebUI/v1"
export CODEX_OSS_BASE_URL="https://url_of_openwebUI/v1"
when i ran codex --oss -m gpt-oss:20b
and then i enter a prompt it gives me unexpected status 405 Method Not Allowed: {"detail":"Method Not Allowed"}
What is the expected behavior?
OpenWebUI should be supported
What do you see instead?
_No response_
Additional information
_No response_
6 Comments
@ae-openai
Here it is mentioned that it can be proxied.
https://docs.openwebui.com/getting-started/api-endpoints/#-ollama-api-proxy-support
Able to run it with the following settings :
model = "gpt-oss-20b"
model_provider = "oui"
sandbox_mode = "workspace-write"
show_raw_agent_reasoning=true
[model_providers.oui]
name = "OUI"
base_url = "https://<openwebUI URL>/ollama/v1"
env_key = "OPENAI_API_KEY"
and then run codex.
Did you have to use the switches above as well? Did you set these as environment variables?
No, i added this in config.toml. and OPENAI_API_KEY is an environment variable where i stored API_KEY.
I directly added it as root but can easily be added in individual profiles
https://github.com/openai/codex/blob/main/docs/config.md
I run open-webui (http://192.168.11.167:8080/api) with ollama (http://192.168.11.167:11434/v1) as backend and I try to run codex to run against my open-webui API.
Here is my Codex config.toml:
My Ollama with gpt-oss:20b:
Ollama model list:
Ollama connect test:
Ollama streaming test:
open-webui model list:
Open-webui connection test:
open-webui streaming test:
We I run codex I can see it is using 80% GPU, 100% vram and about 20% CPU, but it looks like codex "hang":
Here is my codex log (with DEBUG=true RUST_LOG=debug):
codex-tui.log
Here is my open-webui log:
Here is my ollama log:
The model I use is a reasoning model (gpt-oss:20b / Ollama). From the logging I found out that when streaming it looks like it outputs tokens into a non-standard field (e.g. delta.reasoning_content / delta.reasoning) instead of delta.content. Codex (and other OpenAI-compatible clients) expect delta.content when streaming, so Codex never sees streamed text and appears to “hang”.
It think this is also the case in the original issue.
Should this be solved in open-webui, in Codex or may be using a proxy between codex and open-webui?