Skip to content

docs: fix ASR content-type warning + document WS HTTP/1.1 handshake - #115

Open
M2Night wants to merge 1 commit into
mainfrom
vercel-asr-tts-doc-fixes
Open

docs: fix ASR content-type warning + document WS HTTP/1.1 handshake#115
M2Night wants to merge 1 commit into
mainfrom
vercel-asr-tts-doc-fixes

Conversation

@M2Night

@M2Night M2Night commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

Two documentation fixes found while helping Vercel build a Fish Audio provider for the AI SDK.

Changes

  • Speech to Text warning (speech-to-text.mdx): application/form-data is not a real MIME type → multipart/form-data; also note application/json is not usable (the audio field cannot be carried as JSON/base64). Verified: JSON+base64 → HTTP 400; multipart/form-data → 200.
  • WebSocket TTS (asyncapi.yml): document that the handshake must use HTTP/1.1 — HTTP/2 upgrade requests are rejected with 400 "invalid protocol". Verified live (curl --http1.1101; default HTTP/2 → 400 invalid protocol).

Note

The /v1/asr OpenAPI content-type list itself is corrected in the companion platform-api PR (that repo generates openapi.json, synced here via scripts/update-openapi.mjs).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Documentation
    • Added WebSocket handshake requirements clarifying that HTTP/1.1 protocol must be used and HTTP/2 clients will be rejected with a 400 error.
    • Corrected file upload MIME type documentation to multipart/form-data with clarification that application/json is not accepted for audio data submission.

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) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
hanabiaiinc 🟢 Ready View Preview Aug 4, 2026, 3:50 PM

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

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The API documentation now defines the HTTP/1.1 requirement for ttsLive WebSocket handshakes and corrects Speech to Text content-type guidance.

Changes

API documentation updates

Layer / File(s) Summary
WebSocket handshake requirements
api-reference/asyncapi.yml
Documents the HTTP/1.1 requirement and the 400 invalid protocol response for HTTP/2 clients.
Speech to Text request format
api-reference/endpoint/openapi-v1/speech-to-text.mdx
Corrects the MIME type to multipart/form-data and states that application/json with JSON/base64 audio is not accepted.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • fishaudio/docs#24: Updates the same api-reference/asyncapi.yml TTS WebSocket specification.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes both documentation changes: the ASR content type correction and the WebSocket HTTP/1.1 handshake requirement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vercel-asr-tts-doc-fixes

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api-reference/endpoint/openapi-v1/speech-to-text.mdx`:
- Line 10: Update the endpoint description to explicitly state that it rejects
JSON request bodies containing base64-encoded audio, while preserving the listed
accepted content types and avoiding the ambiguous “JSON/base64” phrasing.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 133e26a3-9998-4324-9f24-e2f8a865d17a

📥 Commits

Reviewing files that changed from the base of the PR and between fc0fcb8 and a454133.

📒 Files selected for processing (2)
  • api-reference/asyncapi.yml
  • api-reference/endpoint/openapi-v1/speech-to-text.mdx


<Warning>
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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clarify the JSON restriction.

JSON/base64 combines a media type and an encoding. State that the endpoint rejects JSON bodies with base64-encoded audio.

Proposed wording
-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).
+This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` with base64-encoded audio.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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).
This BETA endpoint only accepts `multipart/form-data` and `application/msgpack`. It does not accept `application/json` with base64-encoded audio.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api-reference/endpoint/openapi-v1/speech-to-text.mdx` at line 10, Update the
endpoint description to explicitly state that it rejects JSON request bodies
containing base64-encoded audio, while preserving the listed accepted content
types and avoiding the ambiguous “JSON/base64” phrasing.

Source: Coding guidelines

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