The project is in a healthy, maintained state
Install `runapi-fish-audio` and create a `RunApi::FishAudio::Client`.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 0.4.0
 Project Readme

RunAPI

Fish Audio API SDKs for JavaScript, Python, Ruby, Go, Java, and PHP on RunAPI.

npm PyPI RubyGems Go Reference Maven Central License

Generate RunAPI-managed MP3 or WAV speech from text. Use s2.1-pro for recommended production TTS with 83-language support and natural-language expression control. s2-pro remains available as a previous-generation option.

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@latest

For Java, install ai.runapi:runapi-fish-audio:0.2.0. 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: 's2.1-pro',
  text: 'Hello from RunAPI [excited]',
  output_format: 'wav',
  sample_rate_hz: 44100,
  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.

output_format defaults to mp3. MP3 supports 32000 or 44100 Hz and optional bitrate_kbps values of 64, 128, or 192. WAV supports 8000, 16000, 24000, 32000, or 44100 Hz and does not accept bitrate_kbps.

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.