Why
#307 added the universal OpenAI-compatible provider and lists Azure OpenAI in its supported-endpoints table:
Azure OpenAI https://{resource}.openai.azure.com/openai/deployments/{deployment}
But Azure OpenAI's /chat/completions requires:
- An
api-version=<YYYY-MM-DD> query parameter on every request (mandatory; the request 400s without it).
- The
api-key: <key> header instead of Authorization: Bearer <key> (Azure also accepts Bearer when AAD-auth is in use, but the api-key path is the default for key auth).
OpenAIProvider.call() today doesn't add either, so the Azure path in the supported-endpoints table is non-functional as-shipped.
Proposal
In src/providers/openai.ts:
private isAzure(): boolean {
const url = this.baseURL ?? "";
return url.includes("openai.azure.com") || url.includes("/openai/deployments/");
}
private buildRequestUrl(path: string): string {
const base = this.baseURL ?? "https://api.openai.com";
if (this.isAzure()) {
const apiVersion = getEnvVar("AZURE_OPENAI_API_VERSION") ?? "2024-08-01-preview";
return `${base}/chat/completions?api-version=${apiVersion}`;
}
return `${base}/v1/chat/completions`;
}
private buildHeaders(): HeadersInit {
if (this.isAzure()) {
return { "Content-Type": "application/json", "api-key": this.apiKey };
}
return { "Content-Type": "application/json", Authorization: `Bearer ${this.apiKey}` };
}
Note: Azure URLs already include the deployment path, so we append /chat/completions (no /v1/ segment).
Acceptance
OPENAI_BASE_URL=https://<resource>.openai.azure.com/openai/deployments/<deployment> + OPENAI_API_KEY=<azure-key> round-trips a summarize call.
AZURE_OPENAI_API_VERSION env var documented in README with the default GA value.
- Non-Azure base URLs (OpenAI, DeepSeek, SiliconFlow, Ollama, vLLM, LM Studio) unaffected — same code path, same
Authorization: Bearer header.
Supersedes
Out of scope
Why
#307 added the universal OpenAI-compatible provider and lists Azure OpenAI in its supported-endpoints table:
But Azure OpenAI's
/chat/completionsrequires:api-version=<YYYY-MM-DD>query parameter on every request (mandatory; the request 400s without it).api-key: <key>header instead ofAuthorization: Bearer <key>(Azure also accepts Bearer when AAD-auth is in use, but the api-key path is the default for key auth).OpenAIProvider.call()today doesn't add either, so the Azure path in the supported-endpoints table is non-functional as-shipped.Proposal
In
src/providers/openai.ts:Note: Azure URLs already include the deployment path, so we append
/chat/completions(no/v1/segment).Acceptance
OPENAI_BASE_URL=https://<resource>.openai.azure.com/openai/deployments/<deployment>+OPENAI_API_KEY=<azure-key>round-trips a summarize call.AZURE_OPENAI_API_VERSIONenv var documented in README with the default GA value.Authorization: Bearerheader.Supersedes
Out of scope