Fish Audio API SDKs for JavaScript, Python, Ruby, Go, Java, and PHP on RunAPI.
Generate MP3 speech from text with s1 or s2-pro. RunAPI validates and stores each audio result before returning it.
Install
npm install @runapi.ai/fish-audio
pip install runapi-fish-audio
gem install runapi-fish-audio
go get github.com/runapi-ai/fish-audio-sdk/go@latestFor Java, install ai.runapi:runapi-fish-audio:0.1.2. The PHP package is released from the split repository at https://github.com/runapi-ai/fish-audio-php.
Quick start
import { FishAudioClient } from '@runapi.ai/fish-audio';
const client = new FishAudioClient();
const result = await client.textToSpeech.run({
model: 's1',
text: 'Hello from RunAPI',
references: [{
audio: '<base64 raw audio bytes>',
text: 'Exact reference transcript',
}],
});
console.log(result.audios[0].url);references applies only to the current request. Each item requires base64-encoded raw audio bytes and its exact transcript; reusable voice IDs are not supported.
Variants
The returned URL points to RunAPI-managed storage. See the Fish Audio model page for current pricing, limits, and usage details.
License
Licensed under the Apache License, Version 2.0.