Skip to content

docs(realtime-stt): document transcribe-stream-2 and results.text_format - #403

Draft
liujiahua123123 wants to merge 1 commit into
mainfrom
docs/transcribe-stream-2
Draft

liujiahua123123 wants to merge 1 commit into
mainfrom
docs/transcribe-stream-2

Conversation

@liujiahua123123

@liujiahua123123 liujiahua123123 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Do not merge until the public endpoint checks under "Before merging" have passed: live sessions through wss://api.fish.audio/v1/asr/realtime, with model: transcribe-stream-2 routed to the new model, including billing at $0.12 per session hour. Where that stands:

  1. Done (2026-11-25): the transcribe-stream-2 deployment in the region that serves it is installed, and a direct test of it passed (not through the public endpoint; see "Tested so far").
  2. Approved on 2026-11-25, in progress: routing model: transcribe-stream-2 on the public endpoint. The deploy order puts the failover setup for transcribe-stream-2 in place first, in the other regions that serve this endpoint: a connection that names transcribe-stream-2 there is passed on to transcribe-stream-2 when it can take it and refused otherwise, and is not handed to transcribe-stream-1 (known gaps aside, see "Decided").
  3. Open: the public endpoint checks, once 2 is done.

The launch date is to be confirmed. If the launch is rolled back after this PR has merged, revert this PR as part of the rollback.

What changes

transcribe-stream-2 is a second realtime speech-to-text model on the same WebSocket endpoint. The client picks it with the model handshake header, as the docs already describe for transcribe-stream-1. Both models speak the same protocol; the one addition is results.text_format, which only transcribe-stream-2 takes. transcribe-stream-1 stays the default model: a connection without a model header gets it, as today, and the pages say so.

  • api-reference/endpoint/websocket/asr-realtime.mdx:
    • The model header row lists both models.
    • A new Models subsection under Connect: prices; transcribe-stream-1 stays the default; the header value must be exact, and any other value or no header gets a transcribe-stream-1 session, billed as such. A connection that names transcribe-stream-2 is meant to be served by it. While that model is temporarily unavailable, the handshake can be refused with a 5xx status (connect again with backoff), or the session can start and its turns can get error with engine_error, each followed by a degraded committed, and the session continues. session_started.config.model names the model that serves the session, and the session is billed at that model's price, so check it.
    • The handshake refusal table lists 502 and 504, and 503 now means restarting or temporarily unavailable. The x-request-id sentence names the header only on the 101 and the capacity 429, and says a 502, 503 or 504 refusal can come with or without one.
    • results.text_format in the config table and the wrong-value rule (null counts as not sent, so it is not a wrong value). The configure paragraph says turn_detection, results and context take the same values as in config, except results.text_format, which is set in config for the whole session. config.model in the session_started table.
    • A new Text format section: spoken/written with examples, chosen in config for the whole session, applies to drafts, eager_end_of_turn and committed, echo, null, the invalid-value message, and how transcribe-stream-1 refuses it in config, described by error type and close code without quoting its message. The pages say nothing about text_format in configure beyond that exception, for either model: no sentence singles out transcribe-stream-1 refusing it there, because read together such sentences implied that transcribe-stream-2 accepts it. Neither value is recommended.
  • api-reference/asyncapi-asr-realtime.yml: transcribe-stream-2 in the model header enum and the connection headers; text_format in AsrResults (default written; null allowed, as the reference page says); config.model mentioned on session_started. AsrResultsUpdate (configure) does not list text_format (see open point 1); that schema does not forbid other fields, so leaving it out claims no refusal. The spec documents no handshake refusals, so the 5xx refusals are not in it either.
  • features/speech-to-text/realtime.mdx: description and intro name both models; a Models section with the same wording on an unavailable transcribe-stream-2 (a refused handshake with a 5xx status, connect again with backoff; or a session whose turns get an error while the session continues; check session_started.config.model, which also sets the price); the quick start's Connect step says to send model: transcribe-stream-2; a Numbers and times note under Implementation details (set in config, for the whole session); both prices (the two dollar amounts in the Pricing paragraph are escaped, because the docs build otherwise reads the text between them as inline math). The latency figures are now labelled as measured with transcribe-stream-1 (they were; nothing is claimed for transcribe-stream-2).
  • developer-guide/models-pricing/pricing-and-rate-limits.mdx: transcribe-stream-2 (Realtime ASR) at $0.12 / session hour; the Realtime ASR billing rules now cover both models, at the price of the session's model; the header rule.
  • overview/capabilities.mdx, llms.txt: name both realtime models.

