YepAPI
AI Models

MAI-Voice-2.1 Flash

The low-latency tier of MAI-Voice-2.1, optimised for real-time responsiveness — 23 languages, 97 voices.

POST/v1/media/queue
$0.0316/1K chars

Overview

MAI-Voice-2.1-Flash is a low-latency text-to-speech model from Microsoft AI, optimised for real-time responsiveness. It produces natural, expressive speech across 23 languages, with human-like intonation, rhythm, and emotional nuance, from the same 97-voice catalogue as MAI-Voice-2.1.

PropertyValue
Model IDmicrosoft/mai-voice-2.1-flash
Aliasmai-voice-2-1-flash
Upstream Modelmicrosoft/mai-voice-2.1-flash
CategoryText to Speech
Languages23 languages across 28 locales
Outputmp3 (default) or pcm
Pricing$0.0316 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-flash',
    prompt: 'Your text to speak goes here.',
    options: { voice: 'en-US-Harper:MAI-Voice-2.1-Flash' },
  }),
});
const { data } = await res.json();
// data.jobId — use this to poll for results
curl -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-flash", "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 completed
curl 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

ParameterTypeRequiredDescriptionDefault
modelstringYesmicrosoft/mai-voice-2.1-flash—
promptstringYesThe text to speak (max 50,000 bytes)—
options.voicestringNoVoice identifieren-US-Harper:MAI-Voice-2.1-Flash
options.outputFormatstringNomp3 (default) or pcmmp3
options.speednumberNoPlayback speed multiplier. Honoured only by models that support it1.0

Voices

en-US-Harper:MAI-Voice-2.1-Flash is used when options.voice is omitted. 97 voices available (10 of 97 shown):

  • en-US-Harper:MAI-Voice-2.1-Flash
  • en-GB-Emily:MAI-Voice-2.1-Flash
  • es-MX-Valeria:MAI-Voice-2.1-Flash
  • fr-FR-Soleil:MAI-Voice-2.1-Flash
  • de-DE-Klaus:MAI-Voice-2.1-Flash
  • it-IT-Rosa:MAI-Voice-2.1-Flash
  • pt-BR-Luana:MAI-Voice-2.1-Flash
  • hi-IN-Priya:MAI-Voice-2.1-Flash
  • ko-KR-Haena:MAI-Voice-2.1-Flash
  • zh-CN-Mei:MAI-Voice-2.1-Flash

Features

  • Low latency, optimised for real-time responsiveness
  • 23 languages, 97 voices across 28 locales
  • Human-like intonation, rhythm, and emotional nuance
  • Roughly a third less per character than MAI-Voice-2.1

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.

Under the Hood

Powered by OpenRouter's unified speech API.

On this page