diff --git a/.mintlify/skills/fish-audio-api/SKILL.md b/.mintlify/skills/fish-audio-api/SKILL.md index cfa11fee..e302262d 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` 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, are an array of `{loc, type, msg, ctx, in}`. ## Endpoint map @@ -47,7 +47,7 @@ Required headers: Optional headers: -- `model`: values `s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro`. If omitted or unrecognized, the server falls back to `s2.1-pro`. Default to `s3-pro`, the recommended model. 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`. +- `model`: always send it, and use `s3-pro`, the recommended model. Other values: `drama-3`, `s2.1-pro`, `s2-pro`, and `s1` (deprecated: S1 will be retired on December 31, 2026, and 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 header is optional only for backward compatibility: a request without it, or with a value the API does not recognize, is not rejected but is served and billed as `s2.1-pro`, a legacy model. Do not rely on that. 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. @@ -202,29 +202,33 @@ await pipeline(Readable.fromWeb(res.body), createWriteStream("out.mp3")); Synchronous: one audio file per request, and the JSON response arrives when the whole file has been transcribed. -Use `transcribe-1-pro`, the recommended model, and select it with the `model` header on every request. This section describes `transcribe-1-pro`; for the differences on `transcribe-1`, see "If you use `transcribe-1`" at the end of this section. +Use `transcribe-2-pro`, the recommended model, and select it with the `model` header on every request. It takes the same fields and returns the same response format as `transcribe-1-pro`, which this section describes, and adds `text_format`, `verbatim`, and `keyterms`; see "If you use `transcribe-2-pro`". For the differences on `transcribe-1`, see "If you use `transcribe-1`" at the end of this section. -Guide: `https://docs.fish.audio/features/speech-to-text`. The `/v1/asr` entry in `openapi.json` currently does not list the `transcribe-1-pro` fields, `request_id`, `speaker_turns`, or the error `code`; where it is less complete or disagrees, follow this section. +Guide: `https://docs.fish.audio/features/speech-to-text`. The `/v1/asr` entry in `openapi.json` currently does not list the Pro model fields, `request_id`, `speaker_turns`, or the error `code`; where it is less complete or disagrees, follow this section. Headers: - `Authorization: Bearer ` (required). -- `model: transcribe-1-pro` (recommended): recordings up to 60 minutes, including multi-speaker conversations, with speaker markers, `speaker_turns`, and emotion and vocal-event cues. Write the value exactly, in lowercase. The header is optional, but 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 Pro but `text` has no speaker markers and you did not send `diarize=false`, check the header. `model` is a header only; a `model` form field is ignored. +- `model: transcribe-1-pro`: the previous Pro model. Recordings up to 60 minutes, including multi-speaker conversations, with speaker markers, `speaker_turns`, and emotion and vocal-event cues. Write the value exactly, in lowercase. The header is optional, but 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 Pro but `text` has no speaker markers and you did not send `diarize=false`, check the header. `model` is a header only; a `model` form field is ignored. +- `model: transcribe-2-pro` (recommended): the same kinds of recordings and the same response format as `transcribe-1-pro`, plus `text_format`, `verbatim`, and `keyterms`, and the `language` hint is passed to the model. Write it exactly too: a misspelled value such as `transcribe-2` or `transcribe-2pro` is served and billed as `transcribe-1`, and `text_format`, `verbatim`, and `keyterms` are then ignored. - Body encoding: `multipart/form-data` (let the HTTP client set `Content-Type` and the boundary) or `Content-Type: application/msgpack`. Base64-encoded audio in a JSON body is not supported. Request fields (the same names in multipart and MessagePack): -| Field | Default | Notes | -| ------------------------------ | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `audio` | — (required) | Exactly one audio file: a multipart file part, or MessagePack `bin`. The format is read from the bytes, not the file name. | -| `language` | unset | Optional hint, a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. Detection still runs, and the hint does not force the transcript language. Other forms, such as `en-US` or `English`, may be rejected with 400. | -| `ignore_timestamps` | `true` | `false` returns word-level `segments` and, unless `diarize=false`, `speaker_turns`; it adds processing time. Multipart: any value other than `true` (case-insensitive), including `1` or an empty value, means `false`. MessagePack: a boolean. | -| `tag_audio_events` | `true` | `false` removes bracketed cues such as `[laughter]` or `[高兴]` from `text` and `speaker_turns`. Timestamps, `duration`, and billing do not change. | -| `diarize` | `auto` | `auto` or `true`: return `speaker_turns` when timestamps are requested. `false`: omit `speaker_turns` and the speaker markers in `text`; the rest of the transcript does not change. | -| `num_speakers` | unset | Expected number of speakers, an integer ≥ 1. A best-effort hint that may have no effect on short recordings. Cannot be combined with `min_speakers` or `max_speakers`. | -| `min_speakers`, `max_speakers` | unset | Bounds on the number of speakers, integers ≥ 1, with `min_speakers` ≤ `max_speakers`. Same best-effort rule. | - -Multipart values: `tag_audio_events` is `true` or `false` and `diarize` is `auto`, `true`, or `false` (both case-insensitive); speaker counts are digits. MessagePack values: `tag_audio_events` is a boolean, `diarize` is a boolean or `"auto"`/`"true"`/`"false"`, and speaker counts are integers. An invalid value, `tag_audio_events`, `diarize`, or a speaker count sent twice in a multipart form, or a speaker count with `diarize=false` returns 400 `invalid_parameter`. +| Field | Default | Notes | +| ------------------------------ | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `audio` | — (required) | Exactly one audio file: a multipart file part, or MessagePack `bin`. The format is read from the bytes, not the file name. | +| `language` | unset | Optional hint, a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. Detection still runs, and the hint does not force the transcript language. | +| `ignore_timestamps` | `true` | `false` returns word-level `segments` and, unless `diarize=false`, `speaker_turns`; it adds processing time. Multipart: any value other than `true` (case-insensitive), including `1` or an empty value, means `false`. MessagePack: a boolean. | +| `tag_audio_events` | `true` | `false` removes bracketed cues such as `[laughter]` or `[高兴]` from `text` and `speaker_turns`. Timestamps, `duration`, and billing do not change. | +| `diarize` | `auto` | `auto` or `true`: return `speaker_turns` when timestamps are requested. `false`: omit `speaker_turns` and the speaker markers in `text`; the rest of the transcript does not change. | +| `num_speakers` | unset | Expected number of speakers, an integer ≥ 1. A best-effort hint that may have no effect on short recordings. Cannot be combined with `min_speakers` or `max_speakers`. | +| `min_speakers`, `max_speakers` | unset | Bounds on the number of speakers, integers ≥ 1, with `min_speakers` ≤ `max_speakers`. Same best-effort rule. | +| `text_format` | `written` | `transcribe-2-pro` only. `written`: numbers, dates, times, and amounts in digits and symbols (`3:30`, `20%`). `spoken`: in words, as said (`twenty-five dollars`). | +| `verbatim` | `true` | `transcribe-2-pro` only. `true` keeps filler words, stutters, repetitions, and false starts. `false` leaves out filler sounds, stutters, accidental repetitions, and short false starts; it only removes words, never rewords, and keeps meaningful words and short replies such as `Mm-hmm`. | +| `keyterms` | unset | `transcribe-2-pro` only. Up to 128 words or short phrases for the transcript to spell as listed. Multipart: repeat the field once per term. MessagePack: an array of strings. Rules under "If you use `transcribe-2-pro`". | + +Multipart values: `tag_audio_events` and `verbatim` are `true` or `false`, `diarize` is `auto`, `true`, or `false`, and `text_format` is `written` or `spoken` (all case-insensitive); speaker counts are digits. MessagePack values: `tag_audio_events` and `verbatim` are booleans, `diarize` is a boolean or `"auto"`/`"true"`/`"false"`, `text_format` is `"written"` or `"spoken"`, speaker counts are integers, and `keyterms` is an array of strings. An invalid value, any of these fields except `keyterms` sent twice in a multipart form, or a speaker count with `diarize=false` returns 400 `invalid_parameter`. `transcribe-1-pro` ignores `text_format`, `verbatim`, and `keyterms`. Limits and formats: @@ -353,12 +357,23 @@ for (const turn of result.speaker_turns ?? []) { MessagePack instead of multipart: send `msgpack.packb({"audio": audio_bytes, "ignore_timestamps": False}, use_bin_type=True)` with `Content-Type: application/msgpack` and the same `model: transcribe-1-pro` header; values are typed (booleans, integers), and `audio` must be raw bytes (`bin`). +### If you use `transcribe-2-pro` + +Send `model: transcribe-2-pro`. Everything above applies, including the response, limits, formats, and errors, with these additions: + +- `text_format`, `verbatim`, and `keyterms` (see the fields table) apply to the whole recording and do not change the price. +- `verbatim=false`: the model decides what counts as a filler or a false start, so it can occasionally leave one in or remove a short word that was meant. +- `text_format=spoken` is not always followed when `keyterms` is also sent: numbers can come back in digits. For spoken numbers, send no key terms. +- `keyterms` rules, each a 400 `invalid_parameter` whose `message` names the rule and the term's index (`keyterms[3]`, from 0), never the term: at most 128 terms, repeats counted; each term at most 50 characters and 8 space-separated words after trimming and collapsing whitespace, and not empty; no ASCII comma, none of `\ < > [ ] { }`, no control or invisible formatting characters (tabs, line breaks; U+200C and U+200D are accepted); not starting with `style:`, `format:`, `verbatim:`, `tags:`, `language hint:`, or `glossary:` in any case; a repeated term is used once, but two that differ only in case or width are refused; all the terms together must fit in 1024 tokens: long Chinese or Japanese terms reach that well before 128 terms (at about 32 to 37 terms of 32 characters each), and the refusal then says the terms are too long in total for the 1024-token limit, with the token count; send fewer or shorter terms. List only terms likely to be spoken: an unsaid term can occasionally appear in the transcript. Key terms have been tested on short Chinese, Japanese, and English clips. +- In curl, send each term with `--form-string "keyterms=..."` so a term starting with `@` is not read as a file. +- `language`: the hint is passed to the model and guides the transcription; send it when you know the language. It can be an ISO 639-1 or 639-3 code, an English name, or a locale such as `pt-BR`, in any case. An unrecognized hint (for example `auto`) is ignored, never an error. A recognized hint is reported as the response's `language` and `language_code` (`pt` for `pt-BR`) when the transcript agrees with it (no language detected, the hint's language detected, or, for a language detection cannot identify, the transcript mostly in that language's script); otherwise the detected language is reported (Chinese speech sent `ja` returns `Chinese` / `zh`). A wrong hint can still change the transcript, and one in the same script as the speech is not always caught (English sent `az` can return `Azerbaijani`), so send the language actually spoken. For `bs`, `hr`, and `sr`, `language` is `Bosnian/Croatian/Serbian` and `language_code` is the code sent. + ### If you use `transcribe-1` `transcribe-1` is for general transcription of short recordings, and it serves every request whose `model` header is missing or not an exact match. It differs from `transcribe-1-pro` as follows: -- Fields: send only `audio`, `language`, and `ignore_timestamps`. The other fields apply to `transcribe-1-pro`; send them only with `model: transcribe-1-pro`. -- Response: `text`, `duration`, `segments`, and, when the language is known, `language` and `language_code`. Speaker markers, `speaker_turns`, and `request_id` are `transcribe-1-pro` features. +- Fields: send only `audio`, `language`, and `ignore_timestamps`. The other fields apply to the Pro models; send them only with `model: transcribe-1-pro` or `model: transcribe-2-pro`. +- 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`. @@ -492,7 +507,7 @@ For low-latency / streaming TTS (e.g. LLM token stream → speech). All frames a ### Connection headers - `Authorization: Bearer ` -- `model`: optional; values `s1` (deprecated, retires December 31, 2026, then served by `s2.1-pro`), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro` (falls back to `s2.1-pro` when omitted or unrecognized) +- `model`: send `s3-pro` (recommended). Other values: `drama-3`, `s2.1-pro`, `s2-pro`, `s1` (deprecated, retires December 31, 2026, then served by `s3-pro`). A request without the header, or with an unrecognized value, is served as `s2.1-pro`. ### Event sequence @@ -629,7 +644,7 @@ S2-Pro and the S2.1-Pro models use free-form `[bracket]` natural-language tags i - 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`. - 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`): 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`. +- `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). - 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`. diff --git a/.mintlify/skills/fish-audio-sdk/SKILL.md b/.mintlify/skills/fish-audio-sdk/SKILL.md index 9686360a..d1052063 100644 --- a/.mintlify/skills/fish-audio-sdk/SKILL.md +++ b/.mintlify/skills/fish-audio-sdk/SKILL.md @@ -18,8 +18,9 @@ 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`, and `s3-pro` (recommended). 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 `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). +- **TTS models:** the API supports `s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, and `s3-pro` (recommended). 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. +- **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). @@ -32,7 +33,7 @@ from fishaudio.utils import play, save client = FishAudio() # reads FISH_API_KEY # Generate speech (returns the full audio as bytes) -audio = client.tts.convert(text="Hello from Fish Audio!") +audio = client.tts.convert(text="Hello from Fish Audio!", model="s3-pro") save(audio, "output.mp3") # write to a file # play(audio) # or play locally (needs ffmpeg) @@ -47,7 +48,7 @@ from fishaudio.utils import save async def main(): async with AsyncFishAudio() as client: - audio = await client.tts.convert(text="Hello from Fish Audio!") + audio = await client.tts.convert(text="Hello from Fish Audio!", model="s3-pro") save(audio, "output.mp3") asyncio.run(main()) @@ -61,9 +62,10 @@ import { FishAudioClient, play } from "fish-audio"; const client = new FishAudioClient({ apiKey: process.env.FISH_API_KEY }); // convert() returns audio you can play or pipe to a file -const audio = await client.textToSpeech.convert({ - text: "Hello from Fish Audio!", -}); // defaults to "s2.1-pro" (fish-audio 0.2.0+) +const audio = await client.textToSpeech.convert( + { text: "Hello from Fish Audio!" }, + "s3-pro", // the model is the positional backend argument +); await play(audio); // local playback (needs ffplay) ``` @@ -117,7 +119,7 @@ The two SDKs do **not** use the same names. Use this map when porting code betwe - **Clone a voice instantly from a clip** → pass `references=[ReferenceAudio(audio=..., text=...)]` (Python) / `references: [{ audio, text }]` (JS). See [voice-cloning](references/voice-cloning.md). - **Persistent custom voice to reuse** → create a voice model, then use its `id` as `reference_id`. - **Stream tokens from an LLM and play speech as it arrives** → `tts.stream_websocket` (Python) / `textToSpeech.convertRealtime` (JS). See [websocket](references/websocket.md). -- **Transcribe audio** → `asr.transcribe` (Python) / `speechToText.convert` (JS) with `transcribe-1-pro` selected (recommended; without it, the request runs on `transcribe-1`). Pro request fields, `speaker_turns`, `request_id`, and the language fields need raw HTTP in Python (`fish-audio-sdk` 1.3.0). See [speech-to-text](references/speech-to-text.md). +- **Transcribe audio** → `asr.transcribe` (Python) / `speechToText.convert` (JS) with `transcribe-2-pro` selected (recommended; without it, the request runs on `transcribe-1`). Pro request fields, `speaker_turns`, `request_id`, and the language fields need raw HTTP in Python (`fish-audio-sdk` 1.3.0). See [speech-to-text](references/speech-to-text.md). - **Transcribe live audio turn by turn** → `speechToText.convertRealtime` (JS, Node.js only); see the realtime section of the speech-to-text reference. ## Gotchas (verified against the SDK source) diff --git a/.mintlify/skills/fish-audio-sdk/references/errors.md b/.mintlify/skills/fish-audio-sdk/references/errors.md index fedea063..6ff8d946 100644 --- a/.mintlify/skills/fish-audio-sdk/references/errors.md +++ b/.mintlify/skills/fish-audio-sdk/references/errors.md @@ -116,7 +116,7 @@ All of these extend `FishAudioError`. `err.statusCode` is set when the handshake - Tune per call via `requestOptions` (the trailing argument on every HTTP method; `speechToText.convertRealtime` takes only `abortSignal` and `timeoutInSeconds`, and `textToSpeech.convertRealtime` takes none): ```ts -const audio = await client.textToSpeech.convert({ text: "Hello!" }, "s2-pro", { +const audio = await client.textToSpeech.convert({ text: "Hello!" }, "s3-pro", { maxRetries: 5, timeoutInSeconds: 30, abortSignal: controller.signal, diff --git a/.mintlify/skills/fish-audio-sdk/references/speech-to-text.md b/.mintlify/skills/fish-audio-sdk/references/speech-to-text.md index 0bfee1de..c17a35ed 100644 --- a/.mintlify/skills/fish-audio-sdk/references/speech-to-text.md +++ b/.mintlify/skills/fish-audio-sdk/references/speech-to-text.md @@ -1,17 +1,18 @@ # Speech-to-Text (ASR) -Both SDKs wrap `POST /v1/asr`: one audio file per request, and the response arrives when the whole file has been transcribed. Use `transcribe-1-pro`, the recommended model, selected by the `model` HTTP header on every request. The JS SDK (`fish-audio` 0.2.0+) also streams live audio to `transcribe-stream-1`; see [JavaScript realtime](#javascript-realtime-speechtotextconvertrealtime). Full guide: `https://docs.fish.audio/features/speech-to-text`. +Both SDKs wrap `POST /v1/asr`: one audio file per request, and the response arrives when the whole file has been transcribed. Use `transcribe-2-pro`, the recommended model, selected by the `model` HTTP header on every request. The JS SDK (`fish-audio` 0.2.0+) also streams live audio to `transcribe-stream-1`; see [JavaScript realtime](#javascript-realtime-speechtotextconvertrealtime). Full guide: `https://docs.fish.audio/features/speech-to-text`. ## 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-1-pro`: the previous Pro model. 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` (recommended): 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` @@ -39,12 +40,12 @@ for seg in result.segments: 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`) @@ -70,7 +71,7 @@ Segment text has no punctuation, speaker markers, or cues, and can be normalized - `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 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 a0ca6095..c4446759 100644 --- a/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md +++ b/.mintlify/skills/fish-audio-sdk/references/text-to-speech.md @@ -37,7 +37,7 @@ All keyword-only: | `latency` | `"normal" \| "balanced"` | `"balanced"` | `normal` = higher quality, `balanced` = faster. (No `"low"`.) | | `speed` | `float` | — | Shortcut for prosody speed (0.5–2.0). | | `config` | `TTSConfig` | `TTSConfig()` | Reusable bundle of the settings below. | -| `model` | `"s2.1-pro" \| "s2.1-pro-free" \| "s2-pro" \| "drama-3" \| "s1"` or any `str` | `"s2.1-pro"` | Synthesis model (`fish-audio-sdk` 1.4.0 and later; 1.3.0 and earlier defaulted to `"s2-pro"`). `s1` is deprecated and will be retired on December 31, 2026; after that date, requests that specify `s1` are served by `s2.1-pro`. `speech-1.5` / `speech-1.6` are deprecated. | +| `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. | | `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. @@ -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 `s2.1-pro`. Migration: `https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1`. +- `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`. - 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 456b07c6..ff3a0bde 100644 --- a/.mintlify/skills/fish-audio-sdk/references/websocket.md +++ b/.mintlify/skills/fish-audio-sdk/references/websocket.md @@ -84,7 +84,7 @@ async function* textStream() { const connection = await client.textToSpeech.convertRealtime( { text: "", reference_id: "" }, textStream() - // optional positional backend, e.g. "s2-pro" + // optional positional backend, e.g. "s3-pro" ); const chunks: Buffer[] = []; diff --git a/api-reference/asyncapi-asr-realtime.yml b/api-reference/asyncapi-asr-realtime.yml index 482b2539..76fcbc8f 100644 --- a/api-reference/asyncapi-asr-realtime.yml +++ b/api-reference/asyncapi-asr-realtime.yml @@ -191,6 +191,14 @@ components: $ref: "#/components/schemas/AsrResults" context: $ref: "#/components/schemas/AsrContext" + language_hints: + type: array + items: + type: string + description: | + `transcribe-stream-2` only. The languages you expect in the + session, as language codes such as `en`, so accented speech is + transcribed in the right language. client_reference_id: type: string maxLength: 256 @@ -1197,6 +1205,13 @@ components: and symbols). `null` is the same as leaving it out. `transcribe-stream-1` refuses this field, whatever its value, `null` included, with `invalid_config`. + primary_speaker: + type: boolean + default: false + description: | + `transcribe-stream-2` only. `true` transcribes the person + speaking to your agent and leaves out other voices in the + background. vad_events: type: boolean default: false diff --git a/api-reference/asyncapi.yml b/api-reference/asyncapi.yml index 1cdbcef4..cfc29c45 100644 --- a/api-reference/asyncapi.yml +++ b/api-reference/asyncapi.yml @@ -65,7 +65,7 @@ channels: - s2.1-pro - drama-3 - s3-pro - description: TTS model to use for this session. If omitted or set to an unrecognized value, the session falls back to `s2.1-pro`. Use `s3-pro`, an S2.1-Pro model, or `s2-pro` for multi-speaker dialogue synthesis. `s1` is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. + description: TTS model to use for this session. If omitted or set to an unrecognized value, the session falls back to `s2.1-pro`. Use `s3-pro`, an S2.1-Pro model, or `s2-pro` for multi-speaker dialogue synthesis. `s1` is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s3-pro`. description: | Real-time TTS streaming channel. Clients send text chunks and receive audio chunks concurrently. @@ -103,7 +103,7 @@ channels: - s2.1-pro - drama-3 - s3-pro - description: TTS model to use for this session. If omitted or set to an unrecognized value, the session falls back to `s2.1-pro`. `s1` is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. + description: TTS model to use for this session. If omitted or set to an unrecognized value, the session falls back to `s2.1-pro`. `s1` is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s3-pro`. description: | Real-time TTS streaming channel with word-level timestamps. Clients send text chunks and receive audio chunks with alignment metadata concurrently. diff --git a/api-reference/endpoint/openapi-v1/speech-to-text.mdx b/api-reference/endpoint/openapi-v1/speech-to-text.mdx index 1d687a25..bff0476c 100644 --- a/api-reference/endpoint/openapi-v1/speech-to-text.mdx +++ b/api-reference/endpoint/openapi-v1/speech-to-text.mdx @@ -1,7 +1,7 @@ --- openapi: post /v1/asr title: "Speech to Text" -description: "Transcribe audio with transcribe-1-pro, the recommended speech-to-text model: request and response fields, speaker turns, limits, formats, and errors" +description: "Transcribe audio with transcribe-2-pro, the recommended speech-to-text model, or transcribe-1-pro: request and response fields, speaker turns, text format, verbatim, key terms, limits, formats, and errors" icon: "microphone" iconType: "solid" --- @@ -16,12 +16,13 @@ iconType: "solid" Send `POST https://api.fish.audio/v1/asr` with `Authorization: Bearer ` and a **`model` HTTP header** that selects the model. The request is synchronous: the response arrives when the whole file has been transcribed. -| Header value | Use it for | -| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `transcribe-1-pro` | Recommended. Recordings up to 60 minutes, including multi-speaker conversations: speaker markers and speaker turns, with emotion and vocal-event cues preserved. | -| `transcribe-1` | General transcription of short recordings. Used when the `model` header is missing or not an exact match. | +| Header value | Use it for | +| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `transcribe-2-pro` | Recommended. Recordings up to 60 minutes, with the same speaker markers, speaker turns, and cues as `transcribe-1-pro`. Adds `text_format`, `verbatim`, and `keyterms`, and uses your `language` hint. | +| `transcribe-1-pro` | The previous Pro model. Recordings up to 60 minutes, including multi-speaker conversations: speaker markers and speaker turns, with emotion and vocal-event cues preserved. | +| `transcribe-1` | Deprecated, retiring on December 31, 2026. General transcription of short recordings. Used when the `model` header is missing or not an exact match. | -Send `model: transcribe-1-pro` with every request, written exactly, in lowercase. If the header is missing, or its value is not an exact match (for example `Transcribe-1-Pro` or `transcribe-1pro`), the request 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. This applies to the API playground on this page too: set its `model` header to `transcribe-1-pro`. +`transcribe-1-pro` and `transcribe-2-pro` are the Pro models. Send `model: transcribe-2-pro` (or `model: transcribe-1-pro`) with every request, written exactly, in lowercase. If the header is missing, or its value is not an exact match (for example `Transcribe-1-Pro`, `transcribe-2pro`, or `transcribe-2`), the request is served and billed as `transcribe-1`, and no error is returned; `text_format`, `verbatim`, and `keyterms` are then ignored. If you expected a Pro model but the transcript has no speaker markers and you did not send `diarize=false`, check the header. This applies to the API playground on this page too: set its `model` header to the model you want. The model belongs in the header for both multipart and MessagePack requests; a `model` field in the request body is ignored. See [Limits](#limits) for recording length and request size. @@ -31,34 +32,39 @@ To link the request to your own distributed trace, also send a W3C `traceparent` Multipart and MessagePack bodies use the same field names. Multipart values are text; MessagePack values are typed. -| Field | Required | Default | Description | -| ------------------------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `audio` | Yes | — | Exactly one audio file per request: a file upload for multipart, or binary bytes for MessagePack. The format is detected from the file contents, not the file name. See [Supported audio formats](#supported-audio-formats). | -| `language` | No | Unset | Optional language hint, as a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. The language is detected automatically either way. An empty multipart value counts as unset. See [Language](#language). | -| `ignore_timestamps` | No | `true` | Default `true` (no timestamps). Set to `false` to get word-level `segments` and `speaker_turns`. Timestamps add processing time. | -| `tag_audio_events` | No | `true` | `true`: bracketed emotion and vocal-event cues such as `[laughter]` or `[高兴]` stay in `text` and in `speaker_turns`. `false`: the cues are removed. Timestamps, `duration`, and billing do not change. | -| `diarize` | No | `auto` | `auto` or `true`: return `speaker_turns` when timestamps are requested. `false`: omit `speaker_turns` and the speaker markers in `text`; the rest of the transcript does not change. | -| `num_speakers` | No | Unset | The expected number of speakers, an integer of 1 or more. Cannot be combined with `min_speakers` or `max_speakers`. | -| `min_speakers`, `max_speakers` | No | Unset | Lower and upper bounds on the number of speakers, integers of 1 or more. `min_speakers` must not exceed `max_speakers`. | +| Field | Required | Default | Description | +| ------------------------------ | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `audio` | Yes | — | Exactly one audio file per request: a file upload for multipart, or binary bytes for MessagePack. The format is detected from the file contents, not the file name. See [Supported audio formats](#supported-audio-formats). | +| `language` | No | Unset | Optional language hint, as a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. With `transcribe-1-pro`, the language is detected automatically either way; `transcribe-2-pro` also passes the hint to the model. An empty multipart value counts as unset. See [Language](#language). | +| `ignore_timestamps` | No | `true` | Default `true` (no timestamps). Set to `false` to get word-level `segments` and `speaker_turns`. Timestamps add processing time. | +| `tag_audio_events` | No | `true` | `true`: bracketed emotion and vocal-event cues such as `[laughter]` or `[高兴]` stay in `text` and in `speaker_turns`. `false`: the cues are removed. Timestamps, `duration`, and billing do not change. | +| `diarize` | No | `auto` | `auto` or `true`: return `speaker_turns` when timestamps are requested. `false`: omit `speaker_turns` and the speaker markers in `text`; the rest of the transcript does not change. | +| `num_speakers` | No | Unset | The expected number of speakers, an integer of 1 or more. Cannot be combined with `min_speakers` or `max_speakers`. | +| `min_speakers`, `max_speakers` | No | Unset | Lower and upper bounds on the number of speakers, integers of 1 or more. `min_speakers` must not exceed `max_speakers`. | +| `text_format` | No | `written` | `transcribe-2-pro` only. `written`: numbers, dates, times, and amounts in digits and symbols, such as `3:30` or `20%`. `spoken`: in words, as they were said, such as `twenty-five dollars`. See [Text format](#text-format). | +| `verbatim` | No | `true` | `transcribe-2-pro` only. `true`: filler words, stutters, repetitions, and false starts stay in the transcript. `false`: filler sounds, stutters, accidental repetitions, and short false starts are left out; nothing is reworded. See [Verbatim](#verbatim). | +| `keyterms` | No | Unset | `transcribe-2-pro` only. Up to 128 words or short phrases, such as names and product terms, for the transcript to spell as you list them. In multipart forms, repeat the field once per term. See [Key terms](#key-terms). | In multipart forms, send `true` or `false` for `ignore_timestamps`. Any value other than `true` (case-insensitive), including `1` or an empty value, is read as `false` and turns timestamps on. In MessagePack, send a boolean; a string or `nil` returns 400. Speaker-count hints are applied on a best-effort basis: they guide speaker identification on longer recordings and may have no effect on short ones. They cannot be sent with `diarize=false`. -`tag_audio_events`, `diarize`, and the speaker-count hints are validated strictly: +`tag_audio_events`, `diarize`, the speaker-count hints, `text_format`, `verbatim`, and `keyterms` are validated strictly: -- In multipart forms, `tag_audio_events` takes `true` or `false`, and `diarize` takes `auto`, `true`, or `false`, in any letter case. Speaker counts take digits only. Send each field at most once. -- In MessagePack, send `tag_audio_events` as a boolean, `diarize` as a boolean or one of the lowercase strings `auto`, `true`, or `false`, and speaker counts as integers, not floats or strings. `nil` means the default. -- Any other value, a repeated multipart field, or a conflicting combination returns 400 with code `invalid_parameter`. +- In multipart forms, `tag_audio_events` and `verbatim` take `true` or `false`, `diarize` takes `auto`, `true`, or `false`, and `text_format` takes `written` or `spoken`, in any letter case. Speaker counts take digits only. Send each of these fields at most once. `keyterms` is the exception: send it once per term. +- In MessagePack, send `tag_audio_events` and `verbatim` as booleans, `diarize` as a boolean or one of the lowercase strings `auto`, `true`, or `false`, `text_format` as the string `written` or `spoken`, speaker counts as integers, not floats or strings, and `keyterms` as an array of strings. `nil` means the default; for `keyterms`, `nil` and an empty array mean no key terms. +- Any other value, a repeated multipart field, or a conflicting combination returns 400 with code `invalid_parameter`. So does a key term that breaks the [key term rules](#key-terms). -**If you use `transcribe-1`:** send `audio`, `language`, and `ignore_timestamps`. The other fields apply to `transcribe-1-pro`; send them only with `model: transcribe-1-pro`. +`text_format`, `verbatim`, and `keyterms` apply to `transcribe-2-pro` only. `transcribe-1-pro` ignores them. + +**If you use `transcribe-1`:** send `audio`, `language`, and `ignore_timestamps`. The other fields apply to the Pro models; send them only with `model: transcribe-1-pro` or `model: transcribe-2-pro`. ### Examples ```bash curl --request POST https://api.fish.audio/v1/asr \ --header "Authorization: Bearer $FISH_API_KEY" \ - --header "model: transcribe-1-pro" \ + --header "model: transcribe-2-pro" \ --form audio=@conversation.wav \ --form ignore_timestamps=false ``` @@ -68,50 +74,89 @@ This request returns word-level `segments` and `speaker_turns`. For a two-person ```bash curl --request POST https://api.fish.audio/v1/asr \ --header "Authorization: Bearer $FISH_API_KEY" \ - --header "model: transcribe-1-pro" \ + --header "model: transcribe-2-pro" \ --form audio=@interview.mp3 \ --form ignore_timestamps=false \ --form num_speakers=2 \ --form tag_audio_events=false ``` +With `transcribe-2-pro`, you can also send a language hint and list key terms, one `keyterms` field per term: + +```bash +curl --request POST https://api.fish.audio/v1/asr \ + --header "Authorization: Bearer $FISH_API_KEY" \ + --header "model: transcribe-2-pro" \ + --form audio=@earnings-call.mp3 \ + --form language=en \ + --form-string keyterms=Kubernetes \ + --form-string "keyterms=Fish Audio" +``` + +`--form-string` sends each term as plain text, even one that starts with `@`, which `--form` would read as a file to upload. + Let your HTTP client set the multipart `Content-Type` and boundary. For MessagePack, set `Content-Type: application/msgpack` and encode `audio` as binary bytes. See the [Speech to Text guide](/features/speech-to-text#direct-api-messagepack) for an example. +### Text format + +With `transcribe-2-pro`, `text_format` changes how the model writes numbers, dates, times, and amounts, for the whole recording. `written` (the default) writes them in digits and symbols, such as `3:30` or `20%`; in Chinese transcripts, numbers are usually Arabic digits. `spoken` writes them in words, as they were said, such as `twenty-five dollars`. `spoken` is not always followed when the request also has `keyterms`: numbers, dates, and amounts can then come back in digits and symbols, as with `written`. If you need spoken numbers, send the request without key terms. + +### Verbatim + +With `transcribe-2-pro`, `verbatim` controls filler words and disfluencies, for the whole recording. `true` (the default) keeps filler words, stutters, repetitions, and false starts. `false` leaves out filler sounds, stutters, accidental repetitions, and short false starts. It only removes words, and never rewords or replaces them: meaningful words stay, and so does a short reply such as `Mm-hmm`. The model decides what counts as a filler or a false start, so it can occasionally leave one in or remove a short word that was meant. + +### Key terms + +With `transcribe-2-pro`, send `keyterms` to list words or short phrases that may be spoken in the recording, such as names, products, and technical terms, so the transcript spells them as you list them. List only terms that are likely to occur: a listed term that is never said can occasionally appear in the transcript. Key terms have been tested on short Chinese, Japanese, and English clips. + +- **Encoding:** in multipart forms, repeat the `keyterms` field once per term. In MessagePack, send an array of strings. +- **Count:** at most 128 terms per request, repeated terms included. +- **Length:** each term at most 50 characters and 8 words, counted after leading and trailing whitespace is removed and each run of whitespace inside it is read as one space. Words are separated by spaces, so a Chinese or Japanese term without spaces is one word. An empty term is refused. +- **Characters:** a term cannot contain an ASCII comma (`,`), any of `\ < > [ ] { }`, or control and invisible formatting characters, such as tabs, line breaks, or zero-width spaces. The zero-width non-joiner and joiner (U+200C, U+200D) and full-width punctuation such as `,` and `、` are accepted. +- **Reserved starts:** a term cannot start with `style:`, `format:`, `verbatim:`, `tags:`, `language hint:`, or `glossary:`, in any letter case. +- **Duplicates:** a term listed twice is used once. Two terms that differ only in letter case or character width, such as `ABC` and `ABC`, are refused. +- **Total size:** all the terms together must fit in the model's limit of 1024 tokens. Long Chinese or Japanese terms reach it well before 128 terms, at about 32 to 37 terms of 32 characters each, and so can a few long terms in rare scripts. The error message then says the terms are too long in total for the 1024-token limit and gives the list's token count; send fewer or shorter terms. + +A term that breaks a rule returns 400 with code `invalid_parameter`. The `message` names the rule and the term's position in the request, such as `keyterms[3]`, counted from 0, but never the term itself. Key terms do not change the price. With key terms, `text_format=spoken` is not always followed; see [Text format](#text-format). + +{/* TODO(owner): decide whether key terms are labelled Beta. */} + ## Read the response A successful response (HTTP 200) is a JSON object: -| Field | Description | -| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `text` | The full transcript, with inline speaker markers such as `<\|speaker:0\|>` (none with `diarize=false`) and, unless `tag_audio_events=false`, bracketed emotion and vocal-event cues such as `[高兴]` (happy) or `[laughter]`. See [Multi-speaker response format](#multi-speaker-response-format). | -| `duration` | Length of the audio in seconds, including silence. | -| `segments` | Word-level timestamps: an array of `{ "text", "start", "end" }`, with times in seconds. Empty (`[]`) when `ignore_timestamps=true` (the default), when no speech was found, or when timing is temporarily unavailable. See [Segments](#segments). | -| `speaker_turns` | The transcript as timed speaker turns. Returned when `ignore_timestamps=false` and `diarize` is not `false`; otherwise absent. See [Speaker turns](#speaker-turns). | -| `language` | The detected language's English name, such as `English` or `Chinese`. Omitted when it cannot be determined. Intended for display. | -| `language_code` | Two-letter ISO 639-1 code for the language, such as `en`. Omitted when unknown. If the language cannot be determined and you sent a `language` hint, this reports your hint. See [Language](#language). | -| `request_id` | A unique ID for this request, also present in `transcribe-1-pro` error bodies and in the `x-request-id` response header. Platform and network-edge errors do not carry it. Include it when you contact support. | +| Field | Description | +| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `text` | The full transcript, with inline speaker markers such as `<\|speaker:0\|>` (none with `diarize=false`) and, unless `tag_audio_events=false`, bracketed emotion and vocal-event cues such as `[高兴]` (happy) or `[laughter]`. See [Multi-speaker response format](#multi-speaker-response-format). | +| `duration` | Length of the audio in seconds, including silence. | +| `segments` | Word-level timestamps: an array of `{ "text", "start", "end" }`, with times in seconds. Empty (`[]`) when `ignore_timestamps=true` (the default), when no speech was found, or when timing is temporarily unavailable. See [Segments](#segments). | +| `speaker_turns` | The transcript as timed speaker turns. Returned when `ignore_timestamps=false` and `diarize` is not `false`; otherwise absent. See [Speaker turns](#speaker-turns). | +| `language` | The detected language's English name, such as `English` or `Chinese`. With `transcribe-2-pro`, the language of your `language` hint when the model recognizes it and the transcript agrees with it. Omitted when it cannot be determined. Intended for display. | +| `language_code` | Two-letter ISO 639-1 code for the language, such as `en`. Omitted when unknown. If the language cannot be determined and you sent a `language` hint, this reports your hint. With `transcribe-2-pro`, it reports the language of a hint the model recognizes, such as `pt` for `pt-BR`, when the transcript agrees with it. See [Language](#language). | +| `request_id` | A unique ID for this request, also present in Pro model error bodies and in the `x-request-id` response header. Platform and network-edge errors do not carry it. Include it when you contact support. | A field that is not returned is absent from the JSON, never `null`. Do not depend on the order of keys in the JSON. -**If you use `transcribe-1`:** rely on `text`, `duration`, `segments`, `language`, and `language_code`. Speaker markers, `speaker_turns`, and `request_id` are `transcribe-1-pro` features. +**If you use `transcribe-1`:** rely on `text`, `duration`, `segments`, `language`, and `language_code`. Speaker markers, `speaker_turns`, and `request_id` are features of the Pro models. - Both SDKs select `transcribe-1-pro` through the `model` header. In Python, - pass - `request_options=RequestOptions(additional_headers={"model": "transcribe-1-pro"})` + Both SDKs select the model through the `model` header. In Python, pass + `request_options=RequestOptions(additional_headers={"model": "transcribe-2-pro"})` to `asr.transcribe()`. In JavaScript, pass - `{ headers: { model: "transcribe-1-pro" } }` as the second argument to - `speechToText.convert()`. Neither SDK can send `tag_audio_events`, - `diarize`, or the speaker-count hints. To use them, call the API directly, as - in the examples above. The Python SDK returns the fields listed above - (`fish-audio-sdk` 1.4.0 or later; earlier versions keep only `text`, - `duration`, and `segments`). The JavaScript SDK returns the whole response body, - but its `STTResponse` type declares only `text`, `duration`, and `segments`. + `{ headers: { model: "transcribe-2-pro" } }` as the second argument to + `speechToText.convert()`. Select `transcribe-1-pro` the same way. Neither SDK + can send `tag_audio_events`, `diarize`, the speaker-count hints, + `text_format`, `verbatim`, or `keyterms`. To use them, call the API + directly, as in the examples above. The Python SDK returns the fields listed + above (`fish-audio-sdk` 1.4.0 or later; earlier versions keep only `text`, + `duration`, and `segments`). The JavaScript SDK returns the whole response + body, but its `STTResponse` type declares only `text`, `duration`, and + `segments`. ### Multi-speaker response format -`transcribe-1-pro` marks speaker changes **inside the `text` string** with `<|speaker:N|>` markers. The label `N` identifies the speaker for the text that follows, up to the next marker. A repeated label means that speaker is speaking again. +The Pro models mark speaker changes **inside the `text` string** with `<|speaker:N|>` markers. The label `N` identifies the speaker for the text that follows, up to the next marker. A repeated label means that speaker is speaking again. - Markers usually have a space on each side (`<|speaker:0|> 你好。 <|speaker:1|> ...`). Do not depend on exact spacing. - Any text before the first marker belongs to the first turn. @@ -135,7 +180,7 @@ Read this as speaker 0 saying `你好。`, speaker 1 saying `[高兴]很开心 ### Speaker turns -With `ignore_timestamps=false`, `transcribe-1-pro` also returns the turns as a structured `speaker_turns` array, unless you send `diarize=false`. When you request timestamps, prefer `speaker_turns` over parsing `text`. +With `ignore_timestamps=false`, the Pro models also return the turns as a structured `speaker_turns` array, unless you send `diarize=false`. When you request timestamps, prefer `speaker_turns` over parsing `text`. - `speaker_turns` lists the turns in the order they occur, and is `[]` when no speech was found. Each turn is `{ "speaker": "speaker:N", "text": "...", "start": , "end": }`. - `speaker` is the string `speaker:N`, where `N` matches the `<|speaker:N|>` marker in `text`. Like the markers, labels identify speakers within one response only. @@ -186,22 +231,35 @@ A segment is usually one word; in Chinese and Japanese it is usually one charact ### Language -- `language` is optional. The language is detected automatically whether or not you send a hint, and a hint does not force the transcript into that language. -- Use a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. Other forms, such as `en-US` or `English`, may be rejected with 400. +`language` is optional. Responses report one language: for recordings that switch languages, `language` and `language_code` do not list every language spoken. + +With `transcribe-1-pro`: + +- The language is detected automatically whether or not you send a hint, and a hint does not force the transcript into that language. +- Use a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. - If the language cannot be determined (for example, very short audio), `language_code` reports your hint, which is not checked against the audio, and `language` may be absent. -- Responses report one language. For recordings that switch languages, `language` and `language_code` do not list every language spoken. + +With `transcribe-2-pro`: + +- The hint is passed to the model and guides the transcription. Send it when you know the language of the recording. Without a hint, the response language is detected from the transcript, and for some languages it can be missing or name a related language, such as Hindi for Marathi. +- The hint can be an ISO 639-1 or ISO 639-3 code, an English language name, or a locale such as `pt-BR`, in any letter case. A hint the model does not recognize, such as `auto`, is ignored: the model transcribes without a hint, the response language is detected as with `transcribe-1-pro`, and no error is returned. +- When the model recognizes the hint, `language` and `language_code` report the hint's language, for example `Portuguese` and `pt` for `pt-BR`, if the transcript agrees with it: no language is detected in the transcript, the language detected is the hint's, or, for a language that detection cannot identify, the transcript is mostly in a script that language is written in. Otherwise they report the detected language: Chinese speech sent with `language=ja` returns `Chinese` and `zh`. +- For `bs`, `hr`, and `sr`, `language` is `Bosnian/Croatian/Serbian` and `language_code` is the code you sent. +- Send the language that is actually spoken. A wrong hint can change the transcript, for example the script it is written in, and a wrong hint in the same script as the speech is not always caught: English speech sent with `language=az` can return `Azerbaijani`. + +{/* TODO(owner, D5): once the guide publishes the list of languages transcribe-2-pro recognizes (Language hints with transcribe-2-pro), link it here. Until then this page names no list. */} ## Limits -- **Audio length:** up to 60 minutes per request. Longer audio returns 400 with code `audio_too_long`. +- **Audio length:** up to 60 minutes per request with either Pro model. Longer audio returns 400 with code `audio_too_long`. - **Request size:** for long recordings, send compressed audio such as MP3, Opus, or AAC. An hour of 128 kbps MP3 is about 55 MiB. A request that is too large returns 413. - **One conversation per request:** send the whole recording in one request. Timestamps and speaker labels then cover the whole recording. Do not split a conversation, because labels are consistent only within one response. -**If you use `transcribe-1`:** it is designed for short recordings; for recordings longer than a few minutes, use `transcribe-1-pro`. It accepts up to 50 MiB per request; keep MP3 and Opus files under 25 MiB. A request that exceeds the size limit returns 413 or 400. A long request can fail with 503 if it exceeds the processing-time limit. Retry, and if it keeps failing, use `transcribe-1-pro` or split the audio. +**If you use `transcribe-1`:** it is designed for short recordings; for recordings longer than a few minutes, use `transcribe-2-pro`. It accepts up to 50 MiB per request; keep MP3 and Opus files under 25 MiB. A request that exceeds the size limit returns 413 or 400. A long request can fail with 503 if it exceeds the processing-time limit. Retry, and if it keeps failing, use `transcribe-1-pro` or split the audio. ### Processing time and timeouts -- Processing time grows with the length of the recording. Long `transcribe-1-pro` recordings can take several minutes. +- Processing time grows with the length of the recording. Long recordings can take several minutes on either Pro model. - Set your HTTP client's timeout accordingly. The official SDKs' default timeout can be too short for long recordings, and many HTTP libraries default to even less (httpx defaults to 5 seconds). For long recordings, use a generous timeout, for example 15 minutes: `httpx.Timeout(900.0, connect=10.0)` with httpx, `RequestOptions(timeout=900)` with the Python SDK, or `{ timeoutInSeconds: 900 }` with the JavaScript SDK. - In Node.js, the built-in `fetch`, which the JavaScript SDK uses, also stops waiting for a response after 5 minutes, even if you set a longer timeout. To wait longer, call `setGlobalDispatcher(new Agent({ headersTimeout: 900_000, bodyTimeout: 900_000 }))` from the `undici` package once at startup. See [Processing time and timeouts](/features/speech-to-text#processing-time-and-timeouts). - If a long request fails with a 5xx error or the connection drops, retry it. @@ -209,7 +267,7 @@ A segment is usually one word; in Chinese and Japanese it is usually one charact ## Supported audio formats -- `transcribe-1-pro` accepts WAV, MP3, AAC (including M4A/MP4), FLAC, Ogg (Opus or Vorbis), WebM/Matroska, and MOV, including browser recordings. For a video file, it uses the first audio track. Send the original file bytes; no conversion is needed. +- The Pro models accept WAV, MP3, AAC (including M4A/MP4), FLAC, Ogg (Opus or Vorbis), WebM/Matroska, and MOV, including browser recordings. For a video file, they use the first audio track. Send the original file bytes; no conversion is needed. - Not supported: AIFF, CAF, WMA, AMR, AC-3, and raw (headerless) PCM. These return 400. **If you use `transcribe-1`:** it accepts WAV, MP3, AAC (including M4A/MP4), FLAC, and Ogg (Opus or Vorbis). Browser WebM recordings (for example, from `MediaRecorder`) may not be accepted; convert them to Ogg/Opus, MP3, or WAV first. @@ -218,11 +276,11 @@ A segment is usually one word; in Chinese and Japanese it is usually one charact Error responses have one of these shapes: -- **`transcribe-1-pro` errors** are JSON with `status`, `message`, `code`, and `request_id`. Branch on `code`, not on `message`. +- **Pro model errors**, from `transcribe-1-pro` and `transcribe-2-pro`, are JSON with `status`, `message`, `code`, and `request_id`. Branch on `code`, not on `message`. - **Platform errors**, such as authentication, credit, and concurrency errors, are returned before the request reaches a model. They are JSON with exactly `status` and `message`. - **Errors from the network edge** in front of the API, such as some 413 and 5xx responses, may not have a JSON body. Handle them by HTTP status. -This illustrative `transcribe-1-pro` error body shows the shape: +This illustrative Pro model error body shows the shape: ```json { diff --git a/api-reference/endpoint/openapi-v1/text-to-speech-stream-with-timestamps.mdx b/api-reference/endpoint/openapi-v1/text-to-speech-stream-with-timestamps.mdx index b6777453..ff7dc480 100644 --- a/api-reference/endpoint/openapi-v1/text-to-speech-stream-with-timestamps.mdx +++ b/api-reference/endpoint/openapi-v1/text-to-speech-stream-with-timestamps.mdx @@ -98,7 +98,7 @@ curl --no-buffer --request POST \ --url https://api.fish.audio/v1/tts/stream/with-timestamp \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ - --header 'model: s2-pro' \ + --header 'model: s3-pro' \ --data '{ "text": "Hello! Welcome to Fish Audio.", "reference_id": "model-id", @@ -126,7 +126,7 @@ latest alignment snapshot for `chunk_seq` whenever `alignment` is non-null. headers={ "Authorization": "Bearer ", "Content-Type": "application/json", - "model": "s2-pro", + "model": "s3-pro", }, json={ "text": "Hello! Welcome to Fish Audio.", @@ -168,7 +168,7 @@ latest alignment snapshot for `chunk_seq` whenever `alignment` is non-null. headers: { Authorization: "Bearer ", "Content-Type": "application/json", - model: "s2-pro", + model: "s3-pro", }, body: JSON.stringify({ text: "Hello! Welcome to Fish Audio.", diff --git a/api-reference/endpoint/websocket/asr-realtime.mdx b/api-reference/endpoint/websocket/asr-realtime.mdx index 03c8e7ad..c84400a2 100644 --- a/api-reference/endpoint/websocket/asr-realtime.mdx +++ b/api-reference/endpoint/websocket/asr-realtime.mdx @@ -113,10 +113,12 @@ Audio sent before `session_started` is not lost: once the session has started, t | `results.diarize` | No | `true` | `true`, `false` or `"auto"` (same as `true`); the strings `"true"` and `"false"` are accepted too. `false` removes speaker tags from the text. See [Speakers](#speakers). | | `results.tag_audio_events` | No | `true` | `false` removes sound tags such as `[laughter]` from the text. See [Sound tags](#sound-tags). | | `results.text_format` | No | `"written"` | `transcribe-stream-2` only, set in `config` for the whole session. The style for numbers, amounts and times: `"spoken"` (words) or `"written"` (digits and symbols). `transcribe-stream-1` refuses it with `invalid_config`. | +| `results.primary_speaker` | No | `false` | `transcribe-stream-2` only. `true` transcribes the person speaking to your agent and leaves out other voices in the background. | | `results.vad_events` | No | `false` | `true` sends [`vad`](#vad) messages. | | `results.eot_events` | No | `false` | `true` sends [`eot_prob`](#eot_prob) messages. | | `context.history` | No | `[]` | Earlier conversation, oldest first: up to 32 items of `{ "role": "user" \| "assistant", "text": str }`, each up to 2,000 characters. | | `context.terms` | No | `[]` | Up to 100 terms of up to 32 characters each: names, products and jargon to recognize. | +| `language_hints` | No | Unset | `transcribe-stream-2` only. The languages you expect in the session, as language codes such as `["en"]`, so accented speech is transcribed in the right language. | | `client_reference_id` | No | | Your own ID for the session, up to 256 characters. It is recorded with the session and not sent back. | A value of the wrong type for `ignore_timestamps` or `tag_audio_events` (both take only `true` or `false`), or a `diarize` value other than those listed, is `invalid_config`. So is an unknown field, including a misspelled one; the error's `message` names the field. `invalid_config` closes the connection with 4400. Send only the fields listed here: not every other field is refused, so check `session_started.config`, which shows the settings in effect. diff --git a/api-reference/errors.mdx b/api-reference/errors.mdx index 2e93cbd6..5b157372 100644 --- a/api-reference/errors.mdx +++ b/api-reference/errors.mdx @@ -12,7 +12,7 @@ Fish Audio errors come back as JSON with a `message` and a `status`: (A request whose body can't be parsed returns a plain-text parse error instead.) -Some endpoints add fields. For example, `transcribe-1-pro` speech-to-text errors also include `code` and `request_id`; see [Speech to Text errors](/api-reference/endpoint/openapi-v1/speech-to-text#errors). Errors returned by the network edge in front of the API, such as some `413` or `5xx` responses, may not be JSON. +Some endpoints add fields. For example, `transcribe-1-pro` and `transcribe-2-pro` speech-to-text errors also include `code` and `request_id`; see [Speech to Text errors](/api-reference/endpoint/openapi-v1/speech-to-text#errors). Errors returned by the network edge in front of the API, such as some `413` or `5xx` responses, may not be JSON. ## Status codes diff --git a/api-reference/observability.mdx b/api-reference/observability.mdx index f3208d73..5301aa1d 100644 --- a/api-reference/observability.mdx +++ b/api-reference/observability.mdx @@ -68,7 +68,7 @@ TRACEPARENT="00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01" curl --request POST https://api.fish.audio/v1/tts \ --header "Authorization: Bearer $FISH_API_KEY" \ --header "Content-Type: application/json" \ - --header "model: s2-pro" \ + --header "model: s3-pro" \ --header "traceparent: $TRACEPARENT" \ --data '{ "text": "Hello from a traced Fish Audio request.", @@ -95,7 +95,7 @@ curl --request POST https://api.fish.audio/v1/tts \ headers = { "Authorization": f"Bearer {os.environ['FISH_API_KEY']}", "Content-Type": "application/json", - "model": "s2-pro", + "model": "s3-pro", } inject(headers) @@ -127,7 +127,7 @@ curl --request POST https://api.fish.audio/v1/tts \ const headers = { Authorization: `Bearer ${process.env.FISH_API_KEY}`, "Content-Type": "application/json", - model: "s2-pro", + model: "s3-pro", }; propagation.inject(ctx, headers); @@ -401,7 +401,7 @@ import WebSocket from "ws"; const ws = new WebSocket("wss://api.fish.audio/v1/tts/live", { headers: { Authorization: `Bearer ${process.env.FISH_API_KEY}`, - model: "s2-pro", + model: "s3-pro", traceparent: "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01", }, }); @@ -438,11 +438,12 @@ x-fish-trace-id: 4bf92f3577b34da6a3ce929d0e0e4736 ## Speech-to-Text Request IDs -`transcribe-1-pro` responses from `POST /v1/asr` include a `request_id` field -in the JSON body, on success and on its own error responses, and the same value -in the `x-request-id` response header. Platform errors, such as authentication, -credit, and concurrency errors, and errors from the network edge do not carry -it. Include it when you contact support about a transcription request. See +`transcribe-1-pro` and `transcribe-2-pro` responses from `POST /v1/asr` include +a `request_id` field in the JSON body, on success and on their own error +responses, and the same value in the `x-request-id` response header. Platform +errors, such as authentication, credit, and concurrency errors, and errors from +the network edge do not carry it. Include it when you contact support about a +transcription request. See [Speech to Text](/api-reference/endpoint/openapi-v1/speech-to-text#read-the-response). ## Enterprise Performance Analysis diff --git a/developer-guide/best-practices/emotion-control.mdx b/developer-guide/best-practices/emotion-control.mdx index 7422eabd..61b72f33 100644 --- a/developer-guide/best-practices/emotion-control.mdx +++ b/developer-guide/best-practices/emotion-control.mdx @@ -18,7 +18,7 @@ Control how your AI voice expresses emotions, from happy and excited to sad and The `(parenthesis)` syntax on this page is the legacy syntax for the S1 model. S1 is deprecated and will be retired on December 31, 2026. After that date, - requests that specify `s1` are served by `s2.1-pro`. S2 uses `[bracket]` + requests that specify `s1` are served by `s3-pro`. S3 Pro and S2 use `[bracket]` syntax with natural language descriptions and is not limited to a fixed set of tags. The API does not convert `(parenthesis)` tags to `[bracket]` cues, so rewrite them in S2 syntax. See [Migrate from diff --git a/developer-guide/compat/capabilities.mdx b/developer-guide/compat/capabilities.mdx index ec0b9a8d..d5fdaa80 100644 --- a/developer-guide/compat/capabilities.mdx +++ b/developer-guide/compat/capabilities.mdx @@ -100,7 +100,7 @@ in-band error event): ElevenLabs STT refuses `diarize` and `tag_audio_events`. For speaker turns and event tags, use the native [Speech to Text API](/features/speech-to-text#multi-speaker-conversations) with -`transcribe-1-pro`. +`transcribe-2-pro`. On OpenAI transcription, `languages`, `keywords`, `prompt`, and `temperature` are in the [ignored tier](#how-parameters-are-handled). diff --git a/developer-guide/compat/migrate-from-elevenlabs.mdx b/developer-guide/compat/migrate-from-elevenlabs.mdx index d4a50a9c..5a43edc7 100644 --- a/developer-guide/compat/migrate-from-elevenlabs.mdx +++ b/developer-guide/compat/migrate-from-elevenlabs.mdx @@ -274,7 +274,7 @@ rather than silently ignored: For speaker turns and event tags, use the native [Speech to Text API](/features/speech-to-text#multi-speaker-conversations) with -`transcribe-1-pro` instead. +`transcribe-2-pro` instead. **`tag_audio_events` is the one that bites on migration.** ElevenLabs defaults diff --git a/developer-guide/compat/migrate-from-openai.mdx b/developer-guide/compat/migrate-from-openai.mdx index 51818f85..fe490df0 100644 --- a/developer-guide/compat/migrate-from-openai.mdx +++ b/developer-guide/compat/migrate-from-openai.mdx @@ -191,7 +191,7 @@ Transcription model names carry over the same way: `whisper-1`, `fish-audio/transcribe-1`; an unrecognized name is refused with the same 400. For speaker turns, long recordings, and inline emotion cues, use -`transcribe-1-pro` on the native +`transcribe-2-pro` on the native [Speech to Text API](/features/speech-to-text) instead. diff --git a/developer-guide/compat/migrate-from-openrouter.mdx b/developer-guide/compat/migrate-from-openrouter.mdx index d7ec5774..931d080c 100644 --- a/developer-guide/compat/migrate-from-openrouter.mdx +++ b/developer-guide/compat/migrate-from-openrouter.mdx @@ -188,7 +188,7 @@ For word-level timing, ask for `response_format="verbose_json"` together with `timestamp_granularities=["word"]`. For speaker turns, long recordings, and inline emotion cues, use -`transcribe-1-pro` on the native +`transcribe-2-pro` on the native [Speech to Text API](/features/speech-to-text) instead. ## Model catalog diff --git a/developer-guide/compat/realtime-protocol.mdx b/developer-guide/compat/realtime-protocol.mdx index 33d620cb..b3f3d8c6 100644 --- a/developer-guide/compat/realtime-protocol.mdx +++ b/developer-guide/compat/realtime-protocol.mdx @@ -83,7 +83,7 @@ TTS model. `transcribe-1` will be retired on December 31, 2026. After that date, - transcription sessions are served by `transcribe-1-pro` at the same price, + transcription sessions are served by `transcribe-2-pro`, and you don't need to change the URL. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). diff --git a/developer-guide/core-features/emotions.mdx b/developer-guide/core-features/emotions.mdx index fd9499f4..d169a29e 100644 --- a/developer-guide/core-features/emotions.mdx +++ b/developer-guide/core-features/emotions.mdx @@ -266,7 +266,7 @@ For sentence-level control, cues usually work best at the start of a sentence. F S1 is deprecated and will be retired on December 31, 2026. After that date, - requests that specify `s1` are served by `s2.1-pro`. The API does not convert + requests that specify `s1` are served by `s3-pro`. The API does not convert `(parenthesis)` tags to `[bracket]` cues, so rewrite them in S2 syntax. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). diff --git a/developer-guide/core-features/fine-grained-control/pronunciation-dictionaries.mdx b/developer-guide/core-features/fine-grained-control/pronunciation-dictionaries.mdx index b0a20cb4..2b45f157 100644 --- a/developer-guide/core-features/fine-grained-control/pronunciation-dictionaries.mdx +++ b/developer-guide/core-features/fine-grained-control/pronunciation-dictionaries.mdx @@ -150,7 +150,7 @@ After publishing a dictionary, pass its dictionary ID and version ID in `pronunc curl --request POST https://api.fish.audio/v1/tts \ --header "Authorization: Bearer $FISH_API_KEY" \ --header "Content-Type: application/json" \ - --header "model: s2-pro" \ + --header "model: s3-pro" \ --data '{ "text": "Our Kubernetes service reads SQL.", "reference_id": "YOUR_VOICE_ID", diff --git a/developer-guide/getting-started/changelog.mdx b/developer-guide/getting-started/changelog.mdx index a5e33a19..0d67d71f 100644 --- a/developer-guide/getting-started/changelog.mdx +++ b/developer-guide/getting-started/changelog.mdx @@ -16,6 +16,26 @@ rss: true [Transcribe 2 model card](/developer-guide/models-pricing/models/transcribe-2) | [Pricing](/developer-guide/models-pricing/pricing-and-rate-limits#automatic-speech-recognition-asr-models) + + ## transcribe-1 retirement: requests move to transcribe-2-pro + + `transcribe-1` will still be retired on December 31, 2026. After that date, the requests it serves, including those with no `model` header and those through the compatible endpoints, are served by `transcribe-2-pro` and billed as `transcribe-2-pro`, instead of `transcribe-1-pro` as announced on October 29. `transcribe-2-pro` costs less: \$0.16 / audio hour, against \$0.36 for `transcribe-1`. + + To migrate, send the `model: transcribe-2-pro` header on `POST /v1/asr`. + + [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1) + + + + ## S1 retirement: requests move to S3 Pro + + S1 will still be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s3-pro` and billed as `s3-pro`, at the same list price, instead of `s2.1-pro` as announced on October 8. + + To migrate, switch the model ID to `s3-pro` and convert `(parenthesis)` emotion tags to `[bracket]` tags. + + [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1) + + ## Fish Audio S3 Pro diff --git a/developer-guide/getting-started/migration.mdx b/developer-guide/getting-started/migration.mdx index 87e619c2..8a67168a 100644 --- a/developer-guide/getting-started/migration.mdx +++ b/developer-guide/getting-started/migration.mdx @@ -369,7 +369,7 @@ result (the [ElevenLabs protocol](/developer-guide/compat/migrate-from-elevenlab echoes `language_code` the same way). For speaker turns, long recordings, and inline emotion cues, use -`transcribe-1-pro` on the native +`transcribe-2-pro` on the native [Speech to Text API](/features/speech-to-text). ## Voices diff --git a/developer-guide/integrations/anam.mdx b/developer-guide/integrations/anam.mdx index 30abaf0c..7e648451 100644 --- a/developer-guide/integrations/anam.mdx +++ b/developer-guide/integrations/anam.mdx @@ -151,7 +151,7 @@ Start `avatar.start()` before `session.start()` so speech is routed through Anam | Parameter | Description | | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `fishaudio.STT.model` | Speech recognition model; this example uses [`transcribe-stream-2`](/features/speech-to-text/realtime) (Preview) | +| `fishaudio.STT.model` | Speech recognition model; this example uses [`transcribe-stream-2`](/features/speech-to-text/realtime) | | `fishaudio.TTS.model` | Speech generation model; this example uses [`s3-pro`](/features/text-to-speech) | | `fishaudio.TTS.voice_id` | Defaults to Sarah, female American English (`933563129e564b19a115bedd57b7406a`); override with `FISH_VOICE_ID`. The Fish Audio API calls this `reference_id` | | `anam.AvatarSession.api_key` | Your Anam API key, supplied from `ANAM_API_KEY` | diff --git a/developer-guide/models-pricing/deprecations.mdx b/developer-guide/models-pricing/deprecations.mdx index 6a737eb4..f310de9e 100644 --- a/developer-guide/models-pricing/deprecations.mdx +++ b/developer-guide/models-pricing/deprecations.mdx @@ -27,8 +27,8 @@ Currently available models: - **Voice Design 1** (`voice-design-1`) - Voices from a text description ## Deprecated Models -- **s1** - S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). -- **transcribe-1** - transcribe-1 is deprecated and will be retired on December 31, 2026. After that date, the requests it serves, including those with no `model` header and those through the compatible endpoints, are served by `transcribe-1-pro`. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). +- **s1** - 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). +- **transcribe-1** - transcribe-1 is deprecated and will be retired on December 31, 2026. After that date, the requests it serves, including those with no `model` header and those through the compatible endpoints, are served by `transcribe-2-pro`. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). - **s2.1-pro-free** - The free `s2.1-pro-free` model was taken offline after its free period ended on November 30, 2026. Requests that still send `model: s2.1-pro-free` are served and billed as the default model, so they need API credit and return `402` without it. To try the API without paying, new developer accounts may receive a one-time free API credit. - **speech-1.6** - Fish Speech v1.6 has been deprecated on February, 28th, 2026 - **speech-1.5** - Fish Speech v1.5 has been deprecated on February, 28th, 2026 diff --git a/developer-guide/models-pricing/migrate-from-s1.mdx b/developer-guide/models-pricing/migrate-from-s1.mdx index c8f4a637..cb30f28f 100644 --- a/developer-guide/models-pricing/migrate-from-s1.mdx +++ b/developer-guide/models-pricing/migrate-from-s1.mdx @@ -1,7 +1,7 @@ --- title: "Migrate from S1" sidebarTitle: "Migrate from S1" -description: "Fish Audio S1 will be retired on December 31, 2026. Move your text-to-speech requests from s1 to s2.1-pro." +description: "Fish Audio S1 will be retired on December 31, 2026. Move your text-to-speech requests from s1 to s3-pro." icon: "arrow-right-arrow-left" --- @@ -11,29 +11,29 @@ This guide is for you if your text-to-speech requests set the model to `s1`. ## What is changing -S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. +S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s3-pro`. -We recommend that you switch before then, so you can test your output on your own schedule. This guide moves you to `s2.1-pro`, the model that serves `s1` requests after retirement. For new code, we recommend [S3 Pro](/developer-guide/models-pricing/models/s3-pro) (`s3-pro`), at the same price. S3 Pro also uses `[bracket]` cues, so the tag conversion below applies to it too. +We recommend that you switch before then, so you can test your output on your own schedule. This guide moves you to [S3 Pro](/developer-guide/models-pricing/models/s3-pro) (`s3-pro`), our recommended model and the one that serves `s1` requests after retirement. ## What happens if you do nothing -After December 31, 2026, requests that specify `model: s1` are automatically served by `s2.1-pro` and billed as `s2.1-pro`. Both models have the same price, $15.00 / M UTF-8 bytes, so your cost does not change. See [Pricing & Rate Limits](/developer-guide/models-pricing/pricing-and-rate-limits). +After December 31, 2026, requests that specify `model: s1` are automatically served by `s3-pro` and billed as `s3-pro`. Both models have the same list price, $15.00 / M UTF-8 bytes. See [Pricing & Rate Limits](/developer-guide/models-pricing/pricing-and-rate-limits). -Your audio can still change, because S2.1-Pro treats some input and defaults differently than S1: +Your audio can still change, because S3 Pro treats some input and defaults differently than S1: - S1-style `(happy)` emotion tags are not interpreted as tags, and the API does not convert them. - Loudness normalization is applied to the output. -- `repetition_penalty` has no effect. +- Sampling and chunking parameters, such as `repetition_penalty`, are managed automatically by the service. The steps below cover each of these changes. -## Migrate to S2.1-Pro +## Migrate to S3 Pro -### Switch the model to `s2.1-pro` +### Switch the model to `s3-pro` -In the API, you select the model with the `model` request header. Change `s1` to `s2.1-pro` wherever you set the model, including SDK and integration settings. +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), or pass the model 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` (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: @@ -52,11 +52,11 @@ curl --request POST https://api.fish.audio/v1/tts \ --output out.mp3 ``` -```bash After (S2.1-Pro) +```bash After (S3 Pro) curl --request POST https://api.fish.audio/v1/tts \ --header "Authorization: Bearer $FISH_API_KEY" \ --header "Content-Type: application/json" \ - --header "model: s2.1-pro" \ + --header "model: s3-pro" \ --data '{ "text": "[happy] What a beautiful day! [laughing] I did not expect that.", "reference_id": "9a9cf47702da476aa4629e2506d4a857", @@ -69,24 +69,24 @@ curl --request POST https://api.fish.audio/v1/tts \ ### Convert emotion tags -S1 uses `(parenthesis)` tags, such as `(happy)`. S2 uses `[bracket]` tags, such as `[happy]`, and accepts free-form natural language, such as `[whispers sweetly]`. +S1 uses `(parenthesis)` tags, such as `(happy)`. S3 Pro and the S2 models use `[bracket]` tags, such as `[happy]`, and accept free-form natural language, such as `[whispers sweetly]`. -The API does not convert old tags. S1-style `(happy)` text sent to S2 is not interpreted as a tag, so replace each `(tag)` in your text with `[tag]`: +The API does not convert old tags. S1-style `(happy)` text sent to S3 Pro is not interpreted as a tag, so replace each `(tag)` in your text with `[tag]`: ```text S1: (happy) What a beautiful day! (laughing) I did not expect that. -S2: [happy] What a beautiful day! [laughing] I did not expect that. +S3 Pro: [happy] What a beautiful day! [laughing] I did not expect that. ``` -For more on S2 tags and examples, see [Emotion Control](/developer-guide/core-features/emotions). +For more on `[bracket]` tags and examples, see [Emotion Control](/developer-guide/core-features/emotions). ### Generate multi-speaker dialogue in one request -With S1, multi-speaker audio meant generating each speaker's segment separately and stitching the audio together. S2.1-Pro supports multi-speaker dialogue natively in one request: add `<|speaker:N|>` markers to `text`, and pass `reference_id` as an array with one voice ID per speaker. For details and an example, see `reference_id` in the [Text to Speech API reference](/api-reference/endpoint/openapi-v1/text-to-speech). +With S1, multi-speaker audio meant generating each speaker's segment separately and stitching the audio together. S3 Pro supports multi-speaker dialogue natively in one request: add `<|speaker:N|>` markers to `text`, and pass `reference_id` as an array with one voice ID per speaker. For details and an example, see `reference_id` in the [Text to Speech API reference](/api-reference/endpoint/openapi-v1/text-to-speech). ### Check output loudness -`normalize_loudness` in the `prosody` object defaults to `true`. It had no effect on S1, but it is applied on S2, so your output loudness can change after you migrate. +`normalize_loudness` in the `prosody` object defaults to `true`. It had no effect on S1, but it is applied on S3 Pro, so your output loudness can change after you migrate. If you need to turn it off, set `prosody.normalize_loudness` to the boolean `false`: @@ -97,8 +97,8 @@ If you need to turn it off, set `prosody.normalize_loudness` to the boolean `fal } ``` -### Check `repetition_penalty` +### Check sampling settings -`repetition_penalty` applies to S1 but has no effect on S2.1-Pro. If you tuned it to reduce repeated sounds in S1 output, that setting no longer changes your audio after you switch. Listen to your output after you migrate. +`repetition_penalty` and the other sampling settings apply to S1. On `s3-pro`, sampling and chunking parameters are managed automatically by the service, so settings you tuned for S1 no longer change your audio. Listen to your output after you migrate. diff --git a/developer-guide/models-pricing/migrate-from-transcribe-1.mdx b/developer-guide/models-pricing/migrate-from-transcribe-1.mdx index f0ac2d97..163e4801 100644 --- a/developer-guide/models-pricing/migrate-from-transcribe-1.mdx +++ b/developer-guide/models-pricing/migrate-from-transcribe-1.mdx @@ -1,7 +1,7 @@ --- title: "Migrate from transcribe-1" sidebarTitle: "Migrate from transcribe-1" -description: "transcribe-1 will be retired on December 31, 2026. Move your speech-to-text requests from transcribe-1 to transcribe-1-pro." +description: "transcribe-1 will be retired on December 31, 2026. Move your speech-to-text requests from transcribe-1 to transcribe-2-pro." icon: "arrow-right-arrow-left" --- @@ -17,15 +17,15 @@ This guide is for you if your speech-to-text requests are served by `transcribe- ## What is changing -`transcribe-1` is deprecated and will be retired on December 31, 2026. After that date, every request that `transcribe-1` serves today is served by `transcribe-1-pro`. Requests keep working, and no error is returned. +`transcribe-1` is deprecated and will be retired on December 31, 2026. After that date, every request that `transcribe-1` serves today is served by `transcribe-2-pro`. Requests keep working, and no error is returned. -We recommend that you switch to `transcribe-1-pro` before then, so you can test your transcripts on your own schedule. +We recommend that you switch to `transcribe-2-pro`, our recommended speech-to-text model, before then, so you can test your transcripts on your own schedule. ## What happens if you do nothing -After December 31, 2026, your requests are served by `transcribe-1-pro` and billed as `transcribe-1-pro`. Both models cost $0.36 / audio hour, so your cost does not change. See [Pricing & Rate Limits](/developer-guide/models-pricing/pricing-and-rate-limits). +After December 31, 2026, your requests are served by `transcribe-2-pro` and billed as `transcribe-2-pro`, at \$0.16 / audio hour, less than the \$0.36 / audio hour of `transcribe-1`. See [Pricing & Rate Limits](/developer-guide/models-pricing/pricing-and-rate-limits). -Your transcripts can still change, because `transcribe-1-pro` returns more than `transcribe-1` by default: +Your transcripts can still change, because `transcribe-2-pro` returns more than `transcribe-1` by default: - `text` can include speaker markers such as `<|speaker:0|>` when more than one person speaks. - `text` can include emotion and vocal-event cues such as `[laughter]`. @@ -34,18 +34,18 @@ Your transcripts can still change, because `transcribe-1-pro` returns more than The steps below cover each of these changes. -## Migrate to transcribe-1-pro +## Migrate to transcribe-2-pro ### Send the `model` header -Select the model with the `model` HTTP header, and send `model: transcribe-1-pro`, in lowercase, with every request. `model` is not a form or body field. +Select the model with the `model` HTTP header, and send `model: transcribe-2-pro`, in lowercase, with every request. `model` is not a form or body field. ```bash curl curl --request POST https://api.fish.audio/v1/asr \ --header "Authorization: Bearer $FISH_API_KEY" \ - --header "model: transcribe-1-pro" \ + --header "model: transcribe-2-pro" \ --form audio=@speech.wav ``` @@ -59,7 +59,7 @@ with open("speech.wav", "rb") as f: result = client.asr.transcribe( audio=f.read(), request_options=RequestOptions( - additional_headers={"model": "transcribe-1-pro"} + additional_headers={"model": "transcribe-2-pro"} ), ) @@ -75,7 +75,7 @@ const client = new FishAudioClient({ apiKey: process.env.FISH_API_KEY }); // model requires fish-audio 0.2.0 or later const result = await client.speechToText.convert({ audio: new File([await readFile("speech.wav")], "speech.wav"), - model: "transcribe-1-pro", + model: "transcribe-2-pro", }); console.log(result.text); ``` @@ -89,7 +89,7 @@ If your code expects `text` without speaker markers or event cues, send `diarize ```bash curl --request POST https://api.fish.audio/v1/asr \ --header "Authorization: Bearer $FISH_API_KEY" \ - --header "model: transcribe-1-pro" \ + --header "model: transcribe-2-pro" \ --form audio=@speech.wav \ --form diarize=false \ --form tag_audio_events=false @@ -101,12 +101,12 @@ To use the speaker markers instead, see [Multi-speaker conversations](/features/ ### If you use a compatible endpoint -The OpenAI-, Groq-, OpenRouter-, and ElevenLabs-compatible endpoints, and OpenAI Realtime-compatible transcription sessions, keep working after December 31, 2026, and their requests are served by `transcribe-1-pro`. You don't need to change the model name you send. +The OpenAI-, Groq-, OpenRouter-, and ElevenLabs-compatible endpoints, and OpenAI Realtime-compatible transcription sessions, keep working after December 31, 2026, and their requests are served by `transcribe-2-pro`. You don't need to change the model name you send. -These endpoints don't accept `diarize` or `tag_audio_events`. If your application needs plain transcripts, or you want to control speaker markers and event cues, move to the native [Speech to Text API](/features/speech-to-text) with `model: transcribe-1-pro`, and test before December 31, 2026. +These endpoints don't accept `diarize` or `tag_audio_events`. If your application needs plain transcripts, or you want to control speaker markers and event cues, move to the native [Speech to Text API](/features/speech-to-text) with `model: transcribe-2-pro`, and test before December 31, 2026. ### Check your error handling -`transcribe-1-pro` errors are JSON with `status`, `message`, `code`, and `request_id`. Code that reads only `status` and `message` keeps working; to branch on the cause, use `code`. See [Errors](/features/speech-to-text#errors). +`transcribe-2-pro` errors are JSON with `status`, `message`, `code`, and `request_id`. Code that reads only `status` and `message` keeps working; to branch on the cause, use `code`. See [Errors](/features/speech-to-text#errors). diff --git a/developer-guide/models-pricing/models-overview.mdx b/developer-guide/models-pricing/models-overview.mdx index b9ba0c9a..fd4d2cb3 100644 --- a/developer-guide/models-pricing/models-overview.mdx +++ b/developer-guide/models-pricing/models-overview.mdx @@ -89,10 +89,10 @@ flowchart LR |---|---|---| | `s2.1-pro` | Legacy | TTFA and DPA guarantees available under an enterprise agreement. Used for text-to-speech requests that send no `model` header. 83 languages. | | `s2-pro` | Legacy | Previous-generation S2 model. Open-source. | - | `s1` | Deprecated, retiring December 31, 2026 | 4 billion parameters, 0.008 WER, `(parenthesis)` emotion tags. After retirement, requests for `s1` are served by `s2.1-pro`. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). | + | `s1` | Deprecated, retiring December 31, 2026 | 4 billion parameters, 0.008 WER, `(parenthesis)` emotion tags. After retirement, requests for `s1` are served by `s3-pro`. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). | | `transcribe-1-pro` | Legacy | Recordings with speakers and audio tags. Followed by `transcribe-2-pro`. | | `transcribe-stream-1` | Legacy | Live audio with turn detection. The realtime endpoint's default when no `model` header is sent. Followed by `transcribe-stream-2`. | - | `transcribe-1` | Deprecated, retiring December 31, 2026 | Short recordings. Serves speech-to-text requests whose `model` header is missing or not an exact match. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). | + | `transcribe-1` | Deprecated, retiring December 31, 2026 | Short recordings. Serves speech-to-text requests whose `model` header is missing or not an exact match. After retirement, those requests are served by `transcribe-2-pro`. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). | Full specifications, languages, and control syntax: [Legacy Models](/developer-guide/models-pricing/models/legacy), including [Transcribe 1](/developer-guide/models-pricing/models/legacy#transcribe-1). Retirement dates: [Model Deprecations](/developer-guide/models-pricing/deprecations). diff --git a/developer-guide/models-pricing/models/legacy.mdx b/developer-guide/models-pricing/models/legacy.mdx index f514f97a..716169a0 100644 --- a/developer-guide/models-pricing/models/legacy.mdx +++ b/developer-guide/models-pricing/models/legacy.mdx @@ -61,7 +61,7 @@ S2 cues can be placed anywhere in your text to control emotion at specific posit ## S1 (deprecated) -S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). +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). @@ -88,7 +88,7 @@ S1 is deprecated and will be retired on December 31, 2026. After that date, requ ``` - S1 supports 64+ emotional expressions using `(parenthesis)` syntax. S2 does not interpret these tags, so convert them to `[bracket]` syntax when you [migrate from S1](/developer-guide/models-pricing/migrate-from-s1#convert-emotion-tags). + S1 supports 64+ emotional expressions using `(parenthesis)` syntax. S3 Pro and the S2 models do not interpret these tags, so convert them to `[bracket]` syntax when you [migrate from S1](/developer-guide/models-pricing/migrate-from-s1#convert-emotion-tags). **Basic emotions (24 expressions)** ```text @@ -154,7 +154,7 @@ Pro has its own optional request fields: `tag_audio_events`, `diarize`, and the ### transcribe-1 (deprecated, retiring December 31, 2026) - `transcribe-1` is deprecated and will be retired on December 31, 2026. After that date, the requests it serves are served by `transcribe-1-pro`. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). + `transcribe-1` is deprecated and will be retired on December 31, 2026. After that date, the requests it serves are served by `transcribe-2-pro`. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). | Model | Capabilities | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/developer-guide/models-pricing/models/transcribe-2.mdx b/developer-guide/models-pricing/models/transcribe-2.mdx index 3902a438..a653bd05 100644 --- a/developer-guide/models-pricing/models/transcribe-2.mdx +++ b/developer-guide/models-pricing/models/transcribe-2.mdx @@ -80,7 +80,7 @@ Compared with `transcribe-1-pro`, as of December 2026: | Spelled email addresses, captured correctly by an LLM agent from the transcript | 83.0% (#1) | 77.6%, AssemblyAI 3.7 Realtime Agent | 31.0% | | Eager end of turn, median time after the speaker stops | 293 ms (#1) | 428 ms, AssemblyAI 3.7 Realtime Agent (end of turn, no eager mode) | 380 ms | | Digit strings with natural pauses, 7 languages: kept in one turn | 98.4% (#1, tied) | 98.4%, Soniox stt-rt-v6 | 98.4% | -| 8 kHz phone calls, US English and Mexican Spanish: unit error rate (lower is better) | 7.22% (#1) | 7.51%, Reson8 Rumble-2 | 12.43% | +| 8 kHz phone calls, US English and Mexican Spanish: utterance error rate, the share of utterances with at least one meaning-changing error (lower is better) | 7.22% (#1) | 7.51%, Reson8 Rumble-2 | 12.43% | | Entities such as numbers, dates, and amounts written exactly (Cekura set, strict) | 80.9% (#1) | 76.6%, ElevenLabs Scribe v3 | 68.8% | | Accented English, 24 accents (EdAcc): word error rate (lower is better) | 9.96% (#1) | 10.14%, ElevenLabs Scribe v3 | 10.28% | diff --git a/developer-guide/models-pricing/pricing-and-rate-limits.mdx b/developer-guide/models-pricing/pricing-and-rate-limits.mdx index c2067afb..ebf12be6 100644 --- a/developer-guide/models-pricing/pricing-and-rate-limits.mdx +++ b/developer-guide/models-pricing/pricing-and-rate-limits.mdx @@ -40,8 +40,8 @@ price above. See [Drama 3](/features/text-to-speech/drama-3). S1 is deprecated and will be retired on December 31, 2026. After that date, -requests that specify `s1` are served by `s2.1-pro` and billed as `s2.1-pro`, at -the same price. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). +requests that specify `s1` are served by `s3-pro` and billed as `s3-pro`, at +the same list price. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). ### Automatic Speech Recognition (ASR) Models diff --git a/developer-guide/resources/agent-quickstart.mdx b/developer-guide/resources/agent-quickstart.mdx index 98be3f37..4023f0fc 100644 --- a/developer-guide/resources/agent-quickstart.mdx +++ b/developer-guide/resources/agent-quickstart.mdx @@ -140,8 +140,9 @@ Not a coding agent installing a skill, but an autonomous agent, RAG pipeline, or - Base API URL: `https://api.fish.audio` - Authentication: `Authorization: Bearer ` - - TTS model selection: optional `model` header (`s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro`). Recommended: `s3-pro`. If omitted, the server uses `s2.1-pro`. S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro` - - ASR model selection: `model` header on `POST /v1/asr` (`transcribe-1-pro`, `transcribe-1`). Recommended: `transcribe-1-pro` (speaker turns, long recordings, emotion cues); send it explicitly. If the header is missing or not an exact match, the request is served and billed as `transcribe-1`. The `/v1/asr` entry in `openapi.json` does not yet list the `transcribe-1-pro` fields, `request_id`, `speaker_turns`, or the error `code`; for those, follow the [Speech to Text API reference](https://docs.fish.audio/api-reference/endpoint/openapi-v1/speech-to-text.md) + - TTS model selection: optional `model` header (`s1` (deprecated), `s2-pro`, `s2.1-pro`, `drama-3`, `s3-pro`). Recommended: `s3-pro`. If omitted, the server uses `s2.1-pro`. S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s3-pro` + - ASR model selection: `model` header on `POST /v1/asr` (`transcribe-2-pro`, `transcribe-1-pro`, `transcribe-1`). Recommended: `transcribe-2-pro` (speaker turns, long recordings, emotion cues, key terms); send it explicitly. If the header is missing or not an exact match, the request is served and billed as `transcribe-1`. The `/v1/asr` entry in `openapi.json` does not yet list the `transcribe-1-pro` fields, `request_id`, `speaker_turns`, or the error `code`; for those, follow the [Speech to Text API reference](https://docs.fish.audio/api-reference/endpoint/openapi-v1/speech-to-text.md) + - `transcribe-2-pro` is selected the same way (`model: transcribe-2-pro`). It returns the same response format as `transcribe-1-pro` and also takes `text_format`, `verbatim`, and `keyterms`, which `openapi.json` does not list either; see the [Speech to Text API reference](https://docs.fish.audio/api-reference/endpoint/openapi-v1/speech-to-text.md) - Main REST endpoints: - `POST /v1/tts` - `POST /v1/asr` @@ -204,7 +205,7 @@ Not a coding agent installing a skill, but an autonomous agent, RAG pipeline, or - **Generate speech** → Quick Start, the Text to Speech guide, and `POST /v1/tts`. - - **Transcribe audio** → the Speech to Text guide and `POST /v1/asr` with `model: transcribe-1-pro`. + - **Transcribe audio** → the Speech to Text guide and `POST /v1/asr` with `model: transcribe-2-pro`. - **Clone or manage voices** → Creating Voice Models and the `/model` endpoints. - **Stream audio in real time** → WebSocket TTS Streaming and the realtime guides. - **Pick a model or estimate cost** → Models Overview and Pricing & Rate Limits. diff --git a/developer-guide/sdk-guide/cookbook/clone-and-wait-until-ready.mdx b/developer-guide/sdk-guide/cookbook/clone-and-wait-until-ready.mdx index 311d90b1..51582f31 100644 --- a/developer-guide/sdk-guide/cookbook/clone-and-wait-until-ready.mdx +++ b/developer-guide/sdk-guide/cookbook/clone-and-wait-until-ready.mdx @@ -116,7 +116,7 @@ while (voice.state !== "trained") { // 3. Synthesize with the trained voice. const stream = await client.textToSpeech.convert( { text: "My voice is ready to use.", reference_id: voice._id }, - "s2-pro", + "s3-pro", ); const chunks = []; for await (const chunk of stream) chunks.push(Buffer.from(chunk)); diff --git a/developer-guide/sdk-guide/cookbook/voice-agent-loop.mdx b/developer-guide/sdk-guide/cookbook/voice-agent-loop.mdx index 0f2e8974..3a461208 100644 --- a/developer-guide/sdk-guide/cookbook/voice-agent-loop.mdx +++ b/developer-guide/sdk-guide/cookbook/voice-agent-loop.mdx @@ -120,7 +120,7 @@ async function voiceAgentTurn(audioPath, outPath) { const stream = await client.textToSpeech.convert( { text: reply, reference_id: "", format: "mp3" }, - "s2-pro" + "s3-pro" ); const chunks = []; for await (const chunk of stream) chunks.push(Buffer.from(chunk)); diff --git a/features/speech-to-text.mdx b/features/speech-to-text.mdx index 79b91793..5df608c9 100644 --- a/features/speech-to-text.mdx +++ b/features/speech-to-text.mdx @@ -1,11 +1,11 @@ --- title: "Speech to Text" sidebarTitle: "Overview" -description: "Transcribe audio with transcribe-1-pro, including word-level timestamps, speaker turns for multi-speaker conversations, long recordings, and emotion cues" +description: "Transcribe audio with transcribe-2-pro (recommended) or transcribe-1-pro, including word-level timestamps, speaker turns for multi-speaker conversations, long recordings, emotion cues, and key terms" icon: "waveform" --- -Turn spoken audio into text with `transcribe-1-pro`, Fish Audio's recommended automatic speech recognition (ASR) model. Send an audio file to `POST /v1/asr` with the header `model: transcribe-1-pro` to receive a transcript, its duration, and optional word-level timestamps. Pro handles multi-speaker conversations and recordings up to 60 minutes: it marks speakers inline in the transcript, returns a structured list of speaker turns when you request timestamps, and keeps emotion and vocal-event cues. To transcribe live audio as people speak, with turn detection for voice agents, see [Realtime Speech to Text](/features/speech-to-text/realtime). +Turn spoken audio into text with `transcribe-2-pro`, Fish Audio's recommended automatic speech recognition (ASR) model. Send an audio file to `POST /v1/asr` with the header `model: transcribe-2-pro` to receive a transcript, its duration, and optional word-level timestamps. Pro handles multi-speaker conversations and recordings up to 60 minutes: it marks speakers inline in the transcript, returns a structured list of speaker turns when you request timestamps, and keeps emotion and vocal-event cues. `transcribe-2-pro` returns the same response format and also lets you choose how numbers are written, keep or leave out filler sounds, and list key terms; see [transcribe-2-pro options](#transcribe-2-pro-options). To transcribe live audio as people speak, with turn detection for voice agents, see [Realtime Speech to Text](/features/speech-to-text/realtime). - In the Python SDK, `model="transcribe-1-pro"` sends the `model` header. The + In the Python SDK, `model="transcribe-2-pro"` sends the `model` header. The argument requires `fish-audio-sdk` 1.5.0 or later; on earlier versions, pass - `request_options=RequestOptions(additional_headers={"model": "transcribe-1-pro"})` - instead. `asr.transcribe()` cannot send the `transcribe-1-pro` fields such as - `diarize`. The JavaScript example calls the REST API directly so the header is + `request_options=RequestOptions(additional_headers={"model": "transcribe-2-pro"})` + instead. `asr.transcribe()` cannot send the Pro model fields such as `diarize` or + `keyterms`. The JavaScript example calls the REST API directly so the header is explicit. For multipart uploads, let your HTTP client set `Content-Type` and its boundary. @@ -164,7 +168,7 @@ result = client.asr.transcribe( audio=audio_bytes, include_timestamps=True, request_options=RequestOptions( - additional_headers={"model": "transcribe-1-pro"} + additional_headers={"model": "transcribe-2-pro"} ), ) @@ -177,7 +181,7 @@ for seg in result.segments: ```bash API (curl) curl --request POST https://api.fish.audio/v1/asr \ --header "Authorization: Bearer $FISH_API_KEY" \ - --header "model: transcribe-1-pro" \ + --header "model: transcribe-2-pro" \ --form audio=@speech.wav \ --form ignore_timestamps=false | jq '.segments' @@ -196,7 +200,7 @@ For captions, group consecutive segments into caption-sized cues instead of writ ## Multi-speaker conversations -`transcribe-1-pro` supports recordings with multiple speakers, such as interviews, meetings, and calls. Send the recording as one audio file. Speaker labels are consistent within one response, not across requests, so do not split a conversation into several requests. +`transcribe-1-pro` and `transcribe-2-pro` support recordings with multiple speakers, such as interviews, meetings, and calls. Send the recording as one audio file. Speaker labels are consistent within one response, not across requests, so do not split a conversation into several requests. ### Speaker markers @@ -249,7 +253,7 @@ When you request timestamps, prefer `speaker_turns` over parsing `text`. ### Speaker turns -With `ignore_timestamps=false`, `transcribe-1-pro` also returns `speaker_turns`, a list of who spoke when. The field is present when `ignore_timestamps=false` and `diarize` is not `false`; otherwise it is absent. Speaker identification is a `transcribe-1-pro` feature. +With `ignore_timestamps=false`, the Pro models also return `speaker_turns`, a list of who spoke when. The field is present when `ignore_timestamps=false` and `diarize` is not `false`; otherwise it is absent. Speaker identification is a Pro model feature. This illustrative response is the same conversation with timestamps requested: @@ -294,7 +298,7 @@ This illustrative response is the same conversation with timestamps requested: ### Speaker options -These `transcribe-1-pro` fields control speaker identification: +These Pro model fields control speaker identification: - `diarize`: `auto` (default) or `true` returns `speaker_turns` when timestamps are requested. `false` omits `speaker_turns` and removes the speaker markers from `text`; the rest of the transcript does not change. Use it when you do not need speaker labels. - `num_speakers`: the expected number of speakers. This is a hint, applied on a best-effort basis; it guides speaker identification on longer recordings and may have no effect on short ones. It cannot be combined with `min_speakers` or `max_speakers`. @@ -316,7 +320,7 @@ with open("interview.mp3", "rb") as f: "https://api.fish.audio/v1/asr", headers={ "Authorization": f"Bearer {os.environ['FISH_API_KEY']}", - "model": "transcribe-1-pro", + "model": "transcribe-2-pro", }, files={"audio": ("interview.mp3", f)}, data={"ignore_timestamps": "false", "num_speakers": "2"}, @@ -333,7 +337,7 @@ for turn in result.get("speaker_turns", []): ```bash API (curl) curl --request POST https://api.fish.audio/v1/asr \ --header "Authorization: Bearer $FISH_API_KEY" \ - --header "model: transcribe-1-pro" \ + --header "model: transcribe-2-pro" \ --form audio=@interview.mp3 \ --form ignore_timestamps=false \ --form num_speakers=2 | jq '.speaker_turns' @@ -351,17 +355,125 @@ Pro can retain cues about how speech sounds alongside the spoken words. These ap These are annotations inferred from the audio, not words you need to add to the request. The API has no separate `emotion` field or fixed emotion enum; preserve the returned text when your application needs these cues. -To get a transcript without cues, send `tag_audio_events=false` (`transcribe-1-pro`). Cues are then removed from `text` and `speaker_turns`; timestamps and billing do not change. +To get a transcript without cues, send `tag_audio_events=false` (Pro models). Cues are then removed from `text` and `speaker_turns`; timestamps and billing do not change. Word timestamps ignore speaker markers and cues. Read `text` for the annotated transcript and `segments` for timed speech; the segment text may therefore differ from the full transcript. +## transcribe-2-pro options + +`transcribe-2-pro` takes three request fields that the other models ignore: `text_format`, `verbatim`, and `keyterms`. They apply to the whole recording, and they do not change the price. + +### Text format + +`text_format` chooses how numbers, dates, times, and amounts are written: + +| Value | Output | Example | +| ------------------- | ----------------------------- | --------------------- | +| `written` (default) | Digits and symbols | `3:30`, `20%` | +| `spoken` | Words, the way they were said | `twenty-five dollars` | + +In Chinese transcripts, `written` numbers are usually Arabic digits rather than Chinese numerals. Send `written` or `spoken`, in any letter case. + +`spoken` is not always followed when you also send [key terms](#key-terms): numbers, dates, and amounts can then come back in digits and symbols, as with `written`. If you need spoken numbers, send the request without `keyterms`. + +### Verbatim + +`verbatim` controls filler words and disfluencies: + +- `true` (default): filler words, stutters, repetitions, and false starts stay in the transcript. +- `false`: the model leaves out filler sounds, stutters, accidental repetitions, and short false starts. + +With `false`, words are only removed, never reworded or replaced. Meaningful words stay, and so does a short reply such as `Mm-hmm`. The model decides what counts as a filler or a false start, so it can occasionally leave one in or remove a short word that was meant. + +### Key terms + +Send `keyterms` to list up to 128 words or short phrases that may be spoken in the recording, such as names, products, and technical terms, so the transcript spells them as you list them. List only terms that are likely to occur: a listed term that is never said can occasionally appear in the transcript. Key terms have been tested on short Chinese, Japanese, and English clips. + +- In multipart forms, repeat the `keyterms` field once per term. In MessagePack, send an array of strings. +- Each term is at most 50 characters and 8 words. It cannot contain an ASCII comma (`,`), any of `\ < > [ ] { }`, or line breaks; full-width punctuation such as `,` and `、` is accepted. +- All the terms together must fit in the model's limit of 1024 tokens. Long Chinese or Japanese terms can reach it before 128 terms; if the list is refused as too long in total, send fewer or shorter terms. +- A term that breaks a rule returns 400 `invalid_parameter`, and the error message names the term's position, such as `keyterms[3]`, counted from 0. See [Key terms](/api-reference/endpoint/openapi-v1/speech-to-text#key-terms) in the API reference for every rule. +- With key terms, `text_format=spoken` is not always followed, and numbers can come back in digits. See [Text format](#text-format). + +{/* TODO(owner): decide whether key terms are labelled Beta. */} + +For example, to transcribe an English earnings call with a language hint and two key terms: + + + +```python Python (httpx) +import os + +import httpx + +with open("earnings-call.mp3", "rb") as f: + resp = httpx.post( + "https://api.fish.audio/v1/asr", + headers={ + "Authorization": f"Bearer {os.environ['FISH_API_KEY']}", + "model": "transcribe-2-pro", + }, + files={"audio": ("earnings-call.mp3", f)}, + data={ + "language": "en", + "keyterms": ["Kubernetes", "Fish Audio"], # one field per term + }, + # Long recordings can take several minutes to process. + timeout=httpx.Timeout(900.0, connect=10.0), + ) +resp.raise_for_status() +print(resp.json()["text"]) +``` + +```bash API (curl) +curl --request POST https://api.fish.audio/v1/asr \ + --header "Authorization: Bearer $FISH_API_KEY" \ + --header "model: transcribe-2-pro" \ + --form audio=@earnings-call.mp3 \ + --form language=en \ + --form-string keyterms=Kubernetes \ + --form-string "keyterms=Fish Audio" +``` + +```javascript JavaScript (Node.js 20+) +import { readFile } from "node:fs/promises"; + +const form = new FormData(); +form.append( + "audio", + new Blob([await readFile("earnings-call.mp3")]), + "earnings-call.mp3" +); +form.append("language", "en"); +for (const term of ["Kubernetes", "Fish Audio"]) { + form.append("keyterms", term); // one field per term +} + +const response = await fetch("https://api.fish.audio/v1/asr", { + method: "POST", + headers: { + Authorization: `Bearer ${process.env.FISH_API_KEY}`, + model: "transcribe-2-pro", + }, + body: form, +}); + +if (!response.ok) throw new Error(await response.text()); +const result = await response.json(); +console.log(result.text); +``` + + + +In curl, `--form-string` sends each term as plain text, even one that starts with `@`, which `--form` would read as a file to upload. + ## Implementation details ### Language -`language` is optional. The language is detected automatically whether or not you send a hint, and a hint does not force the transcript into that language. With `transcribe-1-pro`, the hint does not change the transcript; it matters only when the language cannot be determined, as described below. +`language` is optional. With `transcribe-1-pro`, the language is detected automatically whether or not you send a hint, and a hint does not force the transcript into that language: the hint does not change the transcript; it matters only when the language cannot be determined, as described below. With `transcribe-2-pro`, the hint guides the transcription; see [Language hints with transcribe-2-pro](#language-hints-with-transcribe-2-pro). -Use a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. Other forms, such as `en-US` or `English`, may be rejected with 400. +With `transcribe-1-pro`, use a lowercase ISO 639-1 code such as `en`, `zh`, or `ja`. The response reports the language in two fields, which are omitted when unknown (never `null`): @@ -370,6 +482,18 @@ The response reports the language in two fields, which are omitted when unknown If the language cannot be determined (for example, very short audio), `language_code` reports your hint, which is not checked against the audio, and `language` may be absent. Responses report one language: for recordings that switch languages, `language` and `language_code` do not list every language spoken. The Python SDK returns them as `result.language` and `result.language_code` (`fish-audio-sdk` 1.4.0 or later). +#### Language hints with transcribe-2-pro + +`transcribe-2-pro` passes your hint to the model, which uses it to transcribe the recording. Send `language` when you know the language of the recording: without a hint, the response language is detected from the transcript, and for some languages it can be missing or name a related language, such as Hindi for Marathi. + +- The hint can be an ISO 639-1 or ISO 639-3 code, an English language name, or a locale such as `pt-BR`, in any letter case. +- A hint the model does not recognize, such as `auto`, is ignored: the model transcribes without a hint, the response language is detected as with `transcribe-1-pro`, and no error is returned. +- When the model recognizes the hint, `language` and `language_code` report the hint's language, for example `Portuguese` and `pt` for `pt-BR`, if the transcript agrees with it: no language is detected in the transcript, the language detected is the hint's, or, for a language that detection cannot identify, the transcript is mostly in a script that language is written in. Otherwise they report the detected language: Chinese speech sent with `language=ja` returns `Chinese` and `zh`. +- For `bs`, `hr`, and `sr`, `language` is `Bosnian/Croatian/Serbian` and `language_code` is the code you sent. +- Send the language that is actually spoken. A wrong hint can change the transcript, for example the script it is written in, and a wrong hint in the same script as the speech is not always caught: English speech sent with `language=az` can return `Azerbaijani`. + +{/* TODO(owner, D5): add the languages transcribe-2-pro supports here, in the exact wording to publish. Still to decide: the list itself (every language the model recognizes as a hint, or the smaller set marketing names), which languages should always be sent with `language`, which languages to steer to transcribe-1-pro, and what to say about Cantonese and zh-HK, zh-TW, and zh-Hant hints. */} + ```python Python @@ -398,7 +522,7 @@ curl --request POST https://api.fish.audio/v1/asr \ ### Input audio -`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; no conversion is needed. +The Pro models accept WAV, MP3, AAC (including M4A/MP4), FLAC, Ogg (Opus or Vorbis), WebM/Matroska, and MOV, including browser recordings, and use the first audio track of a video file. Send the original file bytes; no conversion is needed. Not supported: AIFF, CAF, WMA, AMR, AC-3, and raw (headerless) PCM. These return 400. @@ -408,7 +532,7 @@ If you use `transcribe-1`, send WAV, MP3, AAC (including M4A/MP4), FLAC, or Ogg ### Limits -These limits apply to `transcribe-1-pro`: +These limits apply to `transcribe-1-pro` and `transcribe-2-pro`: - Recordings up to 60 minutes long. Longer audio returns 400 `audio_too_long`. - For long recordings, send compressed audio such as MP3, Opus, or AAC. An hour of 128 kbps MP3 is about 55 MiB. A request that is too large returns 413. @@ -418,13 +542,13 @@ If you use `transcribe-1`, send up to 50 MiB per request and keep MP3 and Opus f ### Long recordings -With `transcribe-1-pro`, send the whole recording, up to 60 minutes, in one request. Timestamps and speaker labels cover the whole recording. Do not split conversations: speaker labels are consistent only within one response. Long recordings can take several minutes, so raise your [client timeout](#processing-time-and-timeouts) and retry on 5xx errors. You are billed for the full duration of the recording once. +With `transcribe-1-pro` or `transcribe-2-pro`, send the whole recording, up to 60 minutes, in one request. Timestamps and speaker labels cover the whole recording. Do not split conversations: speaker labels are consistent only within one response. Long recordings can take several minutes, so raise your [client timeout](#processing-time-and-timeouts) and retry on 5xx errors. You are billed for the full duration of the recording once. -If you use `transcribe-1`, keep each request short. For a long recording, use `transcribe-1-pro`, or split the audio into shorter clips, transcribe each, and offset each clip's `start`/`end` by where it began in the full recording. Check that each response covers the complete clip before combining transcripts. +If you use `transcribe-1`, keep each request short. For a long recording, use `transcribe-2-pro`, or split the audio into shorter clips, transcribe each, and offset each clip's `start`/`end` by where it began in the full recording. Check that each response covers the complete clip before combining transcripts. ### Processing time and timeouts -Each request returns only when the whole file has been transcribed. Processing time grows with the length of the recording, and timestamps add to it. Long `transcribe-1-pro` recordings can take several minutes. +Each request returns only when the whole file has been transcribed. Processing time grows with the length of the recording, and timestamps add to it. Long recordings can take several minutes on either Pro model. Set your HTTP client's timeout accordingly. The official SDKs' default timeout can be too short for long recordings, and many HTTP libraries default to even less. To wait up to 15 minutes, as several examples on this page do: @@ -451,7 +575,7 @@ const response = await fetch("https://api.fish.audio/v1/asr", { method: "POST", headers: { Authorization: `Bearer ${process.env.FISH_API_KEY}`, - model: "transcribe-1-pro", + model: "transcribe-2-pro", }, body: form, dispatcher, @@ -466,13 +590,13 @@ These values are examples, not a server guarantee. If a long request fails with ### Request IDs -`transcribe-1-pro` returns a unique `request_id` in the response body, both on success and on its own errors, and the same value in the `x-request-id` response header. Platform and network-edge errors do not carry it. Log it, and include it when you contact support. The Python SDK returns it as `result.request_id` (`fish-audio-sdk` 1.4.0 or later); on an error, read it from the error body as shown in [Errors](#errors). +The Pro models return a unique `request_id` in the response body, both on success and on their own errors, and the same value in the `x-request-id` response header. Platform and network-edge errors do not carry it. Log it, and include it when you contact support. The Python SDK returns it as `result.request_id` (`fish-audio-sdk` 1.4.0 or later); on an error, read it from the error body as shown in [Errors](#errors). ### Errors The error body depends on where the error comes from: -- `transcribe-1-pro` errors are JSON with `status`, `message`, `code`, and `request_id`. Branch on `code`, not on `message`. +- Pro model errors, from `transcribe-1-pro` and `transcribe-2-pro`, are JSON with `status`, `message`, `code`, and `request_id`. Branch on `code`, not on `message`. - Platform errors, such as a missing or invalid API key (401), insufficient API credit (402), or the concurrency limit (429), are JSON with `status` and `message`. - Errors from the network edge in front of the API, such as some 413 and 5xx responses, may not have a JSON body. @@ -488,7 +612,7 @@ The error body depends on where the error comes from: Retry 429 and 5xx responses with exponential backoff; 429 responses have no `Retry-After` header. Do not retry other 4xx responses; change the request first. New `code` values may be added; handle unknown codes by HTTP status. See the [API reference](/api-reference/endpoint/openapi-v1/speech-to-text#errors) for every status and code. -With the Python SDK, a failed request raises `APIError` (`RateLimitError` for 429, `ServerError` for 5xx). `e.status` is the HTTP status, and `e.body` is the raw response body, where `transcribe-1-pro` errors carry `code` and `request_id`: +With the Python SDK, a failed request raises `APIError` (`RateLimitError` for 429, `ServerError` for 5xx). `e.status` is the HTTP status, and `e.body` is the raw response body, where Pro model errors carry `code` and `request_id`: ```python import json @@ -499,7 +623,7 @@ try: result = client.asr.transcribe( audio=audio_bytes, request_options=RequestOptions( - additional_headers={"model": "transcribe-1-pro"} + additional_headers={"model": "transcribe-2-pro"} ), ) except APIError as e: @@ -529,7 +653,7 @@ async def main(): audio=f.read(), request_options=RequestOptions( timeout=900, - additional_headers={"model": "transcribe-1-pro"}, + additional_headers={"model": "transcribe-2-pro"}, ), ) print(result.text) @@ -547,7 +671,7 @@ from fishaudio.core import RequestOptions async def transcribe_all(paths): client = AsyncFishAudio() pro = RequestOptions( - timeout=900, additional_headers={"model": "transcribe-1-pro"} + timeout=900, additional_headers={"model": "transcribe-2-pro"} ) clips = [open(p, "rb").read() for p in paths] return await asyncio.gather(*[ @@ -578,7 +702,7 @@ resp = httpx.post( headers={ "Authorization": f"Bearer {os.environ['FISH_API_KEY']}", "Content-Type": "application/msgpack", - "model": "transcribe-1-pro", + "model": "transcribe-2-pro", }, # httpx waits 5 seconds by default; long recordings can take minutes. timeout=httpx.Timeout(900.0, connect=10.0), @@ -591,7 +715,7 @@ for turn in result.get("speaker_turns", []): print(turn["speaker"], turn["start"], turn["end"], turn["text"]) ``` -The response is the same as for multipart: `text`, `duration` (seconds), `segments`, and `request_id`, plus `speaker_turns` when timestamps are requested, and `language_code` and `language` when the language is known. Model selection stays in the HTTP header for both formats. MessagePack values are typed: send booleans for `ignore_timestamps` and `tag_audio_events`, integers for speaker counts, and a boolean or `"auto"` for `diarize`. +The response is the same as for multipart: `text`, `duration` (seconds), `segments`, and `request_id`, plus `speaker_turns` when timestamps are requested, and `language_code` and `language` when the language is known. Model selection stays in the HTTP header for both formats. MessagePack values are typed: send booleans for `ignore_timestamps`, `tag_audio_events`, and `verbatim`, integers for speaker counts, a boolean or `"auto"` for `diarize`, the string `"written"` or `"spoken"` for `text_format`, and an array of strings for `keyterms`. ## Going further diff --git a/features/speech-to-text/realtime.mdx b/features/speech-to-text/realtime.mdx index ace6efda..80d62453 100644 --- a/features/speech-to-text/realtime.mdx +++ b/features/speech-to-text/realtime.mdx @@ -76,7 +76,7 @@ The realtime endpoints of the [compatible APIs](/developer-guide/compat/capabili Two models serve this endpoint, with the same turn detection, messages, and limits. Choose one with the `model` header when you connect. - **`transcribe-stream-1`**: the default. A connection without the `model` header, or with any other value, uses it. -- **`transcribe-stream-2`**: send `model: transcribe-stream-2`, written exactly. It also takes `results.text_format` in `config`: `"written"` (the default) for digits and symbols, or `"spoken"` for words, the way they were said. `transcribe-stream-1` refuses a `config` that sends `text_format`, with `invalid_config`. +- **`transcribe-stream-2`**: send `model: transcribe-stream-2`, written exactly. It also takes `results.text_format` in `config`: `"written"` (the default) for digits and symbols, or `"spoken"` for words, the way they were said. `transcribe-stream-1` refuses a `config` that sends `text_format`, with `invalid_config`. `transcribe-stream-2` also takes `results.primary_speaker` (`true` transcribes the person speaking to your agent and leaves out background voices) and `language_hints` (the languages you expect, such as `["en"]`). `session_started.config.model` names the model that serves the session. @@ -216,7 +216,7 @@ A session lasts up to 60 minutes and a turn up to 60 seconds. Each open connecti ### Pricing -`transcribe-stream-1` costs $0.36 per hour, billed per second of session duration as its own line item, Realtime ASR. See [ASR pricing](/developer-guide/models-pricing/pricing-and-rate-limits#automatic-speech-recognition-asr-models). +`transcribe-stream-2` costs \$0.26 per session hour, with a launch price of \$0.12 per session hour through December 31, 2026. `transcribe-stream-1` costs \$0.36 per session hour. Both are billed per second of session duration as their own line item, Realtime ASR. See [ASR pricing](/developer-guide/models-pricing/pricing-and-rate-limits#automatic-speech-recognition-asr-models). ## Going further diff --git a/features/text-to-speech.mdx b/features/text-to-speech.mdx index 955e49c2..6b3ad82f 100644 --- a/features/text-to-speech.mdx +++ b/features/text-to-speech.mdx @@ -111,7 +111,7 @@ curl --request POST https://api.fish.audio/v1/tts \ - **`s2.1-pro`**: improved quality, latency, and throughput over S2-Pro, with TTFA and DPA guarantees available under an enterprise agreement. - **`drama-3`**: model you direct in plain language, with sounds, pauses, and paired scoped tags for specific words, such as `…`. See [Drama 3](/features/text-to-speech/drama-3). - **`s2-pro`**: previous-generation S2 model with multi-speaker and natural-language expression control. -- **`s1`**: previous generation, `(parenthesis)` emotion tags. S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). +- **`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). diff --git a/features/voice-cloning.mdx b/features/voice-cloning.mdx index 5878421c..f2555287 100644 --- a/features/voice-cloning.mdx +++ b/features/voice-cloning.mdx @@ -109,7 +109,7 @@ audio = client.tts.convert( curl --request POST https://api.fish.audio/v1/tts \ --header "Authorization: Bearer $FISH_API_KEY" \ --header "Content-Type: application/json" \ - --header "model: s2-pro" \ + --header "model: s3-pro" \ --data '{ "text": "Now I speak in my cloned voice.", "reference_id": "YOUR_VOICE_ID" }' \ --output out.mp3 ``` diff --git a/llms.txt b/llms.txt index 24153da1..6f09042e 100644 --- a/llms.txt +++ b/llms.txt @@ -18,7 +18,7 @@ - [API Introduction](https://docs.fish.audio/api-reference/introduction.md): How to use the Fish Audio API. - [Text to Speech Endpoint](https://docs.fish.audio/api-reference/endpoint/openapi-v1/text-to-speech.md): Convert text to speech. -- [Speech to Text Endpoint](https://docs.fish.audio/api-reference/endpoint/openapi-v1/speech-to-text.md): Transcribe audio with transcribe-1-pro (recommended; select it with the model header) or transcribe-1; request fields, timestamps, speaker turns, limits, formats and errors. +- [Speech to Text Endpoint](https://docs.fish.audio/api-reference/endpoint/openapi-v1/speech-to-text.md): Transcribe audio with transcribe-2-pro (recommended; select it with the model header), transcribe-1-pro or transcribe-1; request fields, timestamps, speaker turns, text format, verbatim, key terms, limits, formats and errors. - [Audio Infill Endpoint](https://docs.fish.audio/api-reference/endpoint/openapi-v1/audio-infill.md): Regenerate part of a recording with drama-3 (POST /v1/audio/infill) and get the whole take back; request shapes, positions, length of the new span, response and stream events. - [Voice Design Endpoint](https://docs.fish.audio/api-reference/endpoint/openapi-v1/voice-design.md): Generate candidate voices from a prompt. - [List Models](https://docs.fish.audio/api-reference/endpoint/model/list-models.md): Get a list of all models. @@ -54,7 +54,7 @@ - [Text to Speech Guide](https://docs.fish.audio/features/text-to-speech.md): Generate natural speech from text, with Python SDK, JavaScript SDK, and curl examples, plus voice selection, output formats, speed, latency settings, and word timestamps in the Python SDK. - [Drama 3](https://docs.fish.audio/features/text-to-speech/drama-3.md): Text-to-speech model (drama-3) directed with plain-language directions in square brackets, sounds and pauses, paired tags for specific words, and multi-speaker dialogue. - [Audio Infill](https://docs.fish.audio/features/text-to-speech/audio-infill.md): Apply a script change to an existing recording with drama-3: send the take, the full revised transcript and the span to replace, and get the whole take back. -- [Speech to Text Guide](https://docs.fish.audio/features/speech-to-text.md): Transcribe audio with transcribe-1-pro, including multi-speaker conversations with speaker turns, long recordings and inline emotion cues. +- [Speech to Text Guide](https://docs.fish.audio/features/speech-to-text.md): Transcribe audio with transcribe-2-pro (recommended) or transcribe-1-pro, including multi-speaker conversations with speaker turns, long recordings and inline emotion cues. - [Realtime Speech to Text](https://docs.fish.audio/features/speech-to-text/realtime.md): Transcribe live audio turn by turn with transcribe-stream-1: turn detection, eager end of turn, backchannel detection and conversation context for voice agents. - [Transcribe a Live Audio Stream](https://docs.fish.audio/developer-guide/sdk-guide/cookbook/realtime-transcription.md): Python and Node.js clients for the realtime speech-to-text WebSocket (transcribe-stream-1), plus a browser microphone relay. - [Build a Realtime Voice Agent](https://docs.fish.audio/developer-guide/sdk-guide/cookbook/realtime-voice-agent.md): Agent loop on realtime speech to text (transcribe-stream-1): eager replies, agent_speaking, barge-in and backchannels. @@ -123,7 +123,7 @@ - [Legacy Models](https://docs.fish.audio/developer-guide/models-pricing/models/legacy.md): Specifications for S2.1-Pro, S2-Pro, the deprecated S1, and Transcribe 1 (transcribe-1-pro, transcribe-stream-1, and the deprecated transcribe-1). - [Pricing And Rate Limits](https://docs.fish.audio/developer-guide/models-pricing/pricing-and-rate-limits.md): Understand pricing, usage costs, and API rate limits. - [Model Deprecations](https://docs.fish.audio/developer-guide/models-pricing/deprecations.md): Track deprecated models and migration timelines. -- [Migrate from S1](https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1.md): Move text-to-speech requests from the deprecated S1 model to S2.1-Pro before S1 is retired on December 31, 2026. -- [Migrate from transcribe-1](https://docs.fish.audio/developer-guide/models-pricing/migrate-from-transcribe-1.md): Move speech-to-text requests from the deprecated transcribe-1 model to transcribe-1-pro before transcribe-1 is retired on December 31, 2026. +- [Migrate from S1](https://docs.fish.audio/developer-guide/models-pricing/migrate-from-s1.md): Move text-to-speech requests from the deprecated S1 model to S3 Pro before S1 is retired on December 31, 2026. +- [Migrate from transcribe-1](https://docs.fish.audio/developer-guide/models-pricing/migrate-from-transcribe-1.md): Move speech-to-text requests from the deprecated transcribe-1 model to transcribe-2-pro before transcribe-1 is retired on December 31, 2026. - [Migration Guide](https://docs.fish.audio/developer-guide/getting-started/migration.md): Switch from ElevenLabs, OpenAI, or other TTS providers to Fish Audio. - [Changelog](https://docs.fish.audio/developer-guide/getting-started/changelog.md): Complete release history and version updates for Fish Audio products. diff --git a/overview/capabilities.mdx b/overview/capabilities.mdx index d7bd9d99..49a5e476 100644 --- a/overview/capabilities.mdx +++ b/overview/capabilities.mdx @@ -74,13 +74,13 @@ These text-to-speech models power most capabilities: - **Live 3**: full-duplex speech model for voice agents. Available to selected partners and on the [Fish Audio Agent Platform](/agents/overview), where it is the default for new English sessions. - **`s2.1-pro`**: improved quality, latency, and throughput over S2-Pro, with TTFA and DPA guarantees available under an enterprise agreement. - **`s2-pro`**: the previous-generation S2 model, with multi-speaker and natural-language expression control. -- **`s1`**: the previous generation, with `(parenthesis)` emotion tags. S1 is deprecated and will be retired on December 31, 2026. After that date, requests that specify `s1` are served by `s2.1-pro`. See [Migrate from S1](/developer-guide/models-pricing/migrate-from-s1). +- **`s1`**: the previous generation, with `(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). For speech to text, select the model with the `model` header on `POST /v1/asr`: - **`transcribe-2-pro`**: the recommended model, with the same request fields and response format as `transcribe-1-pro`, plus language hints, written or spoken numbers, a verbatim option, and key terms. Send `model: transcribe-2-pro` explicitly. See [Transcribe 2](/developer-guide/models-pricing/models/transcribe-2). - **`transcribe-1-pro`**: the previous Pro model, for everything from short clips to multi-speaker conversations (speaker markers and speaker turns) and long recordings, with inline emotion cues. Send `model: transcribe-1-pro` explicitly. -- **`transcribe-1`** (deprecated, retiring December 31, 2026): general transcription of short recordings. A request whose `model` header is missing or not an exact match is served by this model. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). +- **`transcribe-1`** (deprecated, retiring December 31, 2026): general transcription of short recordings. A request whose `model` header is missing or not an exact match is served by this model; after retirement, by `transcribe-2-pro`. See [Migrate from transcribe-1](/developer-guide/models-pricing/migrate-from-transcribe-1). To transcribe live audio, `transcribe-stream-2` (recommended) and `transcribe-stream-1` (the default when no `model` header is sent) stream transcripts turn by turn over a WebSocket, with turn detection for voice agents. They are available through the API; see [Realtime Speech to Text](/features/speech-to-text/realtime).