Skip to content

URLs ending in cognitiveservices.azure.com are silently not considered Azure URLs #469

Open
@StefanLobbenmeierObjego

Description

I can connect to my model using curl like this:

curl -X POST "https://stefa-censored-swedencentral.cognitiveservices.azure.com/openai/responses?api-version=2025-03-01-preview" \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $AZURE_API_KEY" \
 -d '{
     "model": "o4-mini",
     "input": "This is a test"
 }'

Can we also add this URL to the isAzureEndpoint Util?

@JvmSynthetic
internal fun isAzureEndpoint(baseUrl: String): Boolean {
// Azure Endpoint should be in the format of `https://<region>.openai.azure.com`.
// Or `https://<region>.azure-api.net` for Azure OpenAI Management URL.
val trimmedBaseUrl = baseUrl.trim().trimEnd('/')
return trimmedBaseUrl.endsWith(".openai.azure.com", true) ||
trimmedBaseUrl.endsWith(".azure-api.net", true)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions