bug: unsupported model error when using ollama
Resolved 💬 6 comments Opened Oct 19, 2025 by johnabbott72 Closed Oct 21, 2025
💡 Likely answer: A maintainer (pakrym-oai, contributor)
responded on this thread — see the highlighted reply below.
I am getting unexpected status 400 Bad Request: {"detail":"Unsupported model"} when trying to use codex cli with ollama. Trying several models:
[providers.openai]
api_base = "http://10.0.0.8:11434/v1"
api_key = "none"
[profiles.ollama-gpt-oss]
provider = "openai"
model = "gpt-oss:20b"
api_base = "http://10.0.0.8:11434/v1"
api_key = "none"
[profiles.ollama-qwen3]
provider = "openai"
model = "qwen3-coder:30b"
api_base = "http://10.0.0.8:11434/v1"
api_key = "none"
[profiles.ollama-qwen-coder-25]
provider = "openai"
model = "qwen2.5-coder:7b"
api_base = "http://10.0.0.8:11434/v1"
api_key = "none"
with command: codex --profile ollama-qwen-coder-25
this is on codex 0.47
anyone else getting this error?
6 Comments
only some ollama models will work. they need to support tool usage.
these models all support tools and should be in alignment with expected formats - especially openai's own gpt-oss
You are receiving
Unsupported modelfrom OpenAI servers, meaning you're not hitting the custom endpoint. How are you selecting the model provider when starting codex?above on the ticket you will see the config.toml I have and then calling it with: codex --profile ollama-qwen-coder-25
I've been getting these errors while using gpt-5-codex high w/codex cli.
<img width="692" height="62" alt="Image" src="https://github.com/user-attachments/assets/650a957d-9233-48fd-947f-574afb73442b" />
I did get this going - I was missing the oss command: codex --oss --profile ollama-gpt-oss
But the problem was I was trying to reach an ollama instance on another machine on my network and apparently you can't run with the --oss command unless you are on the machine hosting ollama - this should probably be a feature request