Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .mintlify/skills/fish-audio-api/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- 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 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

Expand Down Expand Up @@ -51,7 +51,7 @@

Response: streaming audio bytes (`Transfer-Encoding: chunked`) in the format set by `format`. Write to a file or pipe to a player. There is **no JSON wrapper** on success.

### Request body fields (TTSRequest)

Check warning on line 54 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'TTSRequest'?

| Field | Type | Default | Notes |
| --- | --- | --- | --- |
Expand All @@ -70,7 +70,7 @@
| `format` | `wav` \| `pcm` \| `mp3` \| `opus` | `mp3` | Output format. |
| `sample_rate` | int \| null | null (44100, or 48000 for opus) | Output sample rate. |
| `mp3_bitrate` | 64 \| 128 \| 192 | 128 | Only when `format=mp3`. |
| `opus_bitrate` | -1000 \| 24000 \| 32000 \| 48000 \| 64000 | -1000 (auto) | Opus bitrate in **bps**. Only when `format=opus`. |

Check warning on line 73 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'bitrate'?
| `latency` | `low` \| `normal` \| `balanced` | `balanced` | Quality vs latency. |
| `max_new_tokens` | int | 1024 | Per-chunk audio token cap. |
| `repetition_penalty` | number | 1.2 | >1.0 reduces repeats. |
Expand Down Expand Up @@ -232,9 +232,9 @@

Limits and formats:

- `transcribe-1-pro` accepts recordings up to 60 minutes; longer audio returns 400 `audio_too_long`. Send long recordings as compressed audio (MP3, Opus, or AAC); an hour of 128 kbps MP3 is about 55 MiB. A request that is too large returns 413. Send a whole conversation as one file: speaker labels are consistent within one response, not across requests.

Check warning on line 235 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'kbps'?
- Processing time grows with the length of the recording, and long `transcribe-1-pro` requests can take several minutes. Set a generous client timeout (the examples use 15 minutes); many HTTP libraries default to much less (httpx: 5 s). If a long request fails with a 5xx error or the connection drops, retry it.

Check warning on line 236 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'httpx'?
- `transcribe-1-pro` accepts WAV, MP3, AAC (including M4A/MP4), FLAC, Ogg (Opus or Vorbis), WebM/Matroska, and MOV, including browser recordings, and uses the first audio track of a video file; send the original file bytes. AIFF, CAF, WMA, AMR, AC-3, and raw (headerless) PCM return 400.

Check warning on line 237 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Ogg'?

Check warning on line 237 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Vorbis'?

Check warning on line 237 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'headerless'?

Response (200), an illustrative `transcribe-1-pro` response with `ignore_timestamps=false`:

Expand Down Expand Up @@ -376,7 +376,7 @@
- Response: `text`, `duration`, `segments`, and, when the language is known, `language` and `language_code`. Speaker markers, `speaker_turns`, and `request_id` are Pro model features.
- Errors: rely only on `status` and `message`.
- Limits: up to 50 MiB per request; keep MP3 and Opus files under 25 MiB. A request over the size limit returns 413 or 400. For recordings longer than a few minutes, use `transcribe-1-pro`. A long request can fail with 503 when it exceeds the processing-time limit; retry, and if it keeps failing, use `transcribe-1-pro` or split the audio.
- Formats: WAV, MP3, AAC (including M4A/MP4), FLAC, and Ogg (Opus or Vorbis). Convert WebM recordings (for example, from a browser's MediaRecorder) to Ogg/Opus, MP3, or WAV first, or use `transcribe-1-pro`.

Check warning on line 379 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Ogg'?

Check warning on line 379 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Vorbis'?

## Voice Design: `POST /v1/voice-design`

Expand Down Expand Up @@ -483,7 +483,7 @@
### Get / Update / Delete

- `GET /model/{id}` → `ModelEntity`
- `PATCH /model/{id}`: JSON, form-urlencoded, multipart, or msgpack. Nullable fields: `title`, `description`, `cover_image` (binary), `visibility`, `tags`.

Check warning on line 486 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'msgpack'?
- `DELETE /model/{id}` → 200 on success.

```bash
Expand Down Expand Up @@ -638,14 +638,11 @@
- 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`).

Check warning on line 641 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'msgpack'?
- 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).

Check warning on line 645 in .mintlify/skills/fish-audio-api/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'undecodable'?
- 413 → request too large (`request_too_large`). It may come from the network edge without a JSON body. Send compressed audio.
- 415 → unsupported `Content-Type` (`unsupported_media_type`). Use `multipart/form-data` or `application/msgpack`.
- 429 → usually your account is at its concurrency limit, shared by all its API keys; each `/v1/asr` request holds a slot until its response returns. No `Retry-After` header is sent; retry with exponential backoff.
Expand Down
6 changes: 3 additions & 3 deletions .mintlify/skills/fish-audio-sdk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

