404 Resource not found when calling GPT-5-Chat via Azure AI Foundry inference endpoint
What I’ve tried:
Verified the endpoint is correct and ends with /v1
.
Confirmed the key is from the Foundry inference deployment (not Azure OpenAI).
Tried both the OpenAI Python SDK and cURL.
Ensured the model name in the request is exactly gpt-5-chat
.
Tested immediately after deployment and waited >10 minutes in case of propagation delay.
Attempted both Authorization: Bearer <key>
and api-key: <key>
headers.
Sample request (PowerShell):
powershell
Copy
$endpoint = "https://sagul-me43r8sb-swedencentral.services.ai.azure.com/v1/chat/completions"
$key = "<FOUNDRY_INFERENCE_KEY>"
$body = @{
model = "gpt-5-chat"
messages = @(
@{ role = "system"; content = "You are helpful." },
@{ role = "user"; content = "Say hello" }
)
max_tokens = 50
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method Post -Uri $endpoint `
-Headers @{ "api-key" = $key; "Content-Type" = "application/json" } `
-Body $body
Error returned:
json
Copy
{"error":{"code":"404","message":"Resource not found"}}
I need guidance on:
Whether api-key
authentication is supported for Foundry inference endpoints.
If there’s a configuration step required in Azure AI Foundry for the endpoint to be usable with the SDK.
- Any known issues with
gpt-5-chat
in the Sweden Central region.What I’ve tried:- Verified the endpoint is correct and ends with
/v1
. - Confirmed the key is from the Foundry inference deployment (not Azure OpenAI).
- Tried both the OpenAI Python SDK and cURL.
- Ensured the model name in the request is exactly
gpt-5-chat
. - Tested immediately after deployment and waited >10 minutes in case of propagation delay.
- Attempted both
Authorization: Bearer <key>
andapi-key: <key>
headers.
powershell Copy $endpoint = "https://sagul-me43r8sb-swedencentral.services.ai.azure.com/v1/chat/completions"
- Verified the endpoint is correct and ends with
$key = "<FOUNDRY_INFERENCE_KEY>"
$body = @{ model = "gpt-5-chat" messages = @( @{ role = "system"; content = "You are helpful." }, @{ role = "user"; content = "Say hello" } ) max_tokens = 50 } | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method Post -Uri $endpoint -Headers @{ "api-key" = $key; "Content-Type" = "application/json" }
-Body $body
**Error returned:**
```yaml
json
Copy
{"error":{"code":"404","message":"Resource not found"}}
I need guidance on:
- Whether
api-key
authentication is supported for Foundry inference endpoints. - If there’s a configuration step required in Azure AI Foundry for the endpoint to be usable with the SDK.
- Any known issues with
gpt-5-chat
in the Sweden Central region.