S2.1 Pro
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('fish-audio/s2.1-pro'), text: 'Hello from the Vercel AI Gateway!', // Browse voices at https://fish.audio/app/discovery // Open a voice, then use "Copy Model Id" in its "..." menu. voice: '933563129e564b19a115bedd57b7406a',});
await writeFile('speech.mp3', result.audio.uint8Array);Copy link to headingFrequently Asked Questions
What is S2.1 Pro built for?
Production text-to-speech. Fish Audio recommends it as its production model, with better quality, latency, and throughput than S2 Pro.
How many languages does S2.1 Pro support?
83.
How do I control emotion and delivery?
Write direction inline in square brackets, such as
[whispers sweetly]. The model interprets the description rather than matching a fixed tag list, so phrasing outside the documented set still works.Can S2.1 Pro render a conversation?
Yes. Write both sides in one text input, tag each turn with a speaker index, and the model returns a single audio file with both voices. Two speakers per request.
How does S2.1 Pro compare to S2 Pro?
It is the improved version, preferred in roughly three of every five head-to-head listening judgements, with better latency and throughput and three more supported languages.
Is there a free way to try S2.1 Pro?
Yes. Fish Audio publishes a free development tier with the same model quality and language coverage, without latency or availability guarantees. Use it for evaluation and prototyping.
Does S2.1 Pro support Zero Data Retention?
Zero Data Retention is not currently available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.