Repository navigation
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.
{
"model": "gpt-5.4",
"messages": [
...
],
...
}
{
"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
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)
Activity
[-]@ai-sdk/azure provider does not work since v1.3.4[/-][+]@ai-sdk/azure provider does not work with /chat/completions since v1.3.4[/+]rekram1-node commentedon Mar 31, 2026
are u getting a 404 not found? I managed to hit azure completions just fine
chunglam2525 commentedon Mar 31, 2026
I did get
Resource Not Founderror in response.I try running debug log and saw it was hitting
/responseendpoint, which indicates it was usingresponsemethod from@ai-sdk/azureprovider.I also try forcing the api path with similar to this method, but later found out that the request body json is in different formats with the different error message I received.
One thing that I am uncertain is that in previous opencode versions, I did not even input
useCompletionUrlsoption at all and the api still works fine, hitting thecompletionendpoint correctly. But based on the code logic, it should default to usingresponseinstead.rekram1-node commentedon Mar 31, 2026
Oh I think I found it
rekram1-node commentedon Mar 31, 2026
Wait why is ur provider called "foundary"
If it was called "azure" I think it'd work but it's not?
rekram1-node commentedon Mar 31, 2026
"useCompletionUrls" is something we have it's only tied to that oen provider name
fix: respect useCompletionUrls for custom @ai-sdk/azure providers
chunglam2525 commentedon Apr 1, 2026
It does work after I change the namespace from
foundarytoazure(tested on opencode v1.3.13)I thought this is just a display name tag in TUI model select, separating custom provider with default provider, didn't know it have actual mapping functionality
Does this mean
provider[key]andprovider[key].npmalways need to pair up correctly?rekram1-node commentedon Apr 1, 2026
No, it's just that deployment / completion urls thing is kinda an old artifact, im not even sure if it is documented there has got to be a cleaner solution.
But it has been hard coded specifically for that provider this whole time
rekram1-node commentedon Apr 1, 2026
We have azure support but it's not like great in terms of UX and accounting for all the different setups so if u have any ideas we are all ears
peri4n commentedon Apr 23, 2026
@chunglam2525 @rekram1-node I am sorry but is this broken again? I can't get it to work in 1.4.11 with
azureas provider name anduseCompletionUrlsset to true.chunglam2525 commentedon May 6, 2026
@peri4n are you experiencing this error?
In opencode v1.3.16, this pr fixes provider options for azure sdk. But it breaks the
/v1/chat/completionsmethod.Removing
reasoning_effortfrom fetch body does solve this problem, but I am not sure this will be a good solution, since this is too much of custom logic for this specific provider. @rekram1-nodepackages/opencode/src/provider/provider.ts
For now, I would recommend sticking to a fix version of opencode if you are using azure with
/chat/completionendpoint, since it is already mention in above reply that this azure deployment/completion endpoint being an old artifact with discontinue updatesperi4n commentedon May 7, 2026
Hi @chunglam2525,
thank you for the response.
I get a 404 Ressource not Found because I can't opencode to actually use a chat/completions endpoint even with
useCompletionUrlsset to true.chunglam2525 commentedon May 11, 2026
Can you share your provider config? it seems like it is reaching an incorrect endpoint.
Or what you could do is using DEBUG log
opencode --log-level DEBUGto investigate the API call from opencode.rekram1-node commentedon May 11, 2026
maybe share
opencode debug configperi4n commentedon May 11, 2026
I hope this helps: