Fish Audio's S3 Pro text-to-speech model and Transcribe 2 Pro speech-to-text model are now available on AI Gateway.
Both models are free through December 31.
S3 Pro is Fish Audio's text-to-speech model for voice agents, with lower latency and more natural, accurate speech than its S2 models. It works with the same Fish Audio voices as earlier models. Text is measured in UTF-8 bytes, so characters outside ASCII, such as Japanese or accented letters, count as more than one character.
- fish-audio/s3-pro-free is the same S3 Pro model on Fish Audio's free endpoint. It is slower and has no latency or uptime guarantees, so use it for batch work rather than realtime voice.
- Transcribe 2 Pro transcribes recordings with better accuracy and speaker diarization. The transcript marks each speaker with a token such as <|speaker:0|>, and the timestamped segments go down to individual words.
Copy link to headingText-to-speech
Generate spoken audio from text with generateSpeech and write the result:
import { generateSpeech } from 'ai';import { writeFile } from 'node:fs/promises';
const result = await generateSpeech({ model: 'fish-audio/s3-pro', text: 'How are you doing today?',});await writeFile('speech.mp3', result.audio.uint8Array);
Copy link to headingSpeech-to-text
Transcribe recordings into text with transcribe. The audio can be a buffer, a base64 string, or a URL:
import { transcribe } from 'ai';import { readFile } from 'node:fs/promises';
const result = await transcribe({ model: 'fish-audio/transcribe-2-pro', audio: await readFile('speech.mp3'),});console.log(result.text);console.log(result.segments);
Copy link to headingPlayground
You can also try S3 Pro and Transcribe 2 Pro without writing any code. Open the models page, click into a model, and send text or audio to hear or read the result in your browser.
For a full overview of audio models, see the speech quickstart. For more detail on the provider, see the Fish Audio AI SDK docs. You can view all Fish Audio models available on AI Gateway.