Connect and stream
Authenticate
Pass your API key as a query parameter on the connection URL. Unlike the batch endpoints, there is no See Authentication and rate limits for how to obtain a key.
X-API-Key header.Choose your audio format
Set
audio_format to match what you’re sending.Container formats (no sample_rate or num_channels needed): wav, mp3, ogg, flac, webm, aac, aiffRaw PCM formats (sample_rate and num_channels required): s16le, s16be, s32le, s32be, f32le, f32be, and others — see the API reference for the full list.Stream audio and read frames
Send audio as binary WebSocket frames in any chunk size. The server emits a Music and speech probabilities are independent — both can be high simultaneously (e.g. music with vocals).
frame message after each 192ms of audio processed:Code examples
- Python — raw PCM
- Python — container format
- JavaScript (Node.js)
WebSocket APIs cannot be tested with cURL. For command-line testing, use
websocat.Next steps
- Music detection streaming reference — full protocol docs, all close codes, and parameter reference
- Music detection batch — classify a complete file with a single HTTP POST
- Audio formats — supported formats across all APIs