- **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 (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`.
- **Playback in examples:** `play()` shells out to a system audio tool: Python uses **ffmpeg/ffplay** (or `mpv`), JS uses **ffplay**. It is for local/desktop use; in a server, `save()` to a file or stream the bytes instead. See [references/installation.md](references/installation.md).

Check warning on line 25 in .mintlify/skills/fish-audio-sdk/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'ffplay'?

## Quick start: Python

Expand Down Expand Up @@ -82,7 +82,7 @@

| Task | Reference |
| ------------------------------------------------------------------------- | ------------------------------------------------------------ |
| Install, auth, playback deps, verify a key | [references/installation.md](references/installation.md) |

Check warning on line 85 in .mintlify/skills/fish-audio-sdk/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'deps'?
| Text-to-Speech (convert, stream, formats, prosody, model select) | [references/text-to-speech.md](references/text-to-speech.md) |
| Voice cloning (instant references + persistent voice models) | [references/voice-cloning.md](references/voice-cloning.md) |
| Speech-to-Text (models, timestamps, response fields by SDK version, realtime in JS) | [references/speech-to-text.md](references/speech-to-text.md) |
Expand All @@ -108,7 +108,7 @@
| Update / delete voice | `client.voices.update(id, ...)` / `delete(id)` | `client.voices.update(id, ...)` / `delete(id)` |
| Credit balance | `client.account.get_credits()` | `client.user.get_api_credit()` |
| Subscription package | `client.account.get_package()` | `client.user.get_package()` |
| Choose model | `model="s3-pro"` keyword arg | positional `backend` arg, e.g. `convert(req, "s3-pro")` |

Check warning on line 111 in .mintlify/skills/fish-audio-sdk/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'arg'?

Check warning on line 111 in .mintlify/skills/fish-audio-sdk/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'arg'?
| ASR model (header) | `RequestOptions(additional_headers=...)` | `convert({ audio, model: "transcribe-1-pro" })` |

## Decision shortcuts
Expand All @@ -124,7 +124,7 @@

## 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.

Check warning on line 129 in .mintlify/skills/fish-audio-sdk/SKILL.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'pydantic's'?
- 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).
14 changes: 7 additions & 7 deletions .mintlify/skills/fish-audio-sdk/references/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
| Exception | When | Attributes |
| --------------------- | ---------------------------------------------- | --------------------------------- |
| `APIError` | base for HTTP errors | `.status`, `.message`, `.body` |
| `AuthenticationError` | 401 (bad/missing key) | (APIError) |

Check warning on line 12 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'APIError'?
| `PermissionError` | 403 | (APIError) |

Check warning on line 13 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'APIError'?
| `NotFoundError` | 404 (voice id not found) | (APIError) |
| `NotFoundError` | 404 (e.g. `voices.get()` with an unknown id) | (APIError) |

Check warning on line 14 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'APIError'?
| `RateLimitError` | 429 | (APIError) |

Check warning on line 15 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'APIError'?
| `ServerError` | 5xx | (APIError) |

Check warning on line 16 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'APIError'?
| `WebSocketError` | realtime stream failed | — |
| `DependencyError` | missing system tool (e.g. ffmpeg for `play()`) | `.dependency`, `.install_command` |

Check warning on line 18 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'ffmpeg'?

```python
from fishaudio import FishAudio
Expand All @@ -35,14 +35,14 @@
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)`.

Check warning on line 45 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'pydantic's'?

### Retries & timeouts (Python)

Expand Down Expand Up @@ -76,8 +76,8 @@
});
} 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
Expand All @@ -94,7 +94,7 @@

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

Expand Down Expand Up @@ -128,7 +128,7 @@

## Inspecting raw responses (JS)

Every HTTP method returns an awaitable that also exposes the raw response (the realtime WebSocket methods do not):

Check warning on line 131 in .mintlify/skills/fish-audio-sdk/references/errors.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'awaitable'?

```ts
const { data, rawResponse } = await client.textToSpeech
Expand Down
10 changes: 5 additions & 5 deletions .mintlify/skills/fish-audio-sdk/references/text-to-speech.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
| `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.
Expand All @@ -61,7 +61,7 @@
audio2 = client.tts.convert(text="Second line.", config=config)
```

`TTSConfig` fields (with defaults): `format="mp3"`, `sample_rate=None`, `mp3_bitrate=128` (`64|128|192`), `opus_bitrate=32` (kbps: `-1000|24|32|48|64`, `-1000`=auto), `normalize=True`, `chunk_length=200`, `latency="balanced"`, `reference_id=None`, `references=[]`, `prosody=None`, `top_p=0.7`, `temperature=0.7`, `max_new_tokens=1024`, `repetition_penalty=1.2`, `min_chunk_length=50`, `condition_on_previous_chunks=True`, `early_stop_threshold=1.0`.

Check warning on line 64 in .mintlify/skills/fish-audio-sdk/references/text-to-speech.md

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'kbps'?

### Streaming the HTTP response

Expand Down Expand Up @@ -102,7 +102,7 @@

## JavaScript: `client.textToSpeech`

`convert(request, backend?, requestOptions?)` resolves to a `ReadableStream<Uint8Array>` 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<Uint8Array>` 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";
Expand Down Expand Up @@ -132,9 +132,9 @@

`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`. 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

- `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 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`.
2 changes: 1 addition & 1 deletion .mintlify/skills/fish-audio-sdk/references/websocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` 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:

Expand Down
Loading
Loading