The PR is one commit on main. Its message describes the pages as they are and makes no promise the pages do not make.

Decided

  • transcribe-stream-2 is not replaced by transcribe-stream-1 by design (decided 2026-11-24). When the endpoint fails over, a connection that names transcribe-stream-2 is passed on to transcribe-stream-2 when it can take it, and refused otherwise. This is how the deployment is set up, not something the pages can promise without exception, because of the known gaps below. So both Models sections say: a connection that names transcribe-stream-2 is meant to be served by transcribe-stream-2; while that model is temporarily unavailable, the handshake can be refused with a 5xx status, or the session can start and its turns can get an error; session_started.config.model names the model that serves the session, and the session is billed at that model's price, so check it.
  • Known gaps (described here, not fixed in this PR):
    1. A routing instance that starts without a route for transcribe-stream-2. A routing instance learns a deployment's route from a ready instance of that deployment and keeps a route it has learned, so instances already running keep it. One that starts while no instance of the deployment is ready has no route for it, and sends a connection that names transcribe-stream-2 to its default route:

      • In the region that serves transcribe-stream-2, this happens if the routing instance starts while none of transcribe-stream-2's instances is ready. The default route there is transcribe-stream-1.
      • In another region whose default route is a local transcribe-stream-1, it happens if the routing instance starts while that region's stand-in for transcribe-stream-2 (two instances, on different machines) has no ready instance. transcribe-stream-2 itself can be up meanwhile.
      • In a region whose default route passes connections on to another region, a routing instance that starts while that region's stand-in has no ready instance passes the connection on. The region that receives it routes it again by its own routes: it passes it to transcribe-stream-2 or refuses it (a connection is passed on only once), unless it has no route for transcribe-stream-2 either. So this case also needs the receiving region's route to be missing.

      When it happens, the connection gets a transcribe-stream-1 session, billed as transcribe-stream-1: session_started.config.model shows transcribe-stream-1, and a config that sends results.text_format gets invalid_config and close 4400, as the pages describe for transcribe-stream-1. The windows are narrow. The same happens once transcribe-stream-2 is removed (a rollback, when this PR is reverted too). A later service change, a transcribe-stream-1 that refuses a model header naming another model, could close the gap.

    2. Service up, engine down. When the service that accepts transcribe-stream-2 connections is up but its transcription engine cannot be reached, the handshake succeeds. The session opens and runs (and is billed per second as usual), and each turn gets error with engine_error (code 503, or 504 on a timeout), then a degraded committed. The pages cover this: the Models sentence, and Degraded commits and the errors table on the WebSocket reference.

    3. A routing instance that starts while its settings store does not answer (not a path to transcribe-stream-1). It runs without the failover setting for transcribe-stream-2 until it is restarted. In the other regions it then sends a connection that names transcribe-stream-2 to the local stand-in, so the connection can be refused with a 5xx even while transcribe-stream-2 could take it. A routing instance that is already running when the store stops answering keeps its last setting.

  • Handshake refusals. The WebSocket reference's refusal table now has 502 (the service could not be reached) and 504 (the service did not answer in time), and its 503 row reads "restarting or temporarily unavailable"; all three say retry with backoff. Which one a client gets depends on how the outage is detected (read in the service code), so the Models sections say only "a 5xx status". Refusals from the routing layer do not set an x-request-id, and a client cannot tell a restarting 503 from another 503, so the x-request-id sentence now names only the 101 and the capacity 429, and says a 502, 503 or 504 refusal can come with or without one. (On main it also names the 503.)
  • No reconnect advice after engine_error. The pages say "connect again with backoff" only for a refused handshake. For engine_error during a session they say the session continues, as Degraded commits and the errors table already do (it is recoverable).

