## TL;DR

Use a short-lived write token for client-side connections and treat 4001 as an auth/refresh signal. When opening a Rev AI streaming WebSocket, always pass content_type, and for raw audio include layout, rate, format, and channels or the socket closes with 4002.

## Steps

1. Use a short-lived write token for client-side connections and treat 4001 as an auth/refresh signal.

2. When opening a Rev AI streaming WebSocket, always pass content_type, and for raw audio include layout, rate, format, and channels or the socket closes with 4002.

## When to use

You are seeing this: Every request must carry a content_type query parameter; audio/x-raw additionally requires layout, rate, format, and channels. Use this skill when you run into "Rev AI streaming: content_type required, bad token closes with 4001".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
