Skip to content
Draft
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
49 changes: 32 additions & 17 deletions .mintlify/skills/fish-audio-api/SKILL.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .mintlify/skills/fish-audio-sdk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
- **Base URL:** `https://api.fish.audio` (override with `base_url=` in Python / `baseUrl:` in JS).
- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro` (recommended for production), and `s2.1-pro-free` (free tier). Do not choose `s1` for new code: S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro` (migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`). 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="s2.1-pro"` (keyword); in JS pass the **positional** `backend` argument.
- **ASR models:** use `transcribe-1-pro` (recommended: speaker turns, long recordings, emotion cues). It is selected by the `model` HTTP header: in JS pass `model: "transcribe-1-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 @@ -80,7 +81,7 @@

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

Check warning on line 84 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 @@ -106,7 +107,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="s2.1-pro"` keyword arg | positional `backend` arg, e.g. `convert(req, "s2-pro")` |

Check warning on line 110 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 110 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 Down
19 changes: 10 additions & 9 deletions .mintlify/skills/fish-audio-sdk/references/speech-to-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
## Choose a model

- `transcribe-1-pro` (recommended): recordings up to 60 minutes, including multi-speaker conversations. `text` contains inline `<|speaker:N|>` markers and bracketed emotion or vocal-event cues such as `[laughter]` or `[高兴]`, and the API returns structured `speaker_turns` when you request timestamps.
- `transcribe-2-pro`: the same kinds of recordings and the same response format as `transcribe-1-pro`, plus the request fields `text_format` (written or spoken numbers), `verbatim`, and `keyterms`, and the `language` hint is passed to the model. Neither SDK can send those three fields; call the API directly (see the `fish-audio-api` skill).
- `transcribe-1`: general transcription of short recordings. It serves every request whose `model` header is missing or not an exact match.

Select `transcribe-1-pro` with the `model` header:
Select `transcribe-1-pro` with the `model` header (select `transcribe-2-pro` the same way):

- Python: `request_options=RequestOptions(additional_headers={"model": "transcribe-1-pro"})`, with `from fishaudio.core import RequestOptions`.
- JavaScript: pass `model: "transcribe-1-pro"` in the `convert` request (`fish-audio` 0.2.0+; on 0.1.0, pass `{ headers: { model: "transcribe-1-pro" } }` as the second argument).
- Write the value exactly, in lowercase. A missing or unrecognized value (for example `Transcribe-1-Pro` or `transcribe-1pro`) is served and billed as `transcribe-1`, and no error is returned. If you expected `transcribe-1-pro` but the transcript has no speaker markers and you did not send `diarize=false`, check the header.
- Write the value exactly, in lowercase. A missing or unrecognized value (for example `Transcribe-1-Pro`, `transcribe-1pro`, or `transcribe-2`) is served and billed as `transcribe-1`, and no error is returned. If you expected a Pro model but the transcript has no speaker markers and you did not send `diarize=false`, check the header.

## Python: `client.asr.transcribe`

Expand Down Expand Up @@ -39,12 +40,12 @@

Keyword params:

| Param | Type | Default | Notes |
| -------------------- | ------------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `audio` | `bytes` | — (required) | Raw file bytes; the format is detected from the content. The SDK sends them as MessagePack. |
| `language` | `str` | auto-detect | Optional hint, a lowercase ISO 639-1 code (`"en"`, `"zh"`, `"ja"`). Detection still runs, and the hint does not force the transcript language. `"en-US"` or `"English"` may be rejected with 400. |
| `include_timestamps` | `bool` | `True` | `True` (default) requests word-level timestamps, which adds processing time; pass `False` when you only need text (`segments` is then empty). |
| `request_options` | `RequestOptions \| None` | `None` | Per-request `timeout` and headers. Select the model here: `RequestOptions(additional_headers={"model": "transcribe-1-pro"})`. |
| Param | Type | Default | Notes |
| -------------------- | ------------------------ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `audio` | `bytes` | — (required) | Raw file bytes; the format is detected from the content. The SDK sends them as MessagePack. |
| `language` | `str` | auto-detect | Optional hint, a lowercase ISO 639-1 code (`"en"`, `"zh"`, `"ja"`). Detection still runs, and the hint does not force the transcript language. |
| `include_timestamps` | `bool` | `True` | `True` (default) requests word-level timestamps, which adds processing time; pass `False` when you only need text (`segments` is then empty). |
| `request_options` | `RequestOptions \| None` | `None` | Per-request `timeout` and headers. Select the model here: `RequestOptions(additional_headers={"model": "transcribe-1-pro"})`. |

### Response shape (`ASRResponse`)

Expand All @@ -70,7 +71,7 @@
- `request_id` (`transcribe-1-pro`), also sent as the `x-request-id` header;
- `language` (English name, such as `English`) and `language_code` (ISO 639-1, such as `en`), returned when the language is known.

`asr.transcribe()` cannot send the `transcribe-1-pro` fields `tag_audio_events`, `diarize`, `num_speakers`, `min_speakers`, or `max_speakers`. For any of these, call the API directly. Field semantics are in the `fish-audio-api` skill (`POST /v1/asr`).
`asr.transcribe()` cannot send the Pro model fields `tag_audio_events`, `diarize`, `num_speakers`, `min_speakers`, or `max_speakers`, or the `transcribe-2-pro` fields `text_format`, `verbatim`, or `keyterms`. For any of these, call the API directly. Field semantics are in the `fish-audio-api` skill (`POST /v1/asr`).

```python
import os
Expand Down Expand Up @@ -183,7 +184,7 @@

## JavaScript realtime: `speechToText.convertRealtime`

`client.speechToText.convertRealtime(request, audioStream, requestOptions?)` (`fish-audio` 0.2.0+, **Node.js only**) streams live 16-bit little-endian mono PCM to `transcribe-stream-1` (Preview) over a WebSocket and returns a `RealtimeSTTStream` **synchronously** (no `await`). Iterate it with `for await`; events are narrowed by `type`, and their fields are the protocol's snake_case names. Guide: `https://docs.fish.audio/features/speech-to-text/realtime`.

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

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

'snake_case' looks like code; format it as code.

```ts
import { createReadStream } from "node:fs";
Expand Down Expand Up @@ -219,5 +220,5 @@

- `transcribe-1-pro` accepts recordings up to 60 minutes (longer returns 400 `audio_too_long`). Send long recordings as compressed audio (MP3, Opus, or AAC); 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.
- Processing time grows with the length of the recording, and long `transcribe-1-pro` requests can take several minutes. Raise the SDK timeout for long recordings (the examples use 900 s; the defaults are in [errors](errors.md)), and in Node.js also raise the `fetch` header limit shown above.
- `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. AIFF, CAF, WMA, AMR, AC-3, and raw (headerless) PCM return 400.

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

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Ogg'?

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

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Vorbis'?

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

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'headerless'?
- If you use `transcribe-1`: it is designed for short recordings, up to 50 MiB per request; keep MP3 and Opus files under 25 MiB. For recordings longer than a few minutes, use `transcribe-1-pro`. It accepts WAV, MP3, AAC (including M4A/MP4), FLAC, and Ogg (Opus or Vorbis); convert browser WebM recordings to Ogg/Opus, MP3, or WAV first, or use `transcribe-1-pro`.

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

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Ogg'?

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

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

Vale.Spelling

Did you really mean 'Vorbis'?
Loading
Loading