Open points

  1. Changing text_format during a session (open). The pages document text_format in config only, chosen for the whole session, and the configure paragraph names it as the exception to "the same values as in config". They neither offer changing it with configure nor say the server refuses it there, and the AsyncAPI configure schema does not list it. A change of text_format in the middle of a session has not been evaluated, so the pages do not offer it; whether to offer it later is open. If it is offered, drop the exception from the configure paragraph and add it to the configure timing rule, the Text format section and AsrResultsUpdate.
  2. Default value (decided 2026-11-25). "written" is the default (the service's default since 2026-11-25); the pages call it the default and recommend neither value otherwise.
  3. Preview label. transcribe-stream-1 keeps its Preview label and the "is in preview" notes. transcribe-stream-2 has no label either way. Decide whether it is Preview.
  4. Legacy alias. The model header row on the WebSocket reference and in the AsyncAPI spec used to name the realtime model's legacy alias (its name before the 2026-10-20 rename). Both lines had to be rewritten, and the new text no longer names the alias. Requests that use it still reach transcribe-stream-1: they are covered by "any other value". Say so if the alias should be named again.
  5. Models overview not edited. developer-guide/models-pricing/models-overview.mdx should list transcribe-stream-2 in its Speech-to-Text Models table. I left the page alone because the transcribe-1-pro row has an emotion-cue example in a non-Latin script, and this PR keeps to files without such text. The batch launch will probably rewrite that table; add the realtime row then, or tell me to edit the page here.
  6. No batch text_format docs yet. No text_format docs for the batch API are on main or in an open PR, so the realtime Text format section does not refer to the batch API. When the batch docs land, the two sections can link to each other. State each default explicitly in both.
  7. Languages. The realtime language list (29 language_code values) comes from the server's per-message language detection, which is the same for both models, so it is unchanged. If transcribe-stream-2 should advertise a different set of transcription languages, that is a separate decision and change.
  8. Not touched:
  9. Price rounding. The pages say $0.12 / session hour, as decided. If billing stores a rounded per-second rate, the hourly figure is approximate, as it is for other per-second prices.
  10. Changelog entry at launch (recommended). main now has a changelog entry for each model release, transcribe-stream-1 included (October 20, 2026, added in docs(changelog): add October–November 2026 product and model releases #404). transcribe-stream-2 should get one too, dated the day it goes live. It is not in this PR because the launch date is not confirmed. Add it as the last commit before this PR merges (the merge follows the live verification anyway), or as a small PR on launch day. A proposed entry is below; bring it in line with the open points decided by then (Preview label). Dollar amounts are escaped as in the other changelog entries.
Proposed entry for developer-guide/getting-started/changelog.mdx
<Update label="Realtime Speech to Text (transcribe-stream-2)" description="LAUNCH DATE" tags={["Fish Audio"]}>
  ## Realtime Speech to Text (`transcribe-stream-2`)

  `transcribe-stream-2` is a second realtime speech-to-text model on `wss://api.fish.audio/v1/asr/realtime`, at \$0.12 per session hour. Select it with the `model: transcribe-stream-2` header. It uses the same protocol, turn detection and limits as `transcribe-stream-1`, which stays the default. Set `results.text_format` in `config` to choose the style for numbers, amounts and times: `"spoken"` (words, the default) or `"written"` (digits and symbols).

  [Realtime Speech to Text](/features/speech-to-text/realtime#models) | [WebSocket reference](/api-reference/endpoint/websocket/asr-realtime#models)
</Update>

Tested so far

  • Released and installed. The realtime service changes that add results.text_format and the second, non-default model route on the same endpoint are released (realtime service 4.2.0, 2026-11-24), and the transcribe-stream-2 deployment runs that release (installed 2026-11-25).
  • Direct test of the installed deployment (not through the public endpoint): a session reports session_started.config.model: "transcribe-stream-2"; "spoken" gives words; "written" gives digits and symbols ("$25", "3:30", "4172"), as the pages describe.
  • Not tried yet: everything through the public endpoint, including the header routing and billing (merge gate above). The validation and the invalid-value message, the echo and null come from the service's protocol notes and code; they are in the live checks below.
  • transcribe-stream-1's refusal of text_format in config is documented by its effect only (invalid_config, close 4400, a message that names the field). Its message text is not quoted because it differs between service releases; the releases checked all name results.text_format in it. In configure it answers configured with ok: false; the pages leave that to the general rule for unknown fields in configure.
  • What happens to a connection that names an unavailable transcribe-stream-2 comes from how the service is deployed and routed, not from the realtime service's own code. It was read in that deployment and routing code, not tried: an outage cannot be staged on the public endpoint.

Before merging

Check with live sessions through wss://api.fish.audio/v1/asr/realtime:

  • model: transcribe-stream-2 gets session_started.config.model: "transcribe-stream-2" and results.text_format: "written" (the default since 2026-11-25).
  • "written" gives digits ("$25", "3:30").
  • A config with "results": {"text_format": 5} gets invalid_config, close 4400 and the must-be message; null is accepted and gives "written".
  • No header gets transcribe-stream-1.
  • transcribe-stream-1 with any text_format gets invalid_config and close 4400.
  • Billing shows transcribe-stream-2 sessions at the new price.

Checks

The branch is one commit on main (fd7bdc6): the six earlier commits squashed, with one message for the whole change. Changes since the previous head (45c845e): the Models sentence on an unavailable transcribe-stream-2 in both pages (no reconnect advice after engine_error, no "always"), and the x-request-id sentence on the WebSocket reference. Re-run on this commit:

  • prettier --check (prettier 3.6.2, the repo's version) on the changed .mdx/.yml files: clean, except overview/capabilities.mdx, which already fails on main (its Card blocks). This PR changes one other line there.
  • mint broken-links (mint 4.3.88): no findings in the changed files. The 8 existing findings are in api-reference/sdk/python/overview.mdx and temp/. With --check-anchors on the four changed .mdx pages: no findings, so the links #connect, #errors-and-close-codes and #degraded-commits resolve (the same check reports a deliberately broken #degraded-commitz).
  • mint validate (mint 4.3.88): no findings in the changed files. The 7 existing errors are in snippets/*.jsx and temp/.
  • mint dev: api-reference/endpoint/websocket/asr-realtime and features/speech-to-text/realtime render (HTTP 200) with the new sentences; in the WebSocket reference the Models paragraph has error, engine_error, committed and session_started.config.model as code and the links to Connect, Errors and close codes and Degraded commits.
  • @asyncapi/parser 3 on api-reference/asyncapi-asr-realtime.yml: parsed with no errors or warnings in an earlier round; the YAML has not changed since. It reads back as intended: AsrResults.text_format is spoken, written or null, default spoken; AsrResultsUpdate has no text_format.
  • CI on this commit: Mintlify Deployment succeeded; vale-spellcheck and link-rot neutral; update-openapi and Proof skipped. check-openapi failed (04:51:40Z), as on the previous head, for a reason unrelated to this PR; its job log's diff touches only api-reference/openapi.json. It pulls the live OpenAPI schema and compares it with the committed api-reference/openapi.json, and the live schema has moved ahead of main (the Agents asr.model description and the phone-number status_reason field). This PR does not touch openapi.json. The open automatic schema update, chore: update OpenAPI schema #408, carries that change, and the check fails the same way on any PR until it merges.
  • Not run: the cookbook tests. No code example changed.

Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@mintlify

mintlify Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hanabiaiinc 🟢 Ready View Preview Nov 25, 2026, 8:15 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

transcribe-stream-2 is a second realtime speech-to-text model on
wss://api.fish.audio/v1/asr/realtime, at $0.12 per session hour, with the
same protocol as transcribe-stream-1. transcribe-stream-1 stays the
default: a connection without the model header, or with any other value,
gets a transcribe-stream-1 session, billed as transcribe-stream-1.

- WebSocket reference: the model header row names both models (it no
  longer names the legacy alias, which "any other value" covers). A new
  Models subsection gives the prices and the header rule. A connection
  that names transcribe-stream-2 is meant to be served by it. While that
  model is temporarily unavailable, the handshake can be refused with a
  5xx status (connect again with backoff), or the session can start and
  its turns can get engine_error, each followed by a degraded committed,
  and the session continues. session_started.config.model names the
  model that serves the session, and the session is billed at that
  model's price.
- Handshake refusals: new 502 and 504 rows, and the 503 row reads
  "restarting or temporarily unavailable". x-request-id is named only on
  the 101 and the capacity 429; a 502, 503 or 504 refusal can come with
  or without one.
- results.text_format for transcribe-stream-2: "written" (the default) or
  "spoken", set in config for the whole session; null is the same as
  leaving it out. A new Text format section, the config table and the
  wrong-value rule. transcribe-stream-1 refuses a config that sends it
  with invalid_config and close 4400. The configure paragraph names it as
  the exception to "the same values as in config".
- AsyncAPI: transcribe-stream-2 in the model header enum and the
  connection headers, text_format in AsrResults, config.model on
  session_started.
- Realtime feature page: both models, a Models section with the same
  wording on an unavailable transcribe-stream-2, the model header in the
  quick start, a Numbers and times note, both prices (dollar signs
  escaped), and the latency figures labelled as measured with
  transcribe-stream-1.
- Pricing: transcribe-stream-2 at $0.12 per session hour; Realtime ASR is
  billed at the price of the session's model.
- Capabilities overview and llms.txt name both realtime models.
@liujiahua123123
liujiahua123123 force-pushed the docs/transcribe-stream-2 branch from 8349d07 to 4c9ad23 Compare November 25, 2026 08:14
leng-yue added a commit that referenced this pull request Dec 2, 2026
… model card, and Capabilities

transcribe-stream-2 serves the realtime WebSocket alongside transcribe-stream-1,
which stays the default; it is selected with `model: transcribe-stream-2` and
takes `results.text_format`. The realtime page, its API reference and the
pricing row are in #403. Ship this commit with #403, at the transcribe-stream-2
launch; revert it if the docs ship first.
leng-yue added a commit that referenced this pull request Dec 2, 2026
…cross pages

The realtime API reference and AsyncAPI file list transcribe-stream-2 next to
the default transcribe-stream-1 (exact header value; anything else gets
transcribe-stream-1); the Realtime Speech to Text page has a Models section
with results.text_format; the Models Overview card links to that page. Facts
from #403. Prices and the full #403 changes stay in #403. Ship with the
transcribe-stream-2 launch, together with 9a19c6d.
leng-yue added a commit that referenced this pull request Dec 2, 2026
…ealtime reference

- Pricing & Rate Limits: transcribe-stream-2 at $0.26 / session hour, with a
  launch price of $0.12 / session hour through December 31, 2026; the model
  header rule and per-model billing for Realtime ASR.
- Realtime API reference and AsyncAPI: results.text_format in the config
  results (transcribe-stream-2 only, "spoken" or "written", default
  "written"; transcribe-stream-1 refuses it); configure does not change it.
- Realtime Speech to Text: transcribe-stream-1 refuses text_format with
  invalid_config.
Facts from #403 and the STT launch owner. Ship with the transcribe-stream-2
launch.
leng-yue added a commit that referenced this pull request Dec 2, 2026
… the recommended speech-to-text models

- New Transcribe 2 model card (Model Cards group): both models, endpoints,
  headers, launch and list prices, what transcribe-2-pro adds (language hints,
  text_format, verbatim, keyterms; 39 recommended languages), and what
  transcribe-stream-2 offers on the realtime endpoint.
- Models Overview: the Choose a Model table, the speech-to-text diagram
  (transcribe-1-pro -> transcribe-2-pro, transcribe-stream-1 ->
  transcribe-stream-2) and the cards recommend Transcribe 2.
- Transcribe 1 card: points new projects to Transcribe 2.
- Pricing: transcribe-2-pro at $0.16 / audio hour, with the $0.06 launch price
  through December 31, 2026; recommended labels move to Transcribe 2.
- Capabilities, Model Deprecations, changelog and llms.txt follow.
Facts from #456, #403 and the STT launch owner.

This branch was successfully deployed

1 active deployment
staging — 4c9ad236 Deployed Nov 25, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant