# MAI-Voice-2

Microsoft AI's highest-fidelity text-to-speech model, with expressive multilingual voices and consistent speakers across long-form narration. Served through Azure Speech (preview).

- **Model ID:** `microsoft/mai-voice-2`
- **Type:** speech
- **Providers:** azure
- **Context window:** Not applicable
- **Maximum output tokens:** 0
- **Pricing:** $22/1M input tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/mai-voice-2

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
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'),
  text: 'Hello from the Vercel AI Gateway!',
  voice: 'en-US-Harper',
});

await writeFile('speech.mp3', result.audio.uint8Array);
```

## Links

- [Model page](https://vercel.com/ai-gateway/models/mai-voice-2)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
