unable to run codex cli with azure openai deployment

Resolved 💬 4 comments Opened Sep 16, 2025 by Fatcat-tech Closed Nov 24, 2025

What version of Codex is running?

codex-cli 0.36.0

Which model were you using?

gpt-5

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Unable to make codex cli work with azure open ai deployment. PFA my config.toml # Set the default model and provider model = "gpt-5" model_provider = "azure" preferred_auth_method = "apikey" # Configure the Azure provider [model_providers.azure] name = "Azure" # Make sure you set the appropriate subdomain for this URL. #https://rubrixai-1142-resource.cognitiveservices.azure.com/openai/deployments/gpt-5/chat/completions base_url = "https://rubrixai-1142-resource.cognitiveservices.azure.com/openai/v1/" env_key = "AZURE_OPENAI_API_KEY" query_params = { api-version = "2025-01-01-preview" } wire_api = "responses" model_reasoning_effort = "high" # Example of configuring an MCP server for Playwright ⚠️ stream error: unexpected status 400 Bad Request: {"error":{"code":"BadRequest","message":"API version not supported"}}; retrying 1/5 in 208ms… ⚠️ stream error: unexpected status 400 Bad Request: {"error":{"code":"BadRequest","message":"API version not supported"}}; retrying 2/5 in 417ms… ⚠️ stream error: unexpected status 400 Bad Request: {"error":{"code":"BadRequest","message":"API version not supported"}}; retrying 3/5 in 728ms… ⚠️ stream error: unexpected status 400 Bad Request: {"error":{"code":"BadRequest","message":"API version not supported"}}; retrying 4/5 in 1.713s… ⚠️ stream error: unexpected status 400 Bad Request: {"error":{"code":"BadRequest","message":"API version not supported"}}; retrying 5/5 in 3.511s… ■ unexpected status 400 Bad Request: {"error":{"code":"BadRequest","message":"API version not supported"}}

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

Soorma718 · 11 months ago

Same here, not able to get it to work in wsl, works fine on mac with the same credentials

jepio · 11 months ago

Try these docs: https://github.com/openai/codex/blob/main/docs/config.md#azure-model-provider-example

The API version needs to be at least 2025-04-01-preview, in the error above it is 2025-01-01-preview.

Fatcat-tech · 11 months ago

still doesn't work

Configure the Azure provider

[model_providers.azure]
name = "Azure"

Make sure you set the appropriate subdomain for this URL.

base_url = "https://rubrixai-1142-resource.cognitiveservices.azure.com/openai/deployments/gpt-5/chat/completions"
env_key = "AZURE_OPENAI_API_KEY"
query_params = { api-version = "2025-04-01-preview" }
wire_api = "responses"

jepio · 11 months ago

@Fatcat-tech your base_url needs to be "https://rubrixai-1142-resource.cognitiveservices.azure.com/openai" and model "gpt-5".