import requests r = requests.post( "https://api.aimlapi.com/v1/tts", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "microsoft/mai-voice-2", "text": "Hello from AI/ML API" }, ) print(r.json()["audio"]) # URL to the generated audio
const r = await fetch("https://api.aimlapi.com/v1/tts", { method: "POST", headers: { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "microsoft/mai-voice-2", "text": "Hello from AI/ML API" }), }); const { audio } = await r.json(); console.log(audio); // URL to the generated audio
curl -X POST https://api.aimlapi.com/v1/tts \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"microsoft/mai-voice-2","text":"Hello from AI/ML API"}' # the JSON response contains "audio" — a URL to the generated speech
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Input | |
| Output | |
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
MAI-Voice-2 This page | Speech synthesis | |||
| Speech synthesis | ||||
| Speech synthesis | ||||
| Speech synthesis | ||||
| Speech synthesis |
MAI-Voice-2 takes text as input and returns audio.
MAI-Voice-2 became available on June 3, 2026.
MAI-Voice-2 is priced at $28.6 / 1M.
MAI-Voice-2 is billed per generation — a fixed charge per output rather than by prompt length.
MAI-Voice-2 was built by Microsoft.
Send a request to https://api.aimlapi.com/v1/tts with microsoft/mai-voice-2 as the model id.
Yes. MAI-Voice-2 is served through AI/ML API, so the same key and endpoint format used for other models applies.
MAI-Voice-2 is a text-to-speech model developed by Microsoft that converts text input into audio output.