MAI-Voice-2.1
Microsoft AI's highest-fidelity, most expressive speech model — 23 languages, 97 voices.
/v1/media/queueOverview
MAI-Voice-2.1 is Microsoft AI's highest-fidelity, most expressive text-to-speech model. It produces natural, studio-grade speech across 23 languages, with detailed prosody, nuanced expressiveness, and speaker consistency over long-form content. Pick a voice by its locale-prefixed ID.
| Property | Value |
|---|---|
| Model ID | microsoft/mai-voice-2.1 |
| Alias | mai-voice-2-1 |
| Upstream Model | microsoft/mai-voice-2.1 |
| Category | Text to Speech |
| Languages | 23 languages across 28 locales |
| Output | mp3 (default) or pcm |
| Pricing | $0.0464 per 1,000 characters |
Usage
All media models use the async job queue. Submit a job, then poll for the result.
Step 1: Submit Job
const res = await fetch('https://api.yepapi.com/v1/media/queue', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'microsoft/mai-voice-2.1',
prompt: 'Your text to speak goes here.',
options: { voice: 'en-US-Harper:MAI-Voice-2.1' },
}),
});
const { data } = await res.json();
// data.jobId — use this to poll for resultscurl -X POST https://api.yepapi.com/v1/media/queue \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "microsoft/mai-voice-2.1", "prompt": "Your text to speak goes here."}'Step 2: Poll for Result
const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, {
headers: { 'x-api-key': 'YOUR_API_KEY' },
});
const { data: job } = await status.json();
// job.status — "pending" | "processing" | "completed" | "failed"
// job.result.audio — { mimeType, base64 } when completedcurl https://api.yepapi.com/v1/media/status/JOB_ID \
-H "x-api-key: YOUR_API_KEY"Write the audio to a file:
import { writeFileSync } from 'node:fs';
writeFileSync('speech.mp3', Buffer.from(job.result.audio.base64, 'base64'));Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
model | string | Yes | microsoft/mai-voice-2.1 | — |
prompt | string | Yes | The text to speak (max 50,000 bytes) | — |
options.voice | string | No | Voice identifier | en-US-Harper:MAI-Voice-2.1 |
options.outputFormat | string | No | mp3 (default) or pcm | mp3 |
options.speed | number | No | Playback speed multiplier. Honoured only by models that support it | 1.0 |
Voices
en-US-Harper:MAI-Voice-2.1 is used when options.voice is omitted. 97 voices available (10 of 97 shown):
en-US-Harper:MAI-Voice-2.1en-GB-Emily:MAI-Voice-2.1es-MX-Valeria:MAI-Voice-2.1fr-FR-Soleil:MAI-Voice-2.1de-DE-Klaus:MAI-Voice-2.1it-IT-Rosa:MAI-Voice-2.1pt-BR-Luana:MAI-Voice-2.1hi-IN-Priya:MAI-Voice-2.1ko-KR-Haena:MAI-Voice-2.1zh-CN-Mei:MAI-Voice-2.1
Features
- Microsoft AI's highest-fidelity, most expressive TTS model
- 23 languages, 97 voices across 28 locales
- Detailed prosody and nuanced expressiveness
- Speaker consistency over long-form content
Billing
Speech is billed on the length of the input text, in UTF-8 bytes — for English text one byte is one character. The cost is known before synthesis starts, so the balance check at submit time quotes the exact final charge. Jobs have a $0.01 minimum.
Powered by OpenRouter's unified speech API.