MAI-Voice-2-Flash
Microsoft AI's low-latency text-to-speech model for voice agents and assistants, with the expressive multilingual voices of MAI-Voice-2 at twice the speed. Your use is subject to Microsoft AI's Terms & Privacy Policies.
- Input price
- Input $15, Per 1M characters
import { experimental_generateSpeech as generateSpeech } from 'ai';import { gateway } from '@ai-sdk/gateway';import { writeFile } from 'node:fs/promises';
const result = await generateSpeech({ model: gateway.speechModel('microsoft/mai-voice-2-flash'), text: 'Hello from the Vercel AI Gateway!', voice: 'en-US-Harper',});
await writeFile('speech.mp3', result.audio.uint8Array);Copy link to headingPlayground
Try out MAI-Voice-2-Flash by Microsoft AI. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Text
The text the model will read aloud.Voice
Your generated audio will appear here
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
Checking availability for your team
| Provider |
|---|