You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Unable to connect Azure AI Foundry Serverless Models (DeepSeek) due to strict Provider/Model validation #12102
CLI cannot connect to Azure AI Foundry Serverless endpoints or OpenAI-compatible APIs
Describe the bug
The CLI (v1.1.51) currently cannot connect to Azure AI Foundry Serverless endpoints or other OpenAI-compatible APIs (like vLLM) because of two restrictive design choices:
Azure Provider: Forces a resourceName and builds a legacy URL path (/openai/deployments/...), which results in Resource not found for Serverless endpoints.
OpenAI Provider: Validates the model name against a hardcoded internal list, rejecting any non-standard model names (like DeepSeek-V3.2) even when a custom baseURL is defined.
Steps to Reproduce
Setup: Azure AI Foundry Serverless Deployment (DeepSeek-V3.2) Endpoint:https://<id>.services.ai.azure.com/openai/v1
Error:AI_LoadSettingError: Azure OpenAI resource name setting is missing.
Conflict: Serverless endpoints do not follow the {resourceName}.openai.azure.com pattern. Adding a dummy resourceName causes the CLI to construct an invalid URL.
Error:ProviderModelNotFoundError (model name is not in the hardcoded list for OpenAI).
Expected Behavior
BaseURL Priority: If a baseURL is provided, the CLI should respect it as a full path and stop appending provider-specific path segments (like /deployments/).
Flexible Validation: Disable model name validation when a custom baseURL is present to support the growing ecosystem of OpenAI-compatible providers (Foundry, vLLM, Ollama).
Optional resourceName: Make resourceName optional for the Azure provider when using Foundry Serverless URLs.
Environment
OS: Windows 11
OpenCode Version: 1.1.51
Model: DeepSeek-V3.2 via Azure AI Foundry Serverless
Additional Context
Azure AI Foundry Serverless endpoints use a different URL structure than traditional Azure OpenAI deployments. The current implementation assumes all Azure endpoints follow the legacy pattern, which breaks compatibility with newer Azure AI services.
Reacted by Emiliano Bazaes, Lefteris Loukas, Antoine Tremblay, Taylor and Fahim Ali Zain
Activity
github-actions commentedon Feb 4, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
hexa00 commentedon Feb 20, 2026
I tried this recently with:
opencode --version
1.2.10
And this worked
github-actions commentedon Apr 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.