Hello Vivek !
Thank you for posting on Microsoft Learn.
You called the regional TTS endpoint and passed a voice name that endpoint doesn’t know about eastus-VivTrained.
CNV models are accessed either via the custom endpoint URL created when you deploy the model, or by adding a deploymentId query parameter to the voice endpoint. You must also use the exact voice name or alias shown in your deployment (no region prefix).
https://learn.microsoft.com/en-us/azure/ai-services/speech-service/rest-text-to-speech
In Speech studio, do to Custom voice then Deployments then in your deployment, copy the Endpoint URL. It usually looks like:
https://eastus.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId=<YOUR-DEPLOYMENT-ID>
Then call it like this :
curl -X POST \
"https://eastus.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId=<YOUR-DEPLOYMENT-ID>" \
-H "Ocp-Apim-Subscription-Key: <YOUR_SPEECH_RESOURCE_KEY>" \
-H "Content-Type: application/ssml+xml" \
-H "X-Microsoft-OutputFormat: audio-16khz-32kbitrate-mono-mp3" \
-H "User-Agent: curl" \
--data-binary @- <<'SSML'
<speak version="1.0" xml:lang="en-US">
<!-- Use the EXACT voice name/alias shown in the deployment details and do NOT prefix with region -->
<voice name="VivTrained">
Hello, this is your custom neural voice speaking from Azure.
</voice>
</speak>
SSML
Or, if you prefer to assemble the URL yourself, switch to the voice host and add the deployment id:
https://eastus.voice.speech.microsoft.com/cognitiveservices/v1?deploymentId=<YOUR-DEPLOYMENT-ID>
and do not use eastus.tts.speech.microsoft.com for custom voices. https://learn.microsoft.com/en-us/azure/ai-services/speech-service/rest-text-to-speech