TTS-1
TTS is a model that converts text to natural sounding spoken text.
Speech
index.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('openai/tts-1'), text: 'Hello from the Vercel AI Gateway!', voice: 'alloy',});
await writeFile('speech.mp3', result.audio.uint8Array);Providers
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.
| Provider |
|---|