[BUG] Azure AI Foundry model probe missing api-version parameter causes spurious 404 error
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using Claude Code with Azure AI Foundry (CLAUDE_CODE_USE_FOUNDRY=1), the startup model availability probe returns a 404 error even though actual inference works correctly. A persistent banner is shown: "Your gateway couldn't serve claude-opus-4-6".
The probe sends a request to /models/chat/completions without the required api-version query parameter:
requestUrl: https://<resource>.services.ai.azure.com/models/chat/completions
Azure AI Foundry requires api-version on every request:
https://<resource>.services.ai.azure.com/models/chat/completions?api-version=2024-12-01-preview
The actual inference SDK includes this parameter, which is why chat works despite the probe failing.
What Should Happen?
The model probe should include the api-version query parameter when hitting Azure AI Foundry endpoints, matching what the inference SDK does.
Alternatively, provide a setting to suppress or skip the model availability probe (e.g., CLAUDE_CODE_SKIP_MODEL_PROBE=1).
Error Messages/Logs
message: Azure AI Foundry rejected model "claude-opus-4-6" (HTTP 404)
httpStatus: 404
requestUrl: https://<resource>.services.ai.azure.com/models/chat/completions
probedModel: claude-opus-4-6
responseBody: {"error":{"code":"api_not_supported","message":"Requested API is currently not supported","details":"Requested API is currently not supported"}}
endpoint: https://<resource>.services.ai.azure.com/
Steps to Reproduce
Configure Claude Code with Azure AI Foundry:
CLAUDE_CODE_USE_FOUNDRY=1
ANTHROPIC_FOUNDRY_RESOURCE=<resource-name>
ANTHROPIC_FOUNDRY_API_KEY=<key>
Set model to claude-opus-4-6
Start Claude Code
Observe the gateway error banner, even though chat/inference works normally
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.156
Platform
Other
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
The error is purely cosmetic, inference works correctly. There is no setting, flag, or environment variable to suppress the probe error.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