Supporting Azure OpenAI

Resolved 💬 11 comments Opened Apr 16, 2025 by monuminu Closed Aug 7, 2025
💡 Likely answer: A maintainer (thegovind, contributor) responded on this thread — see the highlighted reply below.

Supporting Azure OpenAI

View original on GitHub ↗

11 Comments

ralzinov · 1 year ago

LiteLLM potentially might help https://docs.litellm.ai/docs/

nikhil-pandey · 1 year ago

We should be able to bake in Azure OpenAI support directly from the openai package — likely just a few lines of changes.

import { AzureOpenAI, OpenAI } from "openai";

I might take a stab at it later today, or wire it up through GitHub agent mode if I get the chance.

rgregg · 1 year ago

I asked codex this question on it's own repo - and it says you should be able to set two ENV vars to redirect it:

 • Set OPENAI_BASE_URL to your Azure OpenAI endpoint (e.g. https://<your‑resource>.openai.azure.com)
 • Set OPENAI_API_KEY (or codex config set apiKey …) to your Azure API key

I haven't given it a try yet though.

guygregory · 1 year ago
I asked codex this question on it's own repo - and it says you should be able to set two ENV vars to redirect it: `` • Set OPENAI_BASE_URL to your Azure OpenAI endpoint (e.g. https://<your‑resource>.openai.azure.com) • Set OPENAI_API_KEY (or codex config set apiKey …) to your Azure API key `` I haven't given it a try yet though.

Deployment name for the model will also be required for AOAI

SeaDude · 1 year ago

Please also consider implementing azure_ad_token (or the like) so that enterprises don’t have to communicate and manage AOAI API keys.

Reference

thegovind contributor · 1 year ago
surim0n · 1 year ago

Following, if someone successfully gets it running please update this thread. thank you x 1000000.

cavanaug · 1 year ago

It would be a godsend if you supported the GH copilot api similar to how vscode utilizes models. GH copilot also has a generous free tier and is well utilized in Enterprises.

The GH OpenAi api is a slight variant on the generic OpenAI api. More information and how litellm supported it available at https://github.com/BerriAI/litellm/issues/6564

jslitzkerttcu · 1 year ago

PR is being worked on in #769

robotdad · 1 year ago

Looks like the PR for this was merged, but this does not have Entra support right? #1056 covers Entra and has a PR #1062 ready to go for that.

doggy8088 · 1 year ago

Azure OpenAI already supports the Azure OpenAI Responses API. This should be supported in Codex CLI.