From 247ab19b892b15235a7f76d8c2cc8f1ccd1fbfa0 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 25 Nov 2026 00:50:28 -0800 Subject: [PATCH] docs: the Python SDK defaults to s2.1-pro since 1.4.0 fish-audio-sdk 1.4.0 changed the default TTS model from s2-pro to s2.1-pro and widened the Model type (s2.1-pro, s2.1-pro-free, drama-3, any str). Correct the Text to Speech page and the SDK skill, which still said s2-pro and asked for # type: ignore. Co-Authored-By: Claude Opus 5.5 --- .mintlify/skills/fish-audio-sdk/SKILL.md | 4 ++-- .../skills/fish-audio-sdk/references/text-to-speech.md | 6 +++--- .mintlify/skills/fish-audio-sdk/references/websocket.md | 4 ++-- features/text-to-speech.mdx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.mintlify/skills/fish-audio-sdk/SKILL.md b/.mintlify/skills/fish-audio-sdk/SKILL.md index b8cc56b5..57e828b6 100644 --- a/.mintlify/skills/fish-audio-sdk/SKILL.md +++ b/.mintlify/skills/fish-audio-sdk/SKILL.md @@ -18,7 +18,7 @@ If the user wants raw `curl` / HTTP / WebSocket without installing an SDK, use t - **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). -- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro` (recommended for production), and `s2.1-pro-free` (free tier). Do not choose `s1` for new code: S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). However, the Python SDK types `model` as only `s1` and `s2-pro` (plus the deprecated `speech-1.x`), default `s2-pro`. The JS package on npm (`fish-audio` 0.1.0) types `backend` without `s2-pro` or `s2.1-pro` and defaults it to `"s1"` at runtime (its README says `"s2-pro"`), so in JS always pass `backend` explicitly. 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. +- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro` (recommended for production), and `s2.1-pro-free` (free tier). Do not choose `s1` for new code: S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK (`fish-audio-sdk` 1.4.0 and later) defaults to `s2.1-pro`; its `Model` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free` and `drama-3` and accepts any other string, so no `# type: ignore` is needed (1.3.0 and earlier defaulted to `s2-pro` and typed only `s1` / `s2-pro`). The JS package on npm (`fish-audio` 0.1.0) types `backend` without `s2-pro` or `s2.1-pro` and defaults it to `"s1"` at runtime (its README says `"s2-pro"`), so in JS always pass `backend` explicitly. The JS SDK forwards the model value without runtime validation, so `"s2.1-pro"` works over the wire, but TypeScript flags it, so add an `as` cast, or use the `fish-audio-api` skill for raw calls. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s2.1-pro"` (keyword); in JS pass the **positional** `backend` argument. - **ASR models:** use `transcribe-1-pro` (recommended: speaker turns, long recordings, emotion cues). Neither SDK has an ASR `model` argument: send the `model: transcribe-1-pro` HTTP header on every request (Python `RequestOptions(additional_headers=...)`, JS `requestOptions.headers`). A request without it is served and billed as `transcribe-1`, the model for short recordings. See [references/speech-to-text.md](references/speech-to-text.md). - **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](references/installation.md). @@ -107,7 +107,7 @@ The two SDKs do **not** use the same names. Use this map when porting code betwe | Update / delete voice | `client.voices.update(id, ...)` / `delete(id)` | `client.voices.update(id, ...)` / `delete(id)` | | Credit balance | `client.account.get_credits()` | `client.user.get_api_credit()` | | Subscription package | `client.account.get_package()` | `client.user.get_package()` | -| Choose model | `model="s2-pro"` keyword arg | positional `backend` arg, e.g. `convert(req, "s2-pro")` | +| Choose model | `model="s2.1-pro"` keyword arg | positional `backend` arg, e.g. `convert(req, "s2-pro")` | | ASR model (header) | `RequestOptions(additional_headers=...)` | `convert(req, { headers: { model: "transcribe-1-pro" } })` | ## Decision shortcuts diff --git a/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md b/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md index 88fea888..99992884 100644 --- a/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md +++ b/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md @@ -21,7 +21,7 @@ audio = client.tts.convert( ) # Pick a model and adjust speed -audio = client.tts.convert(text="Speaking faster.", model="s2-pro", speed=1.5) +audio = client.tts.convert(text="Speaking faster.", model="s2.1-pro", speed=1.5) ``` ### `tts.convert` parameters @@ -37,7 +37,7 @@ All keyword-only: | `latency` | `"normal" \| "balanced"` | `"balanced"` | `normal` = higher quality, `balanced` = faster. (No `"low"`.) | | `speed` | `float` | — | Shortcut for prosody speed (0.5–2.0). | | `config` | `TTSConfig` | `TTSConfig()` | Reusable bundle of the settings below. | -| `model` | `"s2-pro" \| "s1"` | `"s2-pro"` | Synthesis model per current SDK typing. The API also accepts `"s2.1-pro"` / `"s2.1-pro-free"`, forwarded fine at runtime, but add `# type: ignore` for static checkers. `s1` is deprecated and will be retired on December 31, 2026; after that date, requests that specify `s1` are served by `s2.1-pro`. `speech-1.5` / `speech-1.6` are deprecated. | +| `model` | `"s2.1-pro" \| "s2.1-pro-free" \| "s2-pro" \| "drama-3" \| "s1"` or any `str` | `"s2.1-pro"` | Synthesis model (`fish-audio-sdk` 1.4.0 and later; 1.3.0 and earlier defaulted to `"s2-pro"`). `s1` is deprecated and will be retired on December 31, 2026; after that date, requests that specify `s1` are served by `s2.1-pro`. `speech-1.5` / `speech-1.6` are deprecated. | | `request_options` | `RequestOptions \| None` | `None` | Per-request timeout / headers; see [errors.md](errors.md). | Direct params (`reference_id`, `format`, `latency`, `speed`) override the matching field on `config` when set. @@ -118,5 +118,5 @@ await new Promise((resolve, reject) => ## Model & expression notes -- `s2.1-pro` is recommended for production; `s2-pro` is the Python SDK default. `s1` is the previous generation: S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. Migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`. +- `s2.1-pro` is recommended for production and is the Python SDK default (`fish-audio-sdk` 1.4.0 and later). `s1` is the previous generation: S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. Migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`. - Emotion/expression is controlled inline in `text` (S2-Pro uses free-form `[bracket]` tags; the deprecated S1 uses legacy `(parenthesis)` tags, and the API does not convert between them); there is no separate SDK parameter. Full tag list: `https://docs.fish.audio/api-reference/emotion-reference`. diff --git a/.mintlify/skills/fish-audio-sdk/references/websocket.md b/.mintlify/skills/fish-audio-sdk/references/websocket.md index e7e4ff57..4950afc6 100644 --- a/.mintlify/skills/fish-audio-sdk/references/websocket.md +++ b/.mintlify/skills/fish-audio-sdk/references/websocket.md @@ -20,7 +20,7 @@ def text_chunks(): yield "streaming speech." # Consume audio chunks as they arrive... -for chunk in client.tts.stream_websocket(text_chunks(), reference_id="", model="s2-pro"): +for chunk in client.tts.stream_websocket(text_chunks(), reference_id="", model="s2.1-pro"): sink.write(chunk) # ...or just play the whole stream locally: @@ -47,7 +47,7 @@ async def main(): asyncio.run(main()) ``` -`stream_websocket` keyword params mirror `convert`: `reference_id`, `references`, `format`, `latency`, `speed`, `config`, `model` (default `"s2-pro"`), plus `ws_options` (a `WebSocketOptions` for keepalive/message-size tuning). The sync version also accepts `max_workers` (default `10`) for its background sender thread; the async version does not. +`stream_websocket` keyword params mirror `convert`: `reference_id`, `references`, `format`, `latency`, `speed`, `config`, `model` (default `"s2.1-pro"`), plus `ws_options` (a `WebSocketOptions` for keepalive/message-size tuning). The sync version also accepts `max_workers` (default `10`) for its background sender thread; the async version does not. For manual control, yield events instead of strings: diff --git a/features/text-to-speech.mdx b/features/text-to-speech.mdx index ccf99b5a..c53d1646 100644 --- a/features/text-to-speech.mdx +++ b/features/text-to-speech.mdx @@ -116,7 +116,7 @@ curl --request POST https://api.fish.audio/v1/tts \ - **`s2-pro`**: previous-generation S2 model with multi-speaker and natural-language expression control. - **`s1`**: previous generation, `(parenthesis)` emotion tags. S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). -In the API, select with the `model` request header; requests without it use `s2.1-pro`. The Python SDK always sends a model and defaults to `model="s2-pro"`. See [Choosing a Model](/developer-guide/models-pricing/choosing-a-model). +In the API, select with the `model` request header; requests without it use `s2.1-pro`. The Python SDK always sends a model and defaults to `model="s2.1-pro"` (`fish-audio-sdk` 1.4.0 and later; earlier versions default to `s2-pro`). See [Choosing a Model](/developer-guide/models-pricing/choosing-a-model). ### Output formats