Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 7fd6059

Browse files
committed
fix: upgrade @ai-sdk/azure to v3 and use deployment-based URLs
- Upgrade @ai-sdk/azure from ^2.0.6 to ^3.0.26 - v3 defaults provider(id) to Responses API (works for all models) - v2 defaulted to Chat Completions, breaking codex models - Add useDeploymentBasedUrls: true to createAzure() - Produces /deployments/{id}/{path} URLs (universally compatible) - Without it, SDK uses /v1/{path} which only works on AI Foundry resources
1 parent 61a6709 commit 7fd6059

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

pnpm-lock.yaml

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/providers/azure.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ export class AzureHandler extends BaseProvider implements SingleCompletionHandle
3535
this.options = options
3636

3737
// Create the Azure provider using AI SDK
38-
// The @ai-sdk/azure package uses resourceName-based routing
38+
// The @ai-sdk/azure package uses resourceName-based routing.
39+
// useDeploymentBasedUrls produces the universally compatible
40+
// /deployments/{id}/{path} URL shape that works on both classic
41+
// Azure OpenAI resources and newer AI Foundry resources.
3942
this.provider = createAzure({
4043
resourceName: options.azureResourceName ?? "",
4144
apiKey: options.azureApiKey, // Optional — Azure supports managed identity / Entra ID auth
4245
apiVersion: options.azureApiVersion ?? azureOpenAiDefaultApiVersion,
46+
useDeploymentBasedUrls: true,
4347
headers: DEFAULT_HEADERS,
4448
})
4549
}

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
"clean": "rimraf README.md CHANGELOG.md LICENSE dist logs mock .turbo"
451451
},
452452
"dependencies": {
453-
"@ai-sdk/azure": "^2.0.6",
453+
"@ai-sdk/azure": "^3.0.26",
454454
"@ai-sdk/cerebras": "^1.0.0",
455455
"@ai-sdk/deepseek": "^2.0.14",
456456
"@ai-sdk/fireworks": "^2.0.26",

0 commit comments

Comments
 (0)