Bug: azure/gpt-5 AI_APICallError: The requested model '-' with deployment name - does not exist. #1371

Closed
opened 2026-02-16 17:30:39 -05:00 by yindo · 8 comments
Owner

Originally created by @lentil32 on GitHub (Aug 18, 2025).

Originally assigned to: @thdxr on GitHub.

It worked yesterday, and i didn't changed any settings in opencode.json.
Today my OpenCode automatically updated and this error happens.

Image

opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": ["CLAUDE.md"],
  "mode": {
    "build": {
      "mode": "primary",
      "model": "azure/gpt-5",
      "reasoningEffort": "high",
      "textVerbosity": "low"
    },
    "plan": {
      "model": "azure/gpt-5",
      "reasoningEffort": "high",
      "textVerbosity": "low"
    },
    "fast": {
      "model": "azure/gpt-5",
      "reasoningEffort": "medium",
      "textVerbosity": "low"
    }
  }
}

Originally created by @lentil32 on GitHub (Aug 18, 2025). Originally assigned to: @thdxr on GitHub. It worked yesterday, and i didn't changed any settings in opencode.json. Today my OpenCode automatically updated and this error happens. <img width="951" height="327" alt="Image" src="https://github.com/user-attachments/assets/d81bad3b-9d93-4a16-8fab-7c393de6d767" /> opencode.json: ``` { "$schema": "https://opencode.ai/config.json", "instructions": ["CLAUDE.md"], "mode": { "build": { "mode": "primary", "model": "azure/gpt-5", "reasoningEffort": "high", "textVerbosity": "low" }, "plan": { "model": "azure/gpt-5", "reasoningEffort": "high", "textVerbosity": "low" }, "fast": { "model": "azure/gpt-5", "reasoningEffort": "medium", "textVerbosity": "low" } } } ```
yindo closed this issue 2026-02-16 17:30:39 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 18, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1508: Azure OpenAI URL generation issue - similar problem with Azure configuration and URL formatting that could cause deployment errors
  • #441: Invalid Schema errors on Azure OpenAI Models - reports schema validation errors when using Azure OpenAI models
  • #290: Azure Model o4-mini error Invalid schema edit - another Azure model configuration issue with API errors

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 18, 2025): This issue might be a duplicate of existing issues. Please check: - #1508: Azure OpenAI URL generation issue - similar problem with Azure configuration and URL formatting that could cause deployment errors - #441: Invalid Schema errors on Azure OpenAI Models - reports schema validation errors when using Azure OpenAI models - #290: Azure Model o4-mini error Invalid schema edit - another Azure model configuration issue with API errors Feel free to ignore if none of these address your specific case.
Author
Owner

@gabynevada commented on GitHub (Aug 18, 2025):

I had to add it as a custom provider for it to work:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "aifoundry": {
      "name": "AI Foundry",
      "npm": "@ai-sdk/azure",
      "options": {
        "baseURL": "https://yourresourcename.openai.azure.com/openai",
        "apiKey": "{env:AZURE_FOUNDRY_API_KEY}"
      },
      "models": {
        "gpt-5": {
          "name": "GPT-5"
        },
        "gpt-5-mini": {
          "name": "GPT-5 Mini"
        }
      }
    }
  }
}
@gabynevada commented on GitHub (Aug 18, 2025): I had to add it as a custom provider for it to work: ```json { "$schema": "https://opencode.ai/config.json", "provider": { "aifoundry": { "name": "AI Foundry", "npm": "@ai-sdk/azure", "options": { "baseURL": "https://yourresourcename.openai.azure.com/openai", "apiKey": "{env:AZURE_FOUNDRY_API_KEY}" }, "models": { "gpt-5": { "name": "GPT-5" }, "gpt-5-mini": { "name": "GPT-5 Mini" } } } } } ```
Author
Owner

@rekram1-node commented on GitHub (Aug 18, 2025):

In order to configure azure properly w/ opencode auth login to prevent the need of custom things like that^^ you need to follow this guide to the T: https://opencode.ai/docs/providers/#azure-openai

if you have pre-existing resources in azure that you wanna use that aren't deployed with same name as model you need to do something custom as seen above^^

@rekram1-node commented on GitHub (Aug 18, 2025): In order to configure azure properly w/ opencode auth login to prevent the need of custom things like that^^ you need to follow this guide to the T: https://opencode.ai/docs/providers/#azure-openai if you have pre-existing resources in azure that you wanna use that aren't deployed with same name as model you need to do something custom as seen above^^
Author
Owner

@rekram1-node commented on GitHub (Aug 18, 2025):

@lentil32 did you set AZURE_RESOURCE_NAME? Can you share that? or like a censored version

@rekram1-node commented on GitHub (Aug 18, 2025): @lentil32 did you set `AZURE_RESOURCE_NAME`? Can you share that? or like a censored version
Author
Owner

@lentil32 commented on GitHub (Aug 19, 2025):

yes i set .env as:

AZURE_RESOURCE_NAME="XXXX"
INSTRUCTION="GPT5.md"

which is not changed.

All the environment except for opencode is same as before, when it worked perfectly.

@lentil32 commented on GitHub (Aug 19, 2025): yes i set `.env` as: ``` AZURE_RESOURCE_NAME="XXXX" INSTRUCTION="GPT5.md" ``` which is not changed. All the environment except for opencode is same as before, when it worked perfectly.
Author
Owner

@lentil32 commented on GitHub (Aug 19, 2025):

I had to add it as a custom provider for it to work:

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"aifoundry": {
"name": "AI Foundry",
"npm": "@ai-sdk/azure",
"options": {
"baseURL": "https://yourresourcename.openai.azure.com/openai",
"apiKey": "{env:AZURE_FOUNDRY_API_KEY}"
},
"models": {
"gpt-5": {
"name": "GPT-5"
},
"gpt-5-mini": {
"name": "GPT-5 Mini"
}
}
}
}
}

Thanks.
But everything was fine until yesterday with my current setup.

@lentil32 commented on GitHub (Aug 19, 2025): > I had to add it as a custom provider for it to work: > > { > "$schema": "https://opencode.ai/config.json", > "provider": { > "aifoundry": { > "name": "AI Foundry", > "npm": "@ai-sdk/azure", > "options": { > "baseURL": "https://yourresourcename.openai.azure.com/openai", > "apiKey": "{env:AZURE_FOUNDRY_API_KEY}" > }, > "models": { > "gpt-5": { > "name": "GPT-5" > }, > "gpt-5-mini": { > "name": "GPT-5 Mini" > } > } > } > } > } Thanks. But everything was fine until yesterday with my current setup.
Author
Owner

@lentil32 commented on GitHub (Aug 19, 2025):

hmm.. it works now. everything's same

Maybe it's Azure side issue.

@lentil32 commented on GitHub (Aug 19, 2025): hmm.. it works now. everything's same Maybe it's Azure side issue.
Author
Owner

@rekram1-node commented on GitHub (Aug 19, 2025):

strange, lmk if it crops up again and I am happy to help you debug further, had someone else run into azure issues too but it was all due to azure

@rekram1-node commented on GitHub (Aug 19, 2025): strange, lmk if it crops up again and I am happy to help you debug further, had someone else run into azure issues too but it was all due to azure
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1371