skills/docs.fish.audio/fish-audio-sdk

fish-audio-sdk

Installation
SKILL.md

Fish Audio SDK Skill

Use this skill to generate correct, runnable code with the official Fish Audio SDKs:

  • Python: package fish-audio-sdk on PyPI, imported as fishaudio. (The same wheel still ships a separate legacy fish_audio_sdk package. Do not mix them; everything here is the modern fishaudio package.)
  • JavaScript / TypeScript: package fish-audio on npm, imported as FishAudioClient.

If the user wants raw curl / HTTP / WebSocket without installing an SDK, use the fish-audio-api skill instead.

This file is the index. Deeper, task-specific rules and full examples live in references/. Read the reference for the task you're doing before writing code.

Global facts

  • Auth: both SDKs read the API key from the FISH_API_KEY environment variable automatically. Get keys at https://fish.audio/app/api-keys. Never hardcode a key.
  • Base URL: https://api.fish.audio (override with base_url= in Python / baseUrl: in JS).
  • Models: the API supports s1, s2-pro, s2.1-pro (recommended for production), and s2.1-pro-free (free tier), but the SDK type definitions currently list only s1 and s2-pro (s2-pro = SDK default). Both SDKs forward the model value without runtime validation, so "s2.1-pro" works over the wire. Static type checkers will flag it, so add # type: ignore (Python) / an as cast (TS), or use the fish-audio-api skill for raw calls. speech-1.5 / speech-1.6 are deprecated. In Python pass model="s2-pro" (keyword); in JS pass the positional backend argument.
  • Audio formats: mp3 (default), wav, pcm, opus.
  • Playback in examples: play() shells out to a system audio tool: Python uses ffmpeg/ffplay (or mpv), JS uses ffplay. It is for local/desktop use; in a server, save() to a file or stream the bytes instead. See references/installation.md.
Installs
842
First Seen
Jun 9, 2026
fish-audio-sdk from docs.fish.audio