How to configure codex@native with AZURE?
Resolved 💬 7 comments Opened Jun 2, 2025 by misteral Closed Nov 30, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What is the type of issue?
Documentation is missing
What is the issue?
I try to use standard openai configuration with AZURE openai endpoint, but it not work. Please help me configure it
Where did you find it?
_No response_
7 Comments
It's not just with native, it doesn't work with azure endpoint on latest and all versions in between native and latest too
At least include you config json/toml + logs
Hi @linegel , I try it with codex, installed by
npm i -g @openai/codex@nativeit does'n work.config.toml:
```config.toml
#model = "o4-mini"
profile = "azure"
sandbox_permissions = [
"disk-full-read-access",
"disk-write-platform-user-temp-folder",
"disk-write-platform-global-temp-folder",
"disk-write-cwd",
]
[model_providers.openai-chat-completions]
name = "azure"
base_url = "https://ai-albssdsdsdsds.openai.azure.com/"
env_key = "token"
wire_api = "chat"
[profiles.azure]
model = "o4-mini"
model_provider = "openai-chat-completions"
approval_policy = "on-failure"
{
"model": "o4-mini",
"provider": "AzureOpenAI",
"providers": {
"azure": {
"name": "AzureOpenAI",
"baseURL": "https://ai-albssdsdsdsds.openai.azure.com/",
"envKey": "token"
}
}
}
I can see the issue
envKey in config is wrong place for token - it's just a name of encryption variable from which you will get token, AZURE_API_KEY could be set as envKey
And then you should have AZURE_API_KEY with your token as value, so echo $AZURE_API_KEY shows your token
Once you update config it should start to work ;)
I can't run either.
Here is my
~/.codex/config.toml:The
AZURE_OPENAI_API_KEYis already set.What else I can try?
same error here, cannot use AOAI foundry model codex-mini
Related: https://github.com/openai/codex/issues/1552
Closing in favor of #2480