Skip to content

AI Foundry sample visible in ai.azure.com for TTS models has a wrong HTTP header #248

@maciej-skorupka

Description

@maciej-skorupka

Hi,

I'm not sure if that's the correct repo, but let's try.

Example visible in AI Foundry when a gpt-4o-mini-tts model is deployed, shows a curl request. Unfortunately, it the example shows "Authorization: Bearer xxxxx" header, but that doesn't work. After changing it to "api-key" heaeder the sample works.

Not working example:

curl -X POST "https://myname.cognitiveservices.azure.com/openai/deployments/gpt-4o-mini-tts/audio/speech?api-version=2025-03-01-preview" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $AZURE_API_KEY" \ -d '{ "model": "gpt-4o-mini-tts", "input": "The quick brown fox jumped over the lazy dog", "voice": "alloy" }'

Working example:

curl -X POST "https://myname.cognitiveservices.azure.com/openai/deployments/gpt-4o-mini-tts/audio/speech?api-version=2025-03-01-preview" \ -H "Content-Type: application/json" \ -H "api-key: $AZURE_API_KEY" \ -d '{ "model": "gpt-4o-mini-tts", "input": "The quick brown fox jumped over the lazy dog", "voice": "alloy" }'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions