Configuration per documentation does not work. Connecting to Azure AI Foundry OpenAI models

Resolved 💬 2 comments Opened Jun 22, 2025 by itay-moav Closed Aug 7, 2025

What version of Codex is running?

0.1.2505172129

Which model were you using?

o4-mini and gpt-4.1

What platform is your computer?

Apple MAC M1-MAX
Sequia 15.5
32GB memory

I am exposing a model (gpt4.1) via a project in AI Foundry.
I am using this model in an app I am developing on my local machine, so I established there are no connections issues, just configuration. I am on a Mac, running BASH.

My config is:

{
"model": "gpt-4.1-development", (This is how I called my deployment in the AI Foundry project)
"provider": "azure",
"providers": {
"azure": {
"name": "AzureOpenAI",
"baseURL": "https://XXXXXX.openai.azure.com",
"envKey": "AZURE_OPENAI_API_KEY"
}
},
"history": {
"maxSize": 1000,
"saveHistory": true,
"sensitivePatterns": []
}
}

BASHRC:
export AZURE_OPENAI_API_KEY="XXXXXXXXXXXXXXXXX"
export AZURE_OPENAI_API_VERSION="2025-01-01-preview"

Again, I verified all these connection values via python code on my machine. Same machine I am running codex.
What am I missing?

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