Skip to content

Azure Open AI not supported(?) #975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
brentwc opened this issue May 17, 2025 · 2 comments · May be fixed by #1012
Open

Azure Open AI not supported(?) #975

brentwc opened this issue May 17, 2025 · 2 comments · May be fixed by #1012
Labels
bug Something isn't working

Comments

@brentwc
Copy link

brentwc commented May 17, 2025

What version of Codex is running?

0.1.2505161243

Which model were you using?

gpt-4o-mini

What platform is your computer?

linux | x64 | 5.15.167.4-microsoft-standard-WSL2

What steps can reproduce the bug?

cat <<EOF > .env
AZURE_OPENAI_API_KEY=`<key.value>`
AZURE_OPENAI_API_VERSION=`<api.version>`
EOF
cat <<EOF > ~/.codex/config.yaml
model: gpt-4o-mini
provider: azure
providers:
  azure:
    name: AzureOpenAI
    baseURL: https://`<project.name>`.openai.azure.com/openai
    envKey: AZURE_OPENAI_API_KEY
approvalMode: suggest
fullAutoErrorMode: ask-user
notify: true
EOF
codex 'say hello'

What is the expected behavior?

"Hello."

What do you see instead?

╭──────────────────────────────────────────────────────────────╮
│ ● OpenAI Codex (research preview) v0.1.2505161243            │
╰──────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────╮
│ localhost session: 799947181fe549c0973432efcf8157de          │
│ ↳ workdir: ~/workspace/`<parent>`/`<child>`                  │
│ ↳ model: gpt-4o-mini                                         │
│ ↳ provider: azure                                            │
│ ↳ approval: suggest                                          │
╰──────────────────────────────────────────────────────────────╯
user
say hello

    system
    ⚠️  OpenAI rejected the request. Error details: Status: 401, Code: 401, Type: unknown, Message: 401 Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource..
     Please verify your settings and try again.

Additional information

The composition of Azure OpenAI API URL's may be in appropriately assembled by the codex package as this pattern worked for me; while codex refused.

curl https://`<project.name>`.openai.azure.com/openai/deployments/`<deployment-id>`/chat/completions?api-version=`<api.version>` \
  -H "Content-Type: application/json" \
  -H "api-key: `<key.value>`" \
  -d '{
    "messages": [{"role": "user", "content": "Say Hello"}],
    "temperature": 0,
    "max_tokens": 50
  }'
@brentwc brentwc added the bug Something isn't working label May 17, 2025
@clyzwangyuyang
Copy link

I have the same issue.
$ codex --provider deepseek --model deepseek-chat
╭──────────────────────────────────────────────────────────────╮
│ ● OpenAI Codex (research preview) v0.1.2505161243 │
╰──────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────╮
│ localhost session: 8786dd859c574a439ee73a038d033caf │
│ ↳ workdir: ~/Desktop/JS-123456 │
│ ↳ model: deepseek-chat │
│ ↳ provider: deepseek │
│ ↳ approval: suggest │
╰──────────────────────────────────────────────────────────────╯
user
hello

system
⚠️  OpenAI rejected the request. Error details: Status: 401, Code:
invalid_request_error, Type: authentication_error, Message: 401 Authentication Fails,
Your api key: ****Tv0A is invalid. Please verify your settings and try again.

@breakstring
Copy link

#891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants