-
Notifications
You must be signed in to change notification settings - Fork 14.7k
@ai-sdk/azure provider does not work with /chat/completions since v1.3.4 #20287
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Description
@ai-sdk/azure provider does not work since v1.3.4
here is my opencode.json config
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"foundary": {
"npm": "@ai-sdk/azure",
"options": {
"baseURL": "https://custom-domain/openai",
"apiKey": "xxxxxxxx",
"apiVersion": "2025-04-01-preview",
"useDeploymentBasedUrls": true,
"useCompletionUrls": true
},
"models": {
"gpt-5.4": {
"name": "GPT-5.4"
}
}
}
},
"autoupdate": false
}
I have looked up a lot of similar issue regarding azure openai api, seems like everyone is confuse about azure multiple supporting API format.
Expect:
POST: https://custom-domain/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}
{
"model": "gpt-5.4",
"messages": [
...
],
...
}
Actual:
POST: https://custom-domain/openai/deployments/{deployment-id}/responses?api-version={api-version}
{
"model": "gpt-5.4",
"input": [
...
],
...
}
This line of code sdk.chat(modelID) should direct me to the chat completion method with useCompletionUrls options based on the logic
changing @ai-sdk/azure version to 3.0.49 in opencode v1.3.4 might cause this issue to appear
Plugins
No response
OpenCode version
v1.3.4
Steps to reproduce
- prepare a azure api that have (only) this API format available - https://custom-domain/openai/deployments/{deployment-id}/chat/completions?api-version={api-version}
- use opencode version v1.3.3 with this config - it works
- use opencode version v1.3.4 with same config - it does not works
Screenshot and/or share link
No response
Operating System
macOS
Terminal
WezTerm
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)