From a454133cd634ec59f56e24f0a817e7122e0c0cb9 Mon Sep 17 00:00:00 2001 From: M2Night Date: Tue, 4 Aug 2026 23:48:08 +0800 Subject: [PATCH] docs: fix ASR content-type warning + document WS HTTP/1.1 handshake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found while helping Vercel build a Fish Audio provider for the AI SDK. - Speech to Text warning: the endpoint accepts multipart/form-data (not the non-existent "application/form-data") and application/msgpack; note that application/json is not usable (audio cannot be carried as JSON/base64). - WebSocket TTS (asyncapi): document that the handshake must use HTTP/1.1 — HTTP/2 upgrade requests are rejected with 400 "invalid protocol". Co-Authored-By: Claude Opus 4.8 (1M context) --- api-reference/asyncapi.yml | 3 +++ api-reference/endpoint/openapi-v1/speech-to-text.mdx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api-reference/asyncapi.yml b/api-reference/asyncapi.yml index 1f4b5e9..6700ffd 100644 --- a/api-reference/asyncapi.yml +++ b/api-reference/asyncapi.yml @@ -72,6 +72,9 @@ channels: - `Authorization: Bearer ` - Required for authentication (see security section) - `model: ` - Optional; specifies which TTS model to use (see bindings). Falls back to `s2.1-pro` when omitted or unrecognized + ## Handshake + The WebSocket handshake must be performed over **HTTP/1.1**. HTTP/2 clients are rejected with `400 invalid protocol`, so disable HTTP/2 for the upgrade request (e.g. `curl --http1.1`). + operations: receiveText: action: receive diff --git a/api-reference/endpoint/openapi-v1/speech-to-text.mdx b/api-reference/endpoint/openapi-v1/speech-to-text.mdx index 660a31a..dca1978 100644 --- a/api-reference/endpoint/openapi-v1/speech-to-text.mdx +++ b/api-reference/endpoint/openapi-v1/speech-to-text.mdx @@ -7,5 +7,5 @@ iconType: "solid" --- -This BETA endpoint only accepts `application/form-data` and `application/msgpack`. +This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` (the audio field cannot be carried as JSON/base64).