From c9ace2793289726985e55ba52b9ab476230a325f Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:20:51 -0800 Subject: [PATCH 01/13] docs(errors): invalid parameters and unknown reference_id return 400, not 422 or 404 Live on 2026-12-02, POST /v1/tts returns 400 for an unknown format, latency or chunk_length, a missing text field, and a reference_id that does not exist; GET /model/{id} returns 404 for an unknown id. The Python errors guide said 422, and both error pages tied NotFoundError to an unknown reference_id. --- api-reference/errors.mdx | 6 +++--- developer-guide/sdk-guide/python/errors.mdx | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/api-reference/errors.mdx b/api-reference/errors.mdx index 947b5bb2..7c1c86f0 100644 --- a/api-reference/errors.mdx +++ b/api-reference/errors.mdx @@ -22,7 +22,7 @@ Some endpoints add fields. For example, `transcribe-1-pro` and `transcribe-2-pro | `401` | Invalid or missing API key | Send `Authorization: Bearer `; check it on [API Keys](https://fish.audio/app/api-keys). | | `402` | No API credit for the model you called | On a $0 balance, use the model `s3-pro-free`. For paid models, add API credit on [API Billing](https://fish.audio/app/developers/billing/). New developer accounts may receive a one-time free API credit on [Get Started](https://fish.audio/app/developers/get-started/?utm_source=docs&utm_medium=errors&utm_content=signup-credit), which works with every model. | | `403` | Not permitted for this key/resource | Check the key's scope and the resource owner. | -| `404` | Model or voice not found | Verify the `model_id` / `reference_id`. | +| `404` | Voice model not found, for example `GET /model/{id}` with an unknown ID (text to speech with an unknown `reference_id` returns `400`) | Verify the voice model ID. | | `413` | Request body too large | Send a smaller request body. | | `429` | Too many requests, for example when your account is at its [concurrency limit](/developer-guide/models-pricing/pricing-and-rate-limits#concurrent-request-limits) | Back off and retry (see below). | | `5xx` | Server error | Retry with backoff; if it persists, contact support. | @@ -74,9 +74,9 @@ except AuthenticationError: except RateLimitError: ... # back off and retry except NotFoundError: - ... # bad reference_id / model id + ... # 404, e.g. client.voices.get() with an unknown id except APIError as e: - print(e.status, e.message) # 400, 402, 5xx, ... + print(e.status, e.message) # 400 (incl. unknown reference_id), 402, 5xx, ... ``` ```javascript JavaScript diff --git a/developer-guide/sdk-guide/python/errors.mdx b/developer-guide/sdk-guide/python/errors.mdx index 72a2fa15..c9e4c0e3 100644 --- a/developer-guide/sdk-guide/python/errors.mdx +++ b/developer-guide/sdk-guide/python/errors.mdx @@ -18,18 +18,21 @@ Every SDK error inherits from [`FishAudioError`](/api-reference/sdk/python/excep | --- | --- | --- | | `AuthenticationError` | `401` | Missing or invalid API key | | `PermissionError` | `403` | Key lacks permission for the resource | -| `NotFoundError` | `404` | Voice model id not found | +| `NotFoundError` | `404` | Voice model id not found, for example in `client.voices.get()` | | `RateLimitError` | `429` | Rate limit / quota exceeded | | `ServerError` | `5xx` | Transient server-side failure | -| `APIError` | any other non-2xx | Base for the above; `status == 422` for invalid parameters | +| `APIError` | any other non-2xx | Base for the above; `status == 400` for invalid parameters and for a `reference_id` that doesn't exist | | `WebSocketError` | realtime stream failed mid-session | Reconnect rather than retrying the same socket | | `ASRRealtimeError` | a realtime speech-to-text session ended with an error | Subclass of `WebSocketError`; carries `.error_type`, `.code`, `.request_id`, and `.close_code`, each `None` when not sent | | `DependencyError` | a required system tool is missing (e.g. ffmpeg for `play()`) | Carries `.dependency` and `.install_command` | - Invalid request parameters come back as an `APIError` with `status == 422`. - Catch `APIError`, not a separate `ValidationError` (none is raised at - runtime). + Invalid request parameters, such as an unknown `format`, come back as an + `APIError` with `status == 400`, and so does text to speech with a + `reference_id` that doesn't exist. Catch `APIError`, not + `fishaudio.exceptions.ValidationError` (none is raised at runtime). Values + the SDK checks itself, such as `TTSConfig(chunk_length=99)`, raise pydantic's + `ValidationError` before any request is sent; it is not a `FishAudioError`. ## Handling errors @@ -56,9 +59,9 @@ except AuthenticationError: except RateLimitError: print("Rate limited: back off and retry") except NotFoundError: - print("That voice model does not exist") + print("Not found") # 404, e.g. client.voices.get() with an unknown id except APIError as e: - print(f"API error {e.status}: {e.message}") # includes 422 validation + print(f"API error {e.status}: {e.message}") # 400: invalid parameters or unknown reference_id except FishAudioError as e: print(f"SDK error: {e}") # e.g. WebSocketError, DependencyError ``` From 2acb1519949d9f804d2b458b2879c72d1955ef50 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:20:55 -0800 Subject: [PATCH 02/13] docs(n8n): new nodes use s3-pro from package 0.6.0 @fishaudio/n8n-nodes-fishaudio 0.6.0 adds node version 1.3, whose model default is s3-pro; saved nodes keep the default of the version they were saved with. Speech to text still defaults to transcribe-1-pro and lists transcribe-2-pro. --- developer-guide/integrations/n8n.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developer-guide/integrations/n8n.mdx b/developer-guide/integrations/n8n.mdx index fe42e31b..e5431759 100644 --- a/developer-guide/integrations/n8n.mdx +++ b/developer-guide/integrations/n8n.mdx @@ -42,8 +42,8 @@ On n8n Cloud, an instance owner or admin opens the nodes panel, searches for **F The node supports: -- **Text-to-Speech**: Generate audio from text using any voice model. Choose the model: new nodes use `s2.1-pro`, and `drama-3` is also in the list. Under **Additional Options**, **Language** sets the language used to read out numbers, dates, units and symbols while **Normalize Text** is on; see [Supported normalization languages](/features/text-to-speech#supported-normalization-languages). -- **Speech-to-Text**: Transcribe audio files. New nodes use `transcribe-1-pro`. +- **Text-to-Speech**: Generate audio from text using any voice model. Choose the model: from package 0.6.0 (node version 1.3), new nodes use `s3-pro`, and `s3-pro-free` and `drama-3` are also in the list. Nodes already in your workflows keep their model. Under **Additional Options**, **Language** sets the language used to read out numbers, dates, units and symbols while **Normalize Text** is on; see [Supported normalization languages](/features/text-to-speech#supported-normalization-languages). +- **Speech-to-Text**: Transcribe audio files. New nodes use `transcribe-1-pro`; `transcribe-2-pro` is also in the list. - **Voice Models**: List, get, create, and delete custom voices - **Account**: Check credit balance From ccb983b30817267f5fa9492fa620fa15359cbe49 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:20:55 -0800 Subject: [PATCH 03/13] docs(sdk-quickstart): say the JavaScript play() needs ffmpeg fish-audio 0.4.0's play() spawns ffplay and throws 'ffplay from ffmpeg not found' without it; the Python tab already said so. --- developer-guide/sdk-guide/quickstart.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer-guide/sdk-guide/quickstart.mdx b/developer-guide/sdk-guide/quickstart.mdx index d9a4746c..1b7fbf71 100644 --- a/developer-guide/sdk-guide/quickstart.mdx +++ b/developer-guide/sdk-guide/quickstart.mdx @@ -68,7 +68,7 @@ await play(audio); ``` -Run it, and you'll have `output.mp3` (Python) or local playback (JavaScript). +Run it, and you'll have `output.mp3` (Python) or local playback (JavaScript). The JavaScript `play()` runs `ffplay`, so it needs [ffmpeg](https://ffmpeg.org/) installed; without it, `play()` throws `ffplay from ffmpeg not found`. Want async in Python? Every method mirrors onto `AsyncFishAudio`: `async with From 0ffa86f195a180bd727c100e138c8fb86260be86 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:21:18 -0800 Subject: [PATCH 04/13] docs(changelog): Python SDK 1.8 makes s3-pro the default The changelog stopped at Python SDK 1.6.0. Summarizes 1.7.0, 1.8.0 and 1.8.1 from the SDK's CHANGELOG at fish-audio-sdk-v1.8.1. --- developer-guide/getting-started/changelog.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/developer-guide/getting-started/changelog.mdx b/developer-guide/getting-started/changelog.mdx index 66d05e4a..f9042bea 100644 --- a/developer-guide/getting-started/changelog.mdx +++ b/developer-guide/getting-started/changelog.mdx @@ -58,6 +58,14 @@ rss: true [Models overview](/developer-guide/models-pricing/models-overview) | [S3 Pro model card](/developer-guide/models-pricing/models/s3-pro) | [Quick Start](/developer-guide/getting-started/quickstart) + + ## Python SDK 1.8: S3 Pro by default + + `fish-audio-sdk` 1.8.0 makes `s3-pro` the default text-to-speech model (1.7.0 and earlier used `s2.1-pro`), and 1.8.1 accepts `latency="low"`, which gives earlier first audio on `s3-pro`. Using `s1` or `transcribe-1`, both retiring on December 31, 2026, emits a `FutureWarning`. `APIError`, streams, and results expose the response headers, `WebSocketOptions` takes extra handshake headers, and every HTTP error response raises `APIError` or one of its subclasses, also when a proxy sends a body that isn't a JSON object. Since 1.7.0, the SDK sends `User-Agent: fish-audio-python/`. + + [Errors & Retries](/developer-guide/sdk-guide/python/errors) | [Release notes](https://github.com/fishaudio/fish-audio-python/releases/tag/fish-audio-sdk-v1.8.1) + + ## Voice Agents native iOS and Android SDKs From 3da6b048b3835cc85d135c751b770c87ce10cdd6 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 12:49:34 -0800 Subject: [PATCH 05/13] docs: scope the error statuses, response headers and n8n versions precisely - Python errors guide: local pydantic validation and API errors are separate; TTS returns 400, query validation such as voices.list(page_size=0) returns 422 (both checked live). - Errors page: 404 means resource not found, a voice model lookup is the example. - Changelog: 1.8.0 changes the default from s2.1-pro to s3-pro; name the calls that expose response headers; say what the APIError fix covers. - n8n: s3-pro, s3-pro-free and transcribe-2-pro need package 0.6.0. --- api-reference/errors.mdx | 2 +- developer-guide/getting-started/changelog.mdx | 2 +- developer-guide/integrations/n8n.mdx | 4 ++-- developer-guide/sdk-guide/python/errors.mdx | 17 ++++++++++------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/api-reference/errors.mdx b/api-reference/errors.mdx index 7c1c86f0..94782327 100644 --- a/api-reference/errors.mdx +++ b/api-reference/errors.mdx @@ -22,7 +22,7 @@ Some endpoints add fields. For example, `transcribe-1-pro` and `transcribe-2-pro | `401` | Invalid or missing API key | Send `Authorization: Bearer `; check it on [API Keys](https://fish.audio/app/api-keys). | | `402` | No API credit for the model you called | On a $0 balance, use the model `s3-pro-free`. For paid models, add API credit on [API Billing](https://fish.audio/app/developers/billing/). New developer accounts may receive a one-time free API credit on [Get Started](https://fish.audio/app/developers/get-started/?utm_source=docs&utm_medium=errors&utm_content=signup-credit), which works with every model. | | `403` | Not permitted for this key/resource | Check the key's scope and the resource owner. | -| `404` | Voice model not found, for example `GET /model/{id}` with an unknown ID (text to speech with an unknown `reference_id` returns `400`) | Verify the voice model ID. | +| `404` | Resource not found, for example a voice model on `GET /model/{id}` (text to speech with an unknown `reference_id` returns `400`) | Verify the ID in the path. | | `413` | Request body too large | Send a smaller request body. | | `429` | Too many requests, for example when your account is at its [concurrency limit](/developer-guide/models-pricing/pricing-and-rate-limits#concurrent-request-limits) | Back off and retry (see below). | | `5xx` | Server error | Retry with backoff; if it persists, contact support. | diff --git a/developer-guide/getting-started/changelog.mdx b/developer-guide/getting-started/changelog.mdx index f9042bea..c7fcda25 100644 --- a/developer-guide/getting-started/changelog.mdx +++ b/developer-guide/getting-started/changelog.mdx @@ -61,7 +61,7 @@ rss: true ## Python SDK 1.8: S3 Pro by default - `fish-audio-sdk` 1.8.0 makes `s3-pro` the default text-to-speech model (1.7.0 and earlier used `s2.1-pro`), and 1.8.1 accepts `latency="low"`, which gives earlier first audio on `s3-pro`. Using `s1` or `transcribe-1`, both retiring on December 31, 2026, emits a `FutureWarning`. `APIError`, streams, and results expose the response headers, `WebSocketOptions` takes extra handshake headers, and every HTTP error response raises `APIError` or one of its subclasses, also when a proxy sends a body that isn't a JSON object. Since 1.7.0, the SDK sends `User-Agent: fish-audio-python/`. + `fish-audio-sdk` 1.8.0 changes the default text-to-speech model from `s2.1-pro` to `s3-pro`, and 1.8.1 accepts `latency="low"` in `TTSConfig`, which gives earlier first audio on `s3-pro`. Using `s1` or `transcribe-1`, both retiring on December 31, 2026, emits a `FutureWarning`. Response headers, such as `x-fish-trace-id`, are on `APIError` and on the streams of `tts.stream()`, `tts.stream_with_timestamps()`, and `asr.stream_websocket()`, and the results of `tts.convert_with_timestamps()` and `asr.transcribe()`; `tts.convert()` returns only the audio, so use `tts.stream()` when you need them. `WebSocketOptions` takes extra handshake headers. An HTTP error response whose body is not a JSON object or not valid UTF-8, as a proxy may send, now raises `APIError` or one of its subclasses instead of an unrelated exception. Since 1.7.0, the SDK sends `User-Agent: fish-audio-python/`. [Errors & Retries](/developer-guide/sdk-guide/python/errors) | [Release notes](https://github.com/fishaudio/fish-audio-python/releases/tag/fish-audio-sdk-v1.8.1) diff --git a/developer-guide/integrations/n8n.mdx b/developer-guide/integrations/n8n.mdx index e5431759..0b420859 100644 --- a/developer-guide/integrations/n8n.mdx +++ b/developer-guide/integrations/n8n.mdx @@ -43,7 +43,7 @@ On n8n Cloud, an instance owner or admin opens the nodes panel, searches for **F The node supports: - **Text-to-Speech**: Generate audio from text using any voice model. Choose the model: from package 0.6.0 (node version 1.3), new nodes use `s3-pro`, and `s3-pro-free` and `drama-3` are also in the list. Nodes already in your workflows keep their model. Under **Additional Options**, **Language** sets the language used to read out numbers, dates, units and symbols while **Normalize Text** is on; see [Supported normalization languages](/features/text-to-speech#supported-normalization-languages). -- **Speech-to-Text**: Transcribe audio files. New nodes use `transcribe-1-pro`; `transcribe-2-pro` is also in the list. +- **Speech-to-Text**: Transcribe audio files. New nodes use `transcribe-1-pro`; from package 0.6.0, `transcribe-2-pro` is also in the list. - **Voice Models**: List, get, create, and delete custom voices - **Account**: Check credit balance @@ -51,7 +51,7 @@ The node is also available as an AI tool for use with n8n's AI Agent nodes. When a request fails and stops the workflow, the error's description shows the Fish Audio trace ID and error code if the API returned them. Include them when you contact support. With **Continue On Fail**, the output item carries only the error message, and older n8n versions that drop the API response from the error do not show these details. -These model choices, the **Language** option, and the trace ID in errors require version 0.5.0 or later of the node. +The `drama-3` and `s2.1-pro` model choices, the **Language** option, and the trace ID in errors require version 0.5.0 or later of the node; `s3-pro`, `s3-pro-free` and `transcribe-2-pro` require 0.6.0. ## Workflow templates diff --git a/developer-guide/sdk-guide/python/errors.mdx b/developer-guide/sdk-guide/python/errors.mdx index c9e4c0e3..5103295a 100644 --- a/developer-guide/sdk-guide/python/errors.mdx +++ b/developer-guide/sdk-guide/python/errors.mdx @@ -21,18 +21,21 @@ Every SDK error inherits from [`FishAudioError`](/api-reference/sdk/python/excep | `NotFoundError` | `404` | Voice model id not found, for example in `client.voices.get()` | | `RateLimitError` | `429` | Rate limit / quota exceeded | | `ServerError` | `5xx` | Transient server-side failure | -| `APIError` | any other non-2xx | Base for the above; `status == 400` for invalid parameters and for a `reference_id` that doesn't exist | +| `APIError` | any other non-2xx | Base for the above; e.g. `status == 400` for an invalid text-to-speech parameter or an unknown `reference_id`, `422` for an invalid query parameter such as `voices.list(page_size=0)` | | `WebSocketError` | realtime stream failed mid-session | Reconnect rather than retrying the same socket | | `ASRRealtimeError` | a realtime speech-to-text session ended with an error | Subclass of `WebSocketError`; carries `.error_type`, `.code`, `.request_id`, and `.close_code`, each `None` when not sent | | `DependencyError` | a required system tool is missing (e.g. ffmpeg for `play()`) | Carries `.dependency` and `.install_command` | - Invalid request parameters, such as an unknown `format`, come back as an - `APIError` with `status == 400`, and so does text to speech with a - `reference_id` that doesn't exist. Catch `APIError`, not - `fishaudio.exceptions.ValidationError` (none is raised at runtime). Values - the SDK checks itself, such as `TTSConfig(chunk_length=99)`, raise pydantic's - `ValidationError` before any request is sent; it is not a `FishAudioError`. + Invalid input fails in one of two places. Values the SDK checks itself, such + as `TTSConfig(format="bad")` or `TTSConfig(chunk_length=99)`, raise + pydantic's `ValidationError` before any request is sent; it is not a + `FishAudioError`. Values the SDK passes on, such as `format="bad"` given + straight to `tts.convert()`, are checked by the API and come back as an + `APIError`: `400` from text to speech (also for a `reference_id` that doesn't + exist), `422` for an invalid query parameter such as + `voices.list(page_size=0)`. Catch `APIError`, not + `fishaudio.exceptions.ValidationError` (none is raised at runtime). ## Handling errors From 4c65b644373ad8486eb9093b061dffccba12f60a Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:41:51 -0800 Subject: [PATCH 06/13] docs: bring the remaining pages to Python SDK 1.8.1 defaults and error behavior - Text to speech guide and SDK skill: the Python default is s3-pro from 1.8.0, the JavaScript default s3-pro from 0.4.0; Python accepts latency="low" from 1.8.1. - SDK skill errors: invalid TTSConfig raises pydantic's ValidationError before a request; API rejections are APIError, 400 from text to speech (also an unknown reference_id), 422 for query validation. - API skill: POST /v1/tts validation returns 400, not 422 (checked live). - Changelog: only an explicit transcribe-1 warns; callers without a model must migrate too. - n8n: saved nodes keep their model from 0.5.x on; before 0.5.0 a version-1 node without a model sent s1 (0.3.1), then s2-pro. --- .mintlify/skills/fish-audio-api/SKILL.md | 7 ++----- .mintlify/skills/fish-audio-sdk/SKILL.md | 4 ++-- .mintlify/skills/fish-audio-sdk/references/errors.md | 8 ++++---- .../skills/fish-audio-sdk/references/text-to-speech.md | 2 +- .mintlify/skills/fish-audio-sdk/references/websocket.md | 2 +- developer-guide/getting-started/changelog.mdx | 2 +- developer-guide/integrations/n8n.mdx | 2 +- features/text-to-speech.mdx | 4 ++-- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.mintlify/skills/fish-audio-api/SKILL.md b/.mintlify/skills/fish-audio-api/SKILL.md index acfc4985..25ae23f8 100644 --- a/.mintlify/skills/fish-audio-api/SKILL.md +++ b/.mintlify/skills/fish-audio-api/SKILL.md @@ -638,11 +638,8 @@ S2-Pro and the S2.1-Pro models use free-form `[bracket]` natural-language tags i - 401 → missing / bad `Authorization` header. - 402 → out of credit. Check `/wallet/self/api-credit`. - 404 → bad `model/{id}` (voice model doesn't exist or isn't visible to you). -- 422 → validation. The response is an array; each item's `loc` points at the offending field. Most common causes: - - `reference_id` is an array but model is `s1` (multi-speaker requires `s3-pro`, `s2-pro`, an S2.1-Pro model, or `drama-3`). - - `references` sent with `Content-Type: application/json` (must be msgpack). - - Numeric param out of range (`temperature`, `top_p`, `chunk_length`, `min_chunk_length`, `prosody.speed`, `early_stop_threshold`). - - `mp3_bitrate` / `opus_bitrate` set without matching `format`. +- 400 on `POST /v1/tts` → also invalid parameters; `message` names the problem. Seen: an unknown `format` or `latency`, a value out of range (`top_p`, `chunk_length`, `prosody.speed`, `mp3_bitrate`), `references` that are not valid audio (send them as msgpack), a `reference_id` that doesn't exist (`Reference not found`). +- 422 → query validation on other endpoints, for example `GET /model?page_size=0`; the response's `errors` array names each invalid parameter. - WebSocket: a `finish` event with `reason: "error"` means the server failed mid-stream. Surface the message and reconnect rather than retrying on the same socket. - `POST /v1/asr` (`transcribe-1-pro`, `transcribe-2-pro`): branch on the HTTP status and on `code`, never on `message`. New `code` values may be added; handle unknown codes by HTTP status. With `transcribe-1`, rely only on `status` and `message`. - 400 → fix the request; do not retry. Codes: `invalid_request` (unreadable body, missing or repeated `audio`), `invalid_parameter` (bad or conflicting field values), `invalid_audio` (undecodable or unsupported format), `audio_too_long` (over 60 minutes), `audio_too_short` (under about 0.08 s). diff --git a/.mintlify/skills/fish-audio-sdk/SKILL.md b/.mintlify/skills/fish-audio-sdk/SKILL.md index 6934c51c..e395db79 100644 --- a/.mintlify/skills/fish-audio-sdk/SKILL.md +++ b/.mintlify/skills/fish-audio-sdk/SKILL.md @@ -124,7 +124,7 @@ The two SDKs do **not** use the same names. Use this map when porting code betwe ## Gotchas (verified against the SDK source) -- Python `latency` accepts only **`"normal"` or `"balanced"`** (default `"balanced"`); there is no `"low"`. +- Python `latency` accepts `"normal"`, `"balanced"` (default) and, from `fish-audio-sdk` 1.8.1, `"low"`; 1.8.0's `TTSConfig` rejects `"low"`. `"low"` is not available on `s3-pro-free`. - The Python client has **no `max_retries`** and does **not** auto-retry; the JS client **does** auto-retry (configurable via per-call `requestOptions.maxRetries`). See [errors](references/errors.md). -- Python defines a `ValidationError` class but **never raises it**, so don't catch it expecting validation failures; a 422 surfaces as `APIError`. The JS SDK throws `UnprocessableEntityError` on 422. +- Python defines a `ValidationError` class but **never raises it**, so don't catch it expecting validation failures. Invalid `TTSConfig` values raise pydantic's `ValidationError` before any request (not a `FishAudioError`); values the API rejects surface as `APIError` (`400` from text to speech, also for an unknown `reference_id`). The JS SDK throws `UnprocessableEntityError` on 422. - ASR segment `start` / `end` and `duration` are all in **seconds**. In `fish-audio-sdk` 1.3.0 and earlier, the `ASRResponse` docstring says milliseconds; that is wrong. See [speech-to-text](references/speech-to-text.md). diff --git a/.mintlify/skills/fish-audio-sdk/references/errors.md b/.mintlify/skills/fish-audio-sdk/references/errors.md index 6ff8d946..c62d70de 100644 --- a/.mintlify/skills/fish-audio-sdk/references/errors.md +++ b/.mintlify/skills/fish-audio-sdk/references/errors.md @@ -11,7 +11,7 @@ Hierarchy (all subclasses of `FishAudioError`): | `APIError` | base for HTTP errors | `.status`, `.message`, `.body` | | `AuthenticationError` | 401 (bad/missing key) | (APIError) | | `PermissionError` | 403 | (APIError) | -| `NotFoundError` | 404 (voice id not found) | (APIError) | +| `NotFoundError` | 404 (e.g. `voices.get()` with an unknown id) | (APIError) | | `RateLimitError` | 429 | (APIError) | | `ServerError` | 5xx | (APIError) | | `WebSocketError` | realtime stream failed | — | @@ -35,14 +35,14 @@ except AuthenticationError: except RateLimitError: ... # slow down / out of quota except NotFoundError: - ... # reference_id doesn't exist + ... # 404, e.g. voices.get() with an unknown id except APIError as e: - print(e.status, e.message) # any other HTTP error + print(e.status, e.message) # any other HTTP error; 400 for an unknown reference_id except FishAudioError as e: print("SDK error:", e) # non-HTTP (e.g. WebSocketError, DependencyError) ``` -> **Do not catch `ValidationError`.** The class exists and is exported, but the SDK **never raises it**. Invalid input comes back as an `APIError` (HTTP 422). Catch `APIError` (and read `.status == 422`) instead. +> **Do not catch `fishaudio.exceptions.ValidationError`.** The class exists and is exported, but the SDK **never raises it**. Invalid `TTSConfig` values raise pydantic's `ValidationError` before any request is sent (not a `FishAudioError`). Values the API rejects come back as an `APIError`: `400` from text to speech (an unknown `format`, an out-of-range value, an unknown `reference_id`), `422` for an invalid query parameter such as `voices.list(page_size=0)`. ### Retries & timeouts (Python) 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 c4446759..158e8e5a 100644 --- a/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md +++ b/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md @@ -136,5 +136,5 @@ await writeFile("out.mp3", audio2); ## Model & expression notes -- `s3-pro` is the recommended model; pass it explicitly. `s2.1-pro` 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 `s3-pro`. Migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`. +- `s3-pro` is the recommended model; pass it explicitly. `s3-pro` is also the Python SDK default (`fish-audio-sdk` 1.8.0 and later; 1.4.0 to 1.7.0 default to `s2.1-pro`). `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 `s3-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 ff3a0bde..5bb04d27 100644 --- a/.mintlify/skills/fish-audio-sdk/references/websocket.md +++ b/.mintlify/skills/fish-audio-sdk/references/websocket.md @@ -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.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. +`stream_websocket` keyword params mirror `convert`: `reference_id`, `references`, `format`, `latency`, `speed`, `config`, `model` (default `"s3-pro"` in `fish-audio-sdk` 1.8.0 and later), 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/developer-guide/getting-started/changelog.mdx b/developer-guide/getting-started/changelog.mdx index c7fcda25..81a4a58f 100644 --- a/developer-guide/getting-started/changelog.mdx +++ b/developer-guide/getting-started/changelog.mdx @@ -61,7 +61,7 @@ rss: true ## Python SDK 1.8: S3 Pro by default - `fish-audio-sdk` 1.8.0 changes the default text-to-speech model from `s2.1-pro` to `s3-pro`, and 1.8.1 accepts `latency="low"` in `TTSConfig`, which gives earlier first audio on `s3-pro`. Using `s1` or `transcribe-1`, both retiring on December 31, 2026, emits a `FutureWarning`. Response headers, such as `x-fish-trace-id`, are on `APIError` and on the streams of `tts.stream()`, `tts.stream_with_timestamps()`, and `asr.stream_websocket()`, and the results of `tts.convert_with_timestamps()` and `asr.transcribe()`; `tts.convert()` returns only the audio, so use `tts.stream()` when you need them. `WebSocketOptions` takes extra handshake headers. An HTTP error response whose body is not a JSON object or not valid UTF-8, as a proxy may send, now raises `APIError` or one of its subclasses instead of an unrelated exception. Since 1.7.0, the SDK sends `User-Agent: fish-audio-python/`. + `fish-audio-sdk` 1.8.0 changes the default text-to-speech model from `s2.1-pro` to `s3-pro`, and 1.8.1 accepts `latency="low"` in `TTSConfig`, which gives earlier first audio on `s3-pro`. Passing `model="s1"` or `model="transcribe-1"`, both retiring on December 31, 2026, emits a `FutureWarning`. `asr.transcribe()` without a `model` sends no model header and runs on `transcribe-1` without a warning, so pass `model="transcribe-2-pro"`; see [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). Response headers, such as `x-fish-trace-id`, are on `APIError` and on the streams of `tts.stream()`, `tts.stream_with_timestamps()`, and `asr.stream_websocket()`, and the results of `tts.convert_with_timestamps()` and `asr.transcribe()`; `tts.convert()` returns only the audio, so use `tts.stream()` when you need them. `WebSocketOptions` takes extra handshake headers. An HTTP error response whose body is not a JSON object or not valid UTF-8, as a proxy may send, now raises `APIError` or one of its subclasses instead of an unrelated exception. Since 1.7.0, the SDK sends `User-Agent: fish-audio-python/`. [Errors & Retries](/developer-guide/sdk-guide/python/errors) | [Release notes](https://github.com/fishaudio/fish-audio-python/releases/tag/fish-audio-sdk-v1.8.1) diff --git a/developer-guide/integrations/n8n.mdx b/developer-guide/integrations/n8n.mdx index 0b420859..7757fd70 100644 --- a/developer-guide/integrations/n8n.mdx +++ b/developer-guide/integrations/n8n.mdx @@ -42,7 +42,7 @@ On n8n Cloud, an instance owner or admin opens the nodes panel, searches for **F The node supports: -- **Text-to-Speech**: Generate audio from text using any voice model. Choose the model: from package 0.6.0 (node version 1.3), new nodes use `s3-pro`, and `s3-pro-free` and `drama-3` are also in the list. Nodes already in your workflows keep their model. Under **Additional Options**, **Language** sets the language used to read out numbers, dates, units and symbols while **Normalize Text** is on; see [Supported normalization languages](/features/text-to-speech#supported-normalization-languages). +- **Text-to-Speech**: Generate audio from text using any voice model. Choose the model: from package 0.6.0 (node version 1.3), new nodes use `s3-pro`, and `s3-pro-free` and `drama-3` are also in the list. Nodes already in your workflows keep their model when you upgrade from 0.5.x to 0.6.0. Before 0.5.0 the node had a single version, so a node saved with no model chosen follows the package: it sent `s1` on 0.3.1 and sends `s2-pro` from 0.4.0 on. Under **Additional Options**, **Language** sets the language used to read out numbers, dates, units and symbols while **Normalize Text** is on; see [Supported normalization languages](/features/text-to-speech#supported-normalization-languages). - **Speech-to-Text**: Transcribe audio files. New nodes use `transcribe-1-pro`; from package 0.6.0, `transcribe-2-pro` is also in the list. - **Voice Models**: List, get, create, and delete custom voices - **Account**: Check credit balance diff --git a/features/text-to-speech.mdx b/features/text-to-speech.mdx index 1791f4f8..bffdf089 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 `s3-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.1-pro"` (`fish-audio-sdk` 1.4.0 and later; earlier versions default to `s2-pro`). The JavaScript SDK defaults to `s2.1-pro` (`fish-audio` 0.2.0 and later). See [Models Overview](/developer-guide/models-pricing/models-overview). +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="s3-pro"` (`fish-audio-sdk` 1.8.0 and later; 1.4.0 to 1.7.0 default to `s2.1-pro`, earlier versions to `s2-pro`). The JavaScript SDK defaults to `s3-pro` (`fish-audio` 0.4.0 and later; 0.2.0 and 0.3.0 default to `s2.1-pro`). See [Models Overview](/developer-guide/models-pricing/models-overview). ### Output formats @@ -275,7 +275,7 @@ audio = client.tts.convert( - `latency="balanced"` (default): lower time-to-first-audio. Good for interactive use. For the measured time to first audio on `s3-pro` with `balanced` and `low`, see [S3 Pro benchmarks](/developer-guide/models-pricing/models/s3-pro#benchmarks). - `latency="normal"`: most stable output, at slightly higher latency. -- `latency="low"`: lowest latency. Send it in the API request body, or with the JavaScript SDK. The Python SDK's `TTSConfig` accepts `balanced` and `normal`. `latency: "low"` is not available on `s3-pro-free`. +- `latency="low"`: lowest latency. Send it in the API request body, with the JavaScript SDK, or with the Python SDK (`fish-audio-sdk` 1.8.1 and later). `latency: "low"` is not available on `s3-pro-free`. - `chunk_length` (`100`–`300`): smaller chunks start audio sooner; larger chunks are more efficient for long text. The API default is `300`; the Python SDK's `TTSConfig` sends `200` unless you set it. On `s3-pro`, chunking is managed automatically by the service. From 59d24e13a78877503d301f91d2add57dd410c932 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 13:42:31 -0800 Subject: [PATCH 07/13] docs: current SDK default models in the SDK skill and the S1 migration guide fish-audio-sdk defaults to s3-pro from 1.8.0 (s2.1-pro in 1.4.0-1.7.0); fish-audio defaults to s3-pro from 0.4.0 (s2.1-pro in 0.2.0 and 0.3.0). Both Model/Backends types now also name s3-pro and s3-pro-free. --- .mintlify/skills/fish-audio-sdk/SKILL.md | 2 +- .mintlify/skills/fish-audio-sdk/references/text-to-speech.md | 2 +- developer-guide/models-pricing/migrate-from-s1.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mintlify/skills/fish-audio-sdk/SKILL.md b/.mintlify/skills/fish-audio-sdk/SKILL.md index e395db79..27c3a696 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`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: the current SDK releases default to `s2.1-pro`. 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 `s3-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 SDK (`fish-audio` 0.2.0) defaults to `"s2.1-pro"`, and its `Backends` type names `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s2-pro`, `s1` and accepts any other string, so no cast is needed. `fish-audio` 0.1.0 defaulted to the deprecated `"s1"`; if a project is on 0.1.0, upgrade it or pass the model explicitly. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. +- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: it is the default only in the current SDK releases. 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 `s3-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK defaults to `s3-pro` from `fish-audio-sdk` 1.8.0 (1.4.0 to 1.7.0: `s2.1-pro`); its `Model` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` 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 SDK defaults to `"s3-pro"` from `fish-audio` 0.4.0 (0.2.0 and 0.3.0: `"s2.1-pro"`), and its `Backends` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no cast is needed. `fish-audio` 0.1.0 defaulted to the deprecated `"s1"`; if a project is on 0.1.0, upgrade it or pass the model explicitly. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. - **ASR models:** use `transcribe-2-pro` (recommended: speaker turns, long recordings, emotion cues, plus key terms and written or spoken numbers through the API); `transcribe-1-pro` is the previous Pro model. The model is selected by the `model` HTTP header: in JS pass `model: "transcribe-2-pro"` in the `convert()` request (`fish-audio` 0.2.0+), in Python send the header with `RequestOptions(additional_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). - **`transcribe-2-pro`:** another ASR model, selected the same way as `transcribe-1-pro` with the header value `transcribe-2-pro`. It returns the same response format; its `text_format`, `verbatim`, and `keyterms` fields need raw HTTP (see the `fish-audio-api` skill). - **Audio formats:** `mp3` (default), `wav`, `pcm`, `opus`. 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 158e8e5a..21a1357c 100644 --- a/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md +++ b/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md @@ -102,7 +102,7 @@ with client.tts.stream_with_timestamps(text="Long passage...", format="opus") as ## JavaScript: `client.textToSpeech` -`convert(request, backend?, requestOptions?)` resolves to a `ReadableStream` you can `play()` or pipe to a file. `backend` is the **second positional** argument, **not** a named option. It defaults to `"s2.1-pro"` in `fish-audio` 0.2.0 (0.1.0 defaulted to the deprecated `"s1"`, so pass it explicitly if a project is still on 0.1.0). +`convert(request, backend?, requestOptions?)` resolves to a `ReadableStream` you can `play()` or pipe to a file. `backend` is the **second positional** argument, **not** a named option. It defaults to `"s3-pro"` in `fish-audio` 0.4.0 and later (`"s2.1-pro"` in 0.2.0 and 0.3.0; 0.1.0 defaulted to the deprecated `"s1"`, so pass it explicitly if a project is still on 0.1.0). ```ts import { FishAudioClient, play } from "fish-audio"; diff --git a/developer-guide/models-pricing/migrate-from-s1.mdx b/developer-guide/models-pricing/migrate-from-s1.mdx index cb30f28f..9d91727c 100644 --- a/developer-guide/models-pricing/migrate-from-s1.mdx +++ b/developer-guide/models-pricing/migrate-from-s1.mdx @@ -33,7 +33,7 @@ The steps below cover each of these changes. In the API, you select the model with the `model` request header. Change `s1` to `s3-pro` wherever you set the model, including SDK and integration settings. -If you use the JavaScript SDK (`fish-audio` on npm) 0.1.0 without passing a model, your requests use `s1`, because that is its default backend. Upgrade to 0.2.0 or later, which defaults to `s2.1-pro` (check the [upgrade notes](/api-reference/sdk/javascript/api-reference#upgrade-notes) for other breaking changes first), and pass `"s3-pro"` explicitly. +If you use the JavaScript SDK (`fish-audio` on npm) 0.1.0 without passing a model, your requests use `s1`, because that is its default backend. Upgrade to 0.2.0 or later, which defaults to `s2.1-pro` (`s3-pro` from 0.4.0; check the [upgrade notes](/api-reference/sdk/javascript/api-reference#upgrade-notes) for other breaking changes first), and pass `"s3-pro"` explicitly. This example also converts the emotion tags, as described in the next step: From deeb2182ce9834c874378dcb385df7657d2290b0 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:13:27 -0800 Subject: [PATCH 08/13] docs: keep the SDK default-model history in one table The S1 migration guide now lists the model each published SDK version sends without one (Python 1.0.0-1.2.0 s1, 1.3.0 s2-pro, 1.4.0-1.7.0 s2.1-pro, 1.8.0+ s3-pro; legacy Session speech-1.5; JavaScript 0.0.1-0.1.0 s1, 0.2.0-0.3.0 s2.1-pro, 0.4.0+ s3-pro; Go v1.0.0 no header, v1.1.x s2-pro, v1.2.0 s2.1-pro, v1.3.0+ s3-pro), read from the published wheels, npm tarballs and Go tags. Other pages state the current default and link to it. The SDK skill's tts.convert() table gives the current default and allows latency "low". --- .mintlify/skills/fish-audio-sdk/SKILL.md | 2 +- .../references/text-to-speech.md | 10 ++++----- .../fish-audio-sdk/references/websocket.md | 2 +- .../models-pricing/migrate-from-s1.mdx | 21 ++++++++++++++++++- features/text-to-speech.mdx | 2 +- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.mintlify/skills/fish-audio-sdk/SKILL.md b/.mintlify/skills/fish-audio-sdk/SKILL.md index 27c3a696..c1438b8e 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`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: it is the default only in the current SDK releases. 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 `s3-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK defaults to `s3-pro` from `fish-audio-sdk` 1.8.0 (1.4.0 to 1.7.0: `s2.1-pro`); its `Model` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` 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 SDK defaults to `"s3-pro"` from `fish-audio` 0.4.0 (0.2.0 and 0.3.0: `"s2.1-pro"`), and its `Backends` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no cast is needed. `fish-audio` 0.1.0 defaulted to the deprecated `"s1"`; if a project is on 0.1.0, upgrade it or pass the model explicitly. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. +- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: it is the default only in the current SDK releases (`fish-audio-sdk` 1.8.0+, `fish-audio` 0.4.0+); older versions default to other models, some to `s1` (table: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`). 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 `s3-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK's `Model` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no `# type: ignore` is needed. The JS SDK's `Backends` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no cast is needed. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. - **ASR models:** use `transcribe-2-pro` (recommended: speaker turns, long recordings, emotion cues, plus key terms and written or spoken numbers through the API); `transcribe-1-pro` is the previous Pro model. The model is selected by the `model` HTTP header: in JS pass `model: "transcribe-2-pro"` in the `convert()` request (`fish-audio` 0.2.0+), in Python send the header with `RequestOptions(additional_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). - **`transcribe-2-pro`:** another ASR model, selected the same way as `transcribe-1-pro` with the header value `transcribe-2-pro`. It returns the same response format; its `text_format`, `verbatim`, and `keyterms` fields need raw HTTP (see the `fish-audio-api` skill). - **Audio formats:** `mp3` (default), `wav`, `pcm`, `opus`. 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 21a1357c..37317670 100644 --- a/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md +++ b/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md @@ -34,10 +34,10 @@ All keyword-only: | `reference_id` | `str \| None` | `None` | Voice model id to speak with. | | `references` | `list[ReferenceAudio] \| None` | `None` | Inline clone samples; see [voice-cloning.md](voice-cloning.md). | | `format` | `"mp3" \| "wav" \| "pcm" \| "opus"` | `"mp3"` | Output format. | -| `latency` | `"normal" \| "balanced"` | `"balanced"` | `normal` = higher quality, `balanced` = faster. (No `"low"`.) | +| `latency` | `"normal" \| "balanced" \| "low"` | `"balanced"` | `normal` = higher quality, `balanced` = faster, `low` = earliest first audio on `s3-pro` (not on `s3-pro-free`). `TTSConfig` accepts `"low"` from 1.8.1. | | `speed` | `float` | — | Shortcut for prosody speed (0.5–2.0). | | `config` | `TTSConfig` | `TTSConfig()` | Reusable bundle of the settings below. | -| `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 `s3-pro`. `speech-1.5` / `speech-1.6` are deprecated. | +| `model` | `"s3-pro" \| "s3-pro-free" \| "s2.1-pro" \| "s2.1-pro-free" \| "s2-pro" \| "drama-3" \| "s1"` or any `str` | `"s3-pro"` | Synthesis model (default in `fish-audio-sdk` 1.8.0 and later; older versions: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`). `s1` is deprecated and will be retired on December 31, 2026; after that date, requests that specify `s1` are served by `s3-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. @@ -102,7 +102,7 @@ with client.tts.stream_with_timestamps(text="Long passage...", format="opus") as ## JavaScript: `client.textToSpeech` -`convert(request, backend?, requestOptions?)` resolves to a `ReadableStream` you can `play()` or pipe to a file. `backend` is the **second positional** argument, **not** a named option. It defaults to `"s3-pro"` in `fish-audio` 0.4.0 and later (`"s2.1-pro"` in 0.2.0 and 0.3.0; 0.1.0 defaulted to the deprecated `"s1"`, so pass it explicitly if a project is still on 0.1.0). +`convert(request, backend?, requestOptions?)` resolves to a `ReadableStream` you can `play()` or pipe to a file. `backend` is the **second positional** argument, **not** a named option. It defaults to `"s3-pro"` in `fish-audio` 0.4.0 and later; older versions default to other models, some to the deprecated `"s1"` (see the table linked under Model & expression notes), so pass it explicitly. ```ts import { FishAudioClient, play } from "fish-audio"; @@ -132,9 +132,9 @@ await writeFile("out.mp3", audio2); `TTSRequest` (the first argument) fields: `text` (required), `reference_id?` (a voice ID, or an array of IDs for multi-speaker text with `<|speaker:N|>` tags, on `s3-pro`, the S2 models, and `drama-3`), `references?`, `format?`, `latency?` (`"low" | "normal" | "balanced"`), `prosody?: { speed?; volume?; normalize_loudness? }`, `temperature?`, `top_p?`, `chunk_length?`, `mp3_bitrate?`, `opus_bitrate?` (bits per second: `-1000 | 24000 | 32000 | 48000 | 64000`), `sample_rate?`, `normalize?`, plus the advanced generation knobs (`max_new_tokens`, `repetition_penalty`, `min_chunk_length`, `condition_on_previous_chunks`, `early_stop_threshold`, `features`). Field names are `snake_case`, matching the API. -> The JS `Backends` type (`fish-audio` 0.2.0) is `'s1' | 's2-pro' | 's2.1-pro' | 's2.1-pro-free' | 'drama-3'` plus any other string, so do not cast. Prefer `s3-pro`, the recommended model. Do not choose `s1`. Code written for 0.1.0 may still have `as Backends` casts; they are harmless but unnecessary. +> The JS `Backends` type (`fish-audio` 0.4.0) is `'s1' | 's2-pro' | 's2.1-pro' | 's2.1-pro-free' | 'drama-3' | 's3-pro' | 's3-pro-free'` plus any other string, so do not cast. Prefer `s3-pro`, the recommended model. Do not choose `s1`. Code written for 0.1.0 may still have `as Backends` casts; they are harmless but unnecessary. ## Model & expression notes -- `s3-pro` is the recommended model; pass it explicitly. `s3-pro` is also the Python SDK default (`fish-audio-sdk` 1.8.0 and later; 1.4.0 to 1.7.0 default to `s2.1-pro`). `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 `s3-pro`. Migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`. +- `s3-pro` is the recommended model; pass it explicitly. `s3-pro` is the default of the current SDKs; for older versions see `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`. `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 `s3-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 5bb04d27..c47c72ab 100644 --- a/.mintlify/skills/fish-audio-sdk/references/websocket.md +++ b/.mintlify/skills/fish-audio-sdk/references/websocket.md @@ -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 `"s3-pro"` in `fish-audio-sdk` 1.8.0 and later), 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 `"s3-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/developer-guide/models-pricing/migrate-from-s1.mdx b/developer-guide/models-pricing/migrate-from-s1.mdx index 9d91727c..0ae5a17d 100644 --- a/developer-guide/models-pricing/migrate-from-s1.mdx +++ b/developer-guide/models-pricing/migrate-from-s1.mdx @@ -33,7 +33,26 @@ The steps below cover each of these changes. In the API, you select the model with the `model` request header. Change `s1` to `s3-pro` wherever you set the model, including SDK and integration settings. -If you use the JavaScript SDK (`fish-audio` on npm) 0.1.0 without passing a model, your requests use `s1`, because that is its default backend. Upgrade to 0.2.0 or later, which defaults to `s2.1-pro` (`s3-pro` from 0.4.0; check the [upgrade notes](/api-reference/sdk/javascript/api-reference#upgrade-notes) for other breaking changes first), and pass `"s3-pro"` explicitly. +If you call an SDK without passing a model, the SDK version decides which model your requests use. Look up your version in the table below: where it says `s1`, your requests use S1 although your code never names it. Upgrade the SDK, or pass `s3-pro` explicitly. For the JavaScript SDK, check the [upgrade notes](/api-reference/sdk/javascript/api-reference#upgrade-notes) for other breaking changes first. + +### Default model by SDK version + +The model each published SDK version sends when you don't pass one: + +| SDK | Version | Default model | +|---|---|---| +| Python (`fish-audio-sdk`, `fishaudio` client) | 1.0.0 to 1.2.0 | `s1` | +| | 1.3.0 | `s2-pro` | +| | 1.4.0 to 1.7.0 | `s2.1-pro` | +| | 1.8.0 and later | `s3-pro` | +| Python, legacy `fish_audio_sdk.Session` (in the same package) | all versions | `speech-1.5` (deprecated) | +| JavaScript (`fish-audio`) | 0.0.1 to 0.1.0 | `s1` | +| | 0.2.0 and 0.3.0 | `s2.1-pro` | +| | 0.4.0 and later | `s3-pro` | +| Go (`fish-audio-go`) | v1.0.0 | no `model` header: the API's default applies | +| | v1.1.0 and v1.1.1 | `s2-pro` | +| | v1.2.0 | `s2.1-pro` | +| | v1.3.0 and later | `s3-pro` | This example also converts the emotion tags, as described in the next step: diff --git a/features/text-to-speech.mdx b/features/text-to-speech.mdx index bffdf089..e99b5412 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 `s3-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="s3-pro"` (`fish-audio-sdk` 1.8.0 and later; 1.4.0 to 1.7.0 default to `s2.1-pro`, earlier versions to `s2-pro`). The JavaScript SDK defaults to `s3-pro` (`fish-audio` 0.4.0 and later; 0.2.0 and 0.3.0 default to `s2.1-pro`). See [Models Overview](/developer-guide/models-pricing/models-overview). +In the API, select with the `model` request header; requests without it use `s2.1-pro`. The current Python, JavaScript and Go SDKs default to `s3-pro`; earlier versions default to other models, see [Default model by SDK version](/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version). See [Models Overview](/developer-guide/models-pricing/models-overview). ### Output formats From 11ab01c280ebd6d4d7b31b952c71c70cb68d8c8d Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:13:41 -0800 Subject: [PATCH 09/13] docs(realtime): the Python SDK sends latency "low" from 1.8.1 --- features/text-to-speech/realtime.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/text-to-speech/realtime.mdx b/features/text-to-speech/realtime.mdx index 10201dfb..ee9c9dc5 100644 --- a/features/text-to-speech/realtime.mdx +++ b/features/text-to-speech/realtime.mdx @@ -161,7 +161,7 @@ Both streaming paths take a `latency` mode: - `latency="balanced"` (default): low time-to-first-audio. Use it for voice agents and live LLM output. - `latency="normal"`: slightly higher latency, best audio quality. Use it for narration where you can afford a beat. -- `"latency": "low"`: lowest latency, in the API request body or with the JavaScript SDK. The Python SDK accepts `balanced` and `normal`. `latency: "low"` is not available on `s3-pro-free`. +- `"latency": "low"`: lowest latency, in the API request body, with the JavaScript SDK, or with the Python SDK (`fish-audio-sdk` 1.8.1 and later). `latency: "low"` is not available on `s3-pro-free`. ```python for chunk in client.tts.stream_websocket(llm_tokens(), latency="balanced"): From 9b16ac19539affdc86b2c7ab088bbb78c51330e3 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:14:32 -0800 Subject: [PATCH 10/13] docs(errors): a 422 carries an errors array, not detail Live, GET /model?page_size=0, sort_by=bad, page_number=abc, POST /model without title and PATCH /model visibility=bad all return {status, message, errors: [{field, in, code, message}]}. With fish-audio 0.4.0, UnprocessableEntityError.body.detail is undefined and body.errors[0].field is "page_size". --- .mintlify/skills/fish-audio-api/SKILL.md | 4 ++-- .mintlify/skills/fish-audio-sdk/references/errors.md | 6 +++--- api-reference/errors.mdx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.mintlify/skills/fish-audio-api/SKILL.md b/.mintlify/skills/fish-audio-api/SKILL.md index 25ae23f8..1227edfc 100644 --- a/.mintlify/skills/fish-audio-api/SKILL.md +++ b/.mintlify/skills/fish-audio-api/SKILL.md @@ -20,7 +20,7 @@ This file condenses those into rules an agent can apply directly. - Optional distributed tracing for inference APIs: see `https://docs.fish.audio/api-reference/observability`. - Get API keys: `https://fish.audio/app/api-keys` - Never hardcode keys. Read from an env var like `FISH_API_KEY`. -- Errors are JSON with at least `{status, message}` (for example 401 / 402 / 404 / 429). Speech-to-text errors from `transcribe-1-pro` and `transcribe-2-pro` also carry `code` and `request_id`. Errors from the network edge in front of the API (some 413 and 5xx responses) may not be JSON. `422` validation errors, on the endpoints that return them, are an array of `{loc, type, msg, ctx, in}`. +- Errors are JSON with at least `{status, message}` (for example 401 / 402 / 404 / 429). Speech-to-text errors from `transcribe-1-pro` and `transcribe-2-pro` also carry `code` and `request_id`. Errors from the network edge in front of the API (some 413 and 5xx responses) may not be JSON. `422` validation errors, on the endpoints that return them, add an `errors` array of `{field, in, code, message}` to `status` and `message`. ## Endpoint map @@ -639,7 +639,7 @@ S2-Pro and the S2.1-Pro models use free-form `[bracket]` natural-language tags i - 402 → out of credit. Check `/wallet/self/api-credit`. - 404 → bad `model/{id}` (voice model doesn't exist or isn't visible to you). - 400 on `POST /v1/tts` → also invalid parameters; `message` names the problem. Seen: an unknown `format` or `latency`, a value out of range (`top_p`, `chunk_length`, `prosody.speed`, `mp3_bitrate`), `references` that are not valid audio (send them as msgpack), a `reference_id` that doesn't exist (`Reference not found`). -- 422 → query validation on other endpoints, for example `GET /model?page_size=0`; the response's `errors` array names each invalid parameter. +- 422 → field validation on other endpoints, for example `GET /model?page_size=0` or `POST /model` without `title`; the response's `errors` array names each invalid field (`field`, `in`: `query` or `body`, `code`, `message`). - WebSocket: a `finish` event with `reason: "error"` means the server failed mid-stream. Surface the message and reconnect rather than retrying on the same socket. - `POST /v1/asr` (`transcribe-1-pro`, `transcribe-2-pro`): branch on the HTTP status and on `code`, never on `message`. New `code` values may be added; handle unknown codes by HTTP status. With `transcribe-1`, rely only on `status` and `message`. - 400 → fix the request; do not retry. Codes: `invalid_request` (unreadable body, missing or repeated `audio`), `invalid_parameter` (bad or conflicting field values), `invalid_audio` (undecodable or unsupported format), `audio_too_long` (over 60 minutes), `audio_too_short` (under about 0.08 s). diff --git a/.mintlify/skills/fish-audio-sdk/references/errors.md b/.mintlify/skills/fish-audio-sdk/references/errors.md index c62d70de..8c8568fe 100644 --- a/.mintlify/skills/fish-audio-sdk/references/errors.md +++ b/.mintlify/skills/fish-audio-sdk/references/errors.md @@ -76,8 +76,8 @@ try { }); } catch (err) { if (err instanceof UnprocessableEntityError) { - const body = err.body as { detail?: unknown } | undefined; - console.error("422 validation:", body?.detail); // [{ loc, msg, type }] + const body = err.body as { errors?: { field: string; in: string; code: string; message: string }[] } | undefined; + console.error("422 validation:", body?.errors); // e.g. [{ field: "page_size", in: "query", code: "out_of_range", ... }] } else if (err instanceof FishAudioError) { if (err.statusCode === undefined) { console.error("no status:", err.message); // a timeout or a network error @@ -94,7 +94,7 @@ What the JS client actually throws for ordinary HTTP requests (`convert`, `voice | Error | When | | ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `UnprocessableEntityError` (extends `FishAudioError`) | 422, the **only** typed HTTP subclass thrown; `.body` is `{ detail: [{ loc, msg, type }] }` | +| `UnprocessableEntityError` (extends `FishAudioError`) | 422, the **only** typed HTTP subclass thrown; `.body` is `{ status, message, errors: [{ field, in, code, message }] }` | | `FishAudioError` | every other non-2xx response; read `.statusCode`, `.body`, `.rawResponse` | | `FishAudioError` with no `statusCode` | no usable response: the request exceeded the timeout or the network failed. with Node.js's built-in `fetch`, 0.2.0 does not throw the exported `FishAudioTimeoutError`; a `fetch` that rejects with `AbortError` does | diff --git a/api-reference/errors.mdx b/api-reference/errors.mdx index 94782327..be7bb37d 100644 --- a/api-reference/errors.mdx +++ b/api-reference/errors.mdx @@ -90,7 +90,7 @@ try { await client.textToSpeech.convert({ text: "Hello!" }); } catch (err) { if (err instanceof UnprocessableEntityError) { - console.error(err.body?.detail); // invalid parameters + console.error(err.body?.errors); // [{ field, in, code, message }], e.g. GET /model?page_size=0 } else if (err instanceof FishAudioError) { if (err.statusCode === undefined) { // no status: usually a timeout or a network error; see err.message From 61a5397663115174d6d967aa9689798b17317f88 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:14:58 -0800 Subject: [PATCH 11/13] docs(n8n): transcribe-1-pro is the default for new nodes from 0.5.0 n8n-nodes-fishaudio 0.3.1 and 0.4.0 send POST /v1/asr without a model header; 0.5.0 (node version 1.2) is the first to send transcribe-1-pro. --- developer-guide/integrations/n8n.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer-guide/integrations/n8n.mdx b/developer-guide/integrations/n8n.mdx index 7757fd70..9778d36c 100644 --- a/developer-guide/integrations/n8n.mdx +++ b/developer-guide/integrations/n8n.mdx @@ -43,7 +43,7 @@ On n8n Cloud, an instance owner or admin opens the nodes panel, searches for **F The node supports: - **Text-to-Speech**: Generate audio from text using any voice model. Choose the model: from package 0.6.0 (node version 1.3), new nodes use `s3-pro`, and `s3-pro-free` and `drama-3` are also in the list. Nodes already in your workflows keep their model when you upgrade from 0.5.x to 0.6.0. Before 0.5.0 the node had a single version, so a node saved with no model chosen follows the package: it sent `s1` on 0.3.1 and sends `s2-pro` from 0.4.0 on. Under **Additional Options**, **Language** sets the language used to read out numbers, dates, units and symbols while **Normalize Text** is on; see [Supported normalization languages](/features/text-to-speech#supported-normalization-languages). -- **Speech-to-Text**: Transcribe audio files. New nodes use `transcribe-1-pro`; from package 0.6.0, `transcribe-2-pro` is also in the list. +- **Speech-to-Text**: Transcribe audio files. New nodes use `transcribe-1-pro` from package 0.5.0 (node version 1.2); on 0.4.0 and earlier the node sends no model, so requests run on `transcribe-1`. From package 0.6.0, `transcribe-2-pro` is also in the list. - **Voice Models**: List, get, create, and delete custom voices - **Account**: Check credit balance From b552a5511556beb2a46d079658e19b10ed33c722 Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 14:34:48 -0800 Subject: [PATCH 12/13] docs: precise version boundaries for the S1 migration, latency low and errors - S1 migration: fish-audio 0.1.0's Backends type has no s3-pro, so pass "s3-pro" as Backends there (checked with tsc); 0.4.0 recommended. Legacy fish_audio_sdk.Session sent no model header up to 2025.1.8 and speech-1.5 from 2025.2.11 (read from the PyPI files). - latency "low": TTSConfig and LatencyMode accept it from 1.8.1; in 1.8.0 a direct latency="low" argument is already sent. - Changelog: asr.transcribe() also warns for transcribe-1 set through additional_headers; silent only when neither is set. - API skill: a 422 errors array holds up to 20 entries; in can be header as well as query or body. - SDK skill: the methods take Model | str; Model is only the literals. --- .mintlify/skills/fish-audio-api/SKILL.md | 4 ++-- .mintlify/skills/fish-audio-sdk/SKILL.md | 2 +- developer-guide/getting-started/changelog.mdx | 2 +- developer-guide/models-pricing/migrate-from-s1.mdx | 5 +++-- features/text-to-speech.mdx | 2 +- features/text-to-speech/realtime.mdx | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.mintlify/skills/fish-audio-api/SKILL.md b/.mintlify/skills/fish-audio-api/SKILL.md index 1227edfc..3aa91bec 100644 --- a/.mintlify/skills/fish-audio-api/SKILL.md +++ b/.mintlify/skills/fish-audio-api/SKILL.md @@ -20,7 +20,7 @@ This file condenses those into rules an agent can apply directly. - Optional distributed tracing for inference APIs: see `https://docs.fish.audio/api-reference/observability`. - Get API keys: `https://fish.audio/app/api-keys` - Never hardcode keys. Read from an env var like `FISH_API_KEY`. -- Errors are JSON with at least `{status, message}` (for example 401 / 402 / 404 / 429). Speech-to-text errors from `transcribe-1-pro` and `transcribe-2-pro` also carry `code` and `request_id`. Errors from the network edge in front of the API (some 413 and 5xx responses) may not be JSON. `422` validation errors, on the endpoints that return them, add an `errors` array of `{field, in, code, message}` to `status` and `message`. +- Errors are JSON with at least `{status, message}` (for example 401 / 402 / 404 / 429). Speech-to-text errors from `transcribe-1-pro` and `transcribe-2-pro` also carry `code` and `request_id`. Errors from the network edge in front of the API (some 413 and 5xx responses) may not be JSON. `422` validation errors, on the endpoints that return them, add an `errors` array (up to 20 entries) of `{field, in, code, message}` to `status` and `message`. ## Endpoint map @@ -639,7 +639,7 @@ S2-Pro and the S2.1-Pro models use free-form `[bracket]` natural-language tags i - 402 → out of credit. Check `/wallet/self/api-credit`. - 404 → bad `model/{id}` (voice model doesn't exist or isn't visible to you). - 400 on `POST /v1/tts` → also invalid parameters; `message` names the problem. Seen: an unknown `format` or `latency`, a value out of range (`top_p`, `chunk_length`, `prosody.speed`, `mp3_bitrate`), `references` that are not valid audio (send them as msgpack), a `reference_id` that doesn't exist (`Reference not found`). -- 422 → field validation on other endpoints, for example `GET /model?page_size=0` or `POST /model` without `title`; the response's `errors` array names each invalid field (`field`, `in`: `query` or `body`, `code`, `message`). +- 422 → field validation on other endpoints, for example `GET /model?page_size=0` or `POST /model` without `title`; the response's `errors` array lists up to 20 invalid fields, each with `field`, `in` (where it was sent, such as `query`, `body` or `header`), `code` and `message`; `message` summarizes the first one and counts the rest. - WebSocket: a `finish` event with `reason: "error"` means the server failed mid-stream. Surface the message and reconnect rather than retrying on the same socket. - `POST /v1/asr` (`transcribe-1-pro`, `transcribe-2-pro`): branch on the HTTP status and on `code`, never on `message`. New `code` values may be added; handle unknown codes by HTTP status. With `transcribe-1`, rely only on `status` and `message`. - 400 → fix the request; do not retry. Codes: `invalid_request` (unreadable body, missing or repeated `audio`), `invalid_parameter` (bad or conflicting field values), `invalid_audio` (undecodable or unsupported format), `audio_too_long` (over 60 minutes), `audio_too_short` (under about 0.08 s). diff --git a/.mintlify/skills/fish-audio-sdk/SKILL.md b/.mintlify/skills/fish-audio-sdk/SKILL.md index c1438b8e..a8a6d203 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`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: it is the default only in the current SDK releases (`fish-audio-sdk` 1.8.0+, `fish-audio` 0.4.0+); older versions default to other models, some to `s1` (table: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`). 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 `s3-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK's `Model` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no `# type: ignore` is needed. The JS SDK's `Backends` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no cast is needed. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. +- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: it is the default only in the current SDK releases (`fish-audio-sdk` 1.8.0+, `fish-audio` 0.4.0+); older versions default to other models, some to `s1` (table: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`). 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 `s3-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK's `Model` type is the literals `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free`; the TTS methods take `model: Model | str`, so passing any other string needs no `# type: ignore` (a variable annotated `Model` still only takes the listed literals). The JS SDK's `Backends` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no cast is needed. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. - **ASR models:** use `transcribe-2-pro` (recommended: speaker turns, long recordings, emotion cues, plus key terms and written or spoken numbers through the API); `transcribe-1-pro` is the previous Pro model. The model is selected by the `model` HTTP header: in JS pass `model: "transcribe-2-pro"` in the `convert()` request (`fish-audio` 0.2.0+), in Python send the header with `RequestOptions(additional_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). - **`transcribe-2-pro`:** another ASR model, selected the same way as `transcribe-1-pro` with the header value `transcribe-2-pro`. It returns the same response format; its `text_format`, `verbatim`, and `keyterms` fields need raw HTTP (see the `fish-audio-api` skill). - **Audio formats:** `mp3` (default), `wav`, `pcm`, `opus`. diff --git a/developer-guide/getting-started/changelog.mdx b/developer-guide/getting-started/changelog.mdx index 81a4a58f..fa55b1ee 100644 --- a/developer-guide/getting-started/changelog.mdx +++ b/developer-guide/getting-started/changelog.mdx @@ -61,7 +61,7 @@ rss: true ## Python SDK 1.8: S3 Pro by default - `fish-audio-sdk` 1.8.0 changes the default text-to-speech model from `s2.1-pro` to `s3-pro`, and 1.8.1 accepts `latency="low"` in `TTSConfig`, which gives earlier first audio on `s3-pro`. Passing `model="s1"` or `model="transcribe-1"`, both retiring on December 31, 2026, emits a `FutureWarning`. `asr.transcribe()` without a `model` sends no model header and runs on `transcribe-1` without a warning, so pass `model="transcribe-2-pro"`; see [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). Response headers, such as `x-fish-trace-id`, are on `APIError` and on the streams of `tts.stream()`, `tts.stream_with_timestamps()`, and `asr.stream_websocket()`, and the results of `tts.convert_with_timestamps()` and `asr.transcribe()`; `tts.convert()` returns only the audio, so use `tts.stream()` when you need them. `WebSocketOptions` takes extra handshake headers. An HTTP error response whose body is not a JSON object or not valid UTF-8, as a proxy may send, now raises `APIError` or one of its subclasses instead of an unrelated exception. Since 1.7.0, the SDK sends `User-Agent: fish-audio-python/`. + `fish-audio-sdk` 1.8.0 changes the default text-to-speech model from `s2.1-pro` to `s3-pro`, and 1.8.1 accepts `latency="low"` in `TTSConfig`, which gives earlier first audio on `s3-pro`. Passing `model="s1"` or `model="transcribe-1"`, both retiring on December 31, 2026, emits a `FutureWarning`. `asr.transcribe()` also warns when `transcribe-1` comes from a `model` header in `RequestOptions(additional_headers=...)`. When neither the argument nor the header is set, it sends no model header and runs on `transcribe-1` without a warning, so pass `model="transcribe-2-pro"`; see [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). Response headers, such as `x-fish-trace-id`, are on `APIError` and on the streams of `tts.stream()`, `tts.stream_with_timestamps()`, and `asr.stream_websocket()`, and the results of `tts.convert_with_timestamps()` and `asr.transcribe()`; `tts.convert()` returns only the audio, so use `tts.stream()` when you need them. `WebSocketOptions` takes extra handshake headers. An HTTP error response whose body is not a JSON object or not valid UTF-8, as a proxy may send, now raises `APIError` or one of its subclasses instead of an unrelated exception. Since 1.7.0, the SDK sends `User-Agent: fish-audio-python/`. [Errors & Retries](/developer-guide/sdk-guide/python/errors) | [Release notes](https://github.com/fishaudio/fish-audio-python/releases/tag/fish-audio-sdk-v1.8.1) diff --git a/developer-guide/models-pricing/migrate-from-s1.mdx b/developer-guide/models-pricing/migrate-from-s1.mdx index 0ae5a17d..74d837a1 100644 --- a/developer-guide/models-pricing/migrate-from-s1.mdx +++ b/developer-guide/models-pricing/migrate-from-s1.mdx @@ -33,7 +33,7 @@ The steps below cover each of these changes. In the API, you select the model with the `model` request header. Change `s1` to `s3-pro` wherever you set the model, including SDK and integration settings. -If you call an SDK without passing a model, the SDK version decides which model your requests use. Look up your version in the table below: where it says `s1`, your requests use S1 although your code never names it. Upgrade the SDK, or pass `s3-pro` explicitly. For the JavaScript SDK, check the [upgrade notes](/api-reference/sdk/javascript/api-reference#upgrade-notes) for other breaking changes first. +If you call an SDK without passing a model, the SDK version decides which model your requests use. Look up your version in the table below: where it says `s1`, your requests use S1 although your code never names it. Upgrade the SDK, or pass `s3-pro` explicitly. For the JavaScript SDK, upgrading to `fish-audio` 0.4.0 is recommended; check the [upgrade notes](/api-reference/sdk/javascript/api-reference#upgrade-notes) for breaking changes first. If you stay on `fish-audio` 0.1.0 or earlier, its `Backends` type does not list `s3-pro`, so TypeScript rejects the plain string: pass `"s3-pro" as Backends`. ### Default model by SDK version @@ -45,7 +45,8 @@ The model each published SDK version sends when you don't pass one: | | 1.3.0 | `s2-pro` | | | 1.4.0 to 1.7.0 | `s2.1-pro` | | | 1.8.0 and later | `s3-pro` | -| Python, legacy `fish_audio_sdk.Session` (in the same package) | all versions | `speech-1.5` (deprecated) | +| Python, legacy `fish_audio_sdk.Session` (in the same package) | 0.1.0 to 2025.1.8 | no `model` header: the API's default applies | +| | 2025.2.11 and later, including every 1.x release | `speech-1.5` (deprecated) | | JavaScript (`fish-audio`) | 0.0.1 to 0.1.0 | `s1` | | | 0.2.0 and 0.3.0 | `s2.1-pro` | | | 0.4.0 and later | `s3-pro` | diff --git a/features/text-to-speech.mdx b/features/text-to-speech.mdx index e99b5412..d7bb8415 100644 --- a/features/text-to-speech.mdx +++ b/features/text-to-speech.mdx @@ -275,7 +275,7 @@ audio = client.tts.convert( - `latency="balanced"` (default): lower time-to-first-audio. Good for interactive use. For the measured time to first audio on `s3-pro` with `balanced` and `low`, see [S3 Pro benchmarks](/developer-guide/models-pricing/models/s3-pro#benchmarks). - `latency="normal"`: most stable output, at slightly higher latency. -- `latency="low"`: lowest latency. Send it in the API request body, with the JavaScript SDK, or with the Python SDK (`fish-audio-sdk` 1.8.1 and later). `latency: "low"` is not available on `s3-pro-free`. +- `latency="low"`: lowest latency. Send it in the API request body, with the JavaScript SDK, or with the Python SDK: `TTSConfig(latency="low")` and the `LatencyMode` type accept it from `fish-audio-sdk` 1.8.1; in 1.8.0, `latency="low"` passed directly to a method is already sent, while `TTSConfig` rejects it. `latency: "low"` is not available on `s3-pro-free`. - `chunk_length` (`100`–`300`): smaller chunks start audio sooner; larger chunks are more efficient for long text. The API default is `300`; the Python SDK's `TTSConfig` sends `200` unless you set it. On `s3-pro`, chunking is managed automatically by the service. diff --git a/features/text-to-speech/realtime.mdx b/features/text-to-speech/realtime.mdx index ee9c9dc5..e89015be 100644 --- a/features/text-to-speech/realtime.mdx +++ b/features/text-to-speech/realtime.mdx @@ -161,7 +161,7 @@ Both streaming paths take a `latency` mode: - `latency="balanced"` (default): low time-to-first-audio. Use it for voice agents and live LLM output. - `latency="normal"`: slightly higher latency, best audio quality. Use it for narration where you can afford a beat. -- `"latency": "low"`: lowest latency, in the API request body, with the JavaScript SDK, or with the Python SDK (`fish-audio-sdk` 1.8.1 and later). `latency: "low"` is not available on `s3-pro-free`. +- `"latency": "low"`: lowest latency, in the API request body, with the JavaScript SDK, or with the Python SDK: `TTSConfig(latency="low")` and the `LatencyMode` type accept it from `fish-audio-sdk` 1.8.1; in 1.8.0, `latency="low"` passed directly to a method is already sent, while `TTSConfig` rejects it. `latency: "low"` is not available on `s3-pro-free`. ```python for chunk in client.tts.stream_websocket(llm_tokens(), latency="balanced"): From 458498bdd4e1601071e288a71f6b74e82cbe1cec Mon Sep 17 00:00:00 2001 From: Felix Lu <58391009+lumpinif@users.noreply.github.com> Date: Wed, 2 Dec 2026 17:43:40 -0800 Subject: [PATCH 13/13] docs: scope the 422 shape, cast advice, SDK defaults and ffplay prerequisite --- .mintlify/skills/fish-audio-api/SKILL.md | 2 +- .mintlify/skills/fish-audio-sdk/SKILL.md | 2 +- .mintlify/skills/fish-audio-sdk/references/text-to-speech.md | 2 +- .mintlify/skills/fish-audio-sdk/references/websocket.md | 2 +- developer-guide/sdk-guide/quickstart.mdx | 4 +++- features/text-to-speech.mdx | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.mintlify/skills/fish-audio-api/SKILL.md b/.mintlify/skills/fish-audio-api/SKILL.md index 3aa91bec..fbab66b0 100644 --- a/.mintlify/skills/fish-audio-api/SKILL.md +++ b/.mintlify/skills/fish-audio-api/SKILL.md @@ -20,7 +20,7 @@ This file condenses those into rules an agent can apply directly. - Optional distributed tracing for inference APIs: see `https://docs.fish.audio/api-reference/observability`. - Get API keys: `https://fish.audio/app/api-keys` - Never hardcode keys. Read from an env var like `FISH_API_KEY`. -- Errors are JSON with at least `{status, message}` (for example 401 / 402 / 404 / 429). Speech-to-text errors from `transcribe-1-pro` and `transcribe-2-pro` also carry `code` and `request_id`. Errors from the network edge in front of the API (some 413 and 5xx responses) may not be JSON. `422` validation errors, on the endpoints that return them, add an `errors` array (up to 20 entries) of `{field, in, code, message}` to `status` and `message`. +- Errors are JSON with at least `{status, message}` (for example 401 / 402 / 404 / 429). Speech-to-text errors from `transcribe-1-pro` and `transcribe-2-pro` also carry `code` and `request_id`. Errors from the network edge in front of the API (some 413 and 5xx responses) may not be JSON. `422` validation errors from the endpoints in this skill add an `errors` array (up to 20 entries) of `{field, in, code, message}` to `status` and `message`. The Voice Agents API (`/v1/agent/*`) is different: its `422` body is a top-level array of `{type, loc, msg}` entries; see `https://docs.fish.audio/api-reference/agent-errors`. ## Endpoint map diff --git a/.mintlify/skills/fish-audio-sdk/SKILL.md b/.mintlify/skills/fish-audio-sdk/SKILL.md index a8a6d203..b7da8136 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`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: it is the default only in the current SDK releases (`fish-audio-sdk` 1.8.0+, `fish-audio` 0.4.0+); older versions default to other models, some to `s1` (table: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`). 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 `s3-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK's `Model` type is the literals `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free`; the TTS methods take `model: Model | str`, so passing any other string needs no `# type: ignore` (a variable annotated `Model` still only takes the listed literals). The JS SDK's `Backends` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string, so no cast is needed. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. +- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro` (recommended), and `s3-pro-free` (the same model at $0 under fair-use limits, for testing and prototyping). Pass `s3-pro` explicitly: it is the default only in the current SDK releases (the `fishaudio` client in `fish-audio-sdk` 1.8.0+, `fish-audio` 0.4.0+; the legacy `fish_audio_sdk.Session` sends `speech-1.5`); older versions default to other models, some to `s1` (table: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`). 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 `s3-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). The Python SDK's `Model` type is the literals `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free`; the TTS methods take `model: Model | str`, so passing any other string needs no `# type: ignore` (a variable annotated `Model` still only takes the listed literals). The JS SDK's `Backends` type names `s1`, `s2-pro`, `s2.1-pro`, `s2.1-pro-free`, `drama-3`, `s3-pro` and `s3-pro-free` and accepts any other string from `fish-audio` 0.4.0, so no cast is needed there; on 0.1.0 and earlier `"s3-pro"` needs `as Backends`. `speech-1.5` / `speech-1.6` are **deprecated**. In Python pass `model="s3-pro"` (keyword); in JS pass `"s3-pro"` as the **positional** `backend` argument. - **ASR models:** use `transcribe-2-pro` (recommended: speaker turns, long recordings, emotion cues, plus key terms and written or spoken numbers through the API); `transcribe-1-pro` is the previous Pro model. The model is selected by the `model` HTTP header: in JS pass `model: "transcribe-2-pro"` in the `convert()` request (`fish-audio` 0.2.0+), in Python send the header with `RequestOptions(additional_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). - **`transcribe-2-pro`:** another ASR model, selected the same way as `transcribe-1-pro` with the header value `transcribe-2-pro`. It returns the same response format; its `text_format`, `verbatim`, and `keyterms` fields need raw HTTP (see the `fish-audio-api` skill). - **Audio formats:** `mp3` (default), `wav`, `pcm`, `opus`. 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 37317670..b6ac1f91 100644 --- a/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md +++ b/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md @@ -132,7 +132,7 @@ await writeFile("out.mp3", audio2); `TTSRequest` (the first argument) fields: `text` (required), `reference_id?` (a voice ID, or an array of IDs for multi-speaker text with `<|speaker:N|>` tags, on `s3-pro`, the S2 models, and `drama-3`), `references?`, `format?`, `latency?` (`"low" | "normal" | "balanced"`), `prosody?: { speed?; volume?; normalize_loudness? }`, `temperature?`, `top_p?`, `chunk_length?`, `mp3_bitrate?`, `opus_bitrate?` (bits per second: `-1000 | 24000 | 32000 | 48000 | 64000`), `sample_rate?`, `normalize?`, plus the advanced generation knobs (`max_new_tokens`, `repetition_penalty`, `min_chunk_length`, `condition_on_previous_chunks`, `early_stop_threshold`, `features`). Field names are `snake_case`, matching the API. -> The JS `Backends` type (`fish-audio` 0.4.0) is `'s1' | 's2-pro' | 's2.1-pro' | 's2.1-pro-free' | 'drama-3' | 's3-pro' | 's3-pro-free'` plus any other string, so do not cast. Prefer `s3-pro`, the recommended model. Do not choose `s1`. Code written for 0.1.0 may still have `as Backends` casts; they are harmless but unnecessary. +> The JS `Backends` type (`fish-audio` 0.4.0) is `'s1' | 's2-pro' | 's2.1-pro' | 's2.1-pro-free' | 'drama-3' | 's3-pro' | 's3-pro-free'` plus any other string, so do not cast. Prefer `s3-pro`, the recommended model. Do not choose `s1`. On 0.1.0 and earlier the type has no `s3-pro`, so `"s3-pro"` needs `as Backends` there; after upgrading to 0.4.0, such casts are harmless but unnecessary. ## Model & expression notes diff --git a/.mintlify/skills/fish-audio-sdk/references/websocket.md b/.mintlify/skills/fish-audio-sdk/references/websocket.md index c47c72ab..d422bb98 100644 --- a/.mintlify/skills/fish-audio-sdk/references/websocket.md +++ b/.mintlify/skills/fish-audio-sdk/references/websocket.md @@ -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 `"s3-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 `"s3-pro"` from `fish-audio-sdk` 1.8.0; `"s2.1-pro"` in 1.7.x, see `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version`), 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/developer-guide/sdk-guide/quickstart.mdx b/developer-guide/sdk-guide/quickstart.mdx index 1b7fbf71..1ee4a4d4 100644 --- a/developer-guide/sdk-guide/quickstart.mdx +++ b/developer-guide/sdk-guide/quickstart.mdx @@ -36,6 +36,8 @@ npm install fish-audio ``` +The JavaScript example plays the audio with `play()`, which runs `ffplay`, so install [ffmpeg](https://ffmpeg.org/) first; without it, `play()` throws `ffplay from ffmpeg not found`. + ## 2. Authenticate @@ -68,7 +70,7 @@ await play(audio); ``` -Run it, and you'll have `output.mp3` (Python) or local playback (JavaScript). The JavaScript `play()` runs `ffplay`, so it needs [ffmpeg](https://ffmpeg.org/) installed; without it, `play()` throws `ffplay from ffmpeg not found`. +Run it, and you'll have `output.mp3` (Python) or local playback (JavaScript). Want async in Python? Every method mirrors onto `AsyncFishAudio`: `async with diff --git a/features/text-to-speech.mdx b/features/text-to-speech.mdx index d7bb8415..14b73d68 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 `s3-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 current Python, JavaScript and Go SDKs default to `s3-pro`; earlier versions default to other models, see [Default model by SDK version](/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version). See [Models Overview](/developer-guide/models-pricing/models-overview). +In the API, select with the `model` request header; requests without it use `s2.1-pro`. The current Python SDK client (`fishaudio`), JavaScript SDK and Go SDK default to `s3-pro`; the legacy Python `fish_audio_sdk.Session` sends `speech-1.5`, and earlier SDK versions default to other models, see [Default model by SDK version](/developer-guide/models-pricing/migrate-from-s1#default-model-by-sdk-version). See [Models Overview](/developer-guide/models-pricing/models-overview). ### Output formats