docs
Build with Quak
One REST API for everything Quak does: text-to-speech, sounds, your own clips and push-to-talk on your Sonos speakers. JSON in, JSON out, one API key.
Quickstart
Before the first call:
- Sign up, free with credits to start.
- Connect your Sonos account in the web app (Settings → Speakers). Sonos asks you to log in on its own page, in the browser, so this step has no API call of its own.
- Get an API key: make one in the web app under Settings → API keys, or log in from a script (see Authentication).
- Look up the slugs of your speakers and groups (
GET /v1/speakers). - Play something:
curl https://api.quak.party/v1/play/text \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{"text": "Dinner is ready!", "to": ["kitchen", "living-room"]}'That's a short text with your default voice on two speakers. The response is the play in data, with its id, status and creditsUsed; the header X-Quak-Credits carries your balance afterwards. Check data.status: in quiet hours it is SKIPPED and nothing played (see Kinds of plays).
Bodies are JSON with Content-Type: application/json; curl's --json sets it for you. Uploads (talk, files, clips) go as multipart/form-data, like curl's -F. In tools where you set the headers yourself, such as Shortcuts, Postman or Zapier, add it by hand:
curl -X POST https://api.quak.party/v1/play/text \
-H "Authorization: Bearer $QUAK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Dinner is ready!"}'Authentication
Send your API key as a bearer token: Authorization: Bearer <API_KEY>. The query parameter ?apikey=<API_KEY> works too, for tools that can't set headers. Keep the key secret, it can play on your speakers and spend your credits.
You get a key by logging in with your email, no password involved. The app does this for you, from a script it takes three steps:
# 1. start the login, Quak sends you an email
curl https://api.quak.party/v1/user/login \
--json '{"email": "you@example.com"}'
# → {"data": {"verifyToken": "…", "loginPhrase": "…", "expiresAt": "…"}}
# 2. click "Confirm login" in the email (check the phrase matches)
# 3. exchange the token for an API key, waits up to 180 s for your click
curl https://api.quak.party/v1/user/login/key \
--json '{"verifyToken": "…", "waitForConfirmation": true}'
# → 200 {"data": {"apiKey": "qk_key_…"}}
# not clicked yet: 202 {"data": {"status": "PENDING", "message": "…"}}, ask again after Retry-AfterWith that key you can create more keys with a name, one per integration, so you can revoke them one by one. Each key has a scope: play (the default) makes announcements and sees every list, create also adds clips, manage can change settings, groups and keys too. The full key is shown once, GET /v1/keys lists your keys with their scope and request and play counts, without the key itself.
curl https://api.quak.party/v1/keys \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{"name": "home-assistant", "scope": "play"}'
# → 201 {"data": {"id": "…", "name": "home-assistant", "scope": "play", …, "apiKey": "qk_key_…"}} (shown once)Speakers
You can play on a single speaker, a group or all your speakers. Each has a slug like kitchen that you pass in to. Without to, Quak uses your default speakers. Your own groups are managed with /v1/groups.
curl https://api.quak.party/v1/speakers \
-H "Authorization: Bearer $QUAK_API_KEY"Kinds of plays
Every play route answers with the play in data. Always check data.status, the HTTP status alone says whether it played:
| Status | Means |
|---|---|
| 201 | Played (or, with preview, the audio was made). The play has its speakers and creditsUsed. |
| 202 | Scheduled with startIn: status: "SCHEDULED", it plays at startsAt. |
| 200 | Not played and not charged: status: "SKIPPED" with skipReason QUIET_HOURS, or BUSY when every speaker plays something more important. |
Every play lands in the history (GET /v1/plays) and can be stopped while it runs (POST /v1/plays/{id}/stop).
| Route | What |
|---|---|
POST /v1/play/text | Speak a text with a voice from /v1/voices |
POST /v1/play/talk | A recording from the mic, plays when you let go (multipart) |
POST /v1/play/sound | A built-in sound from /v1/sounds |
POST /v1/play/clip | One of your own clips from /v1/clips |
POST /v1/play/file | An uploaded file (multipart) |
POST /v1/play/url | Audio from a URL, with or without processing |
Announcements are short: texts up to 1,000 characters (about a minute spoken), recordings, talk live, files, processed URLs and clips up to 3 minutes, uploads up to 10 MB. Unprocessed URLs have no limit, Sonos fetches them itself. Every kind below as a small and a fuller call, with curl, the JavaScript library or the CLI.
Text
Speaks a text in one of over 1,000 voices.
curl https://api.quak.party/v1/play/text \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{"text": "Dinner is ready!"}'The workspace's defaults pick the voice, the speakers and the volume.
curl https://api.quak.party/v1/play/text \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{
"text": "The meeting starts in 5 minutes.",
"to": ["kitchen", "office"],
"volume": 25,
"effect": "radiodj",
"ambience": "cafe",
"intro": "quakquak"
}'Two rooms, quieter, a radio DJ in a café and the quak sound before it.
Talk
Plays a recording of someone speaking, cleaned up first.
curl https://api.quak.party/v1/play/talk \
-H "Authorization: Bearer $QUAK_API_KEY" \
-F file=@recording.m4a \
-F to=allA recording on every speaker, sent as multipart.
curl https://api.quak.party/v1/play/talk \
-H "Authorization: Bearer $QUAK_API_KEY" \
-F file=@recording.m4a \
-F 'effects=[
{"at": 0, "ambience": "stadium"},
{"at": 2.4, "effect": "robot", "effectIntensity": "strong"},
{"at": 5, "effect": "none"}
]'Effects that change during the take: the stadium from the start, a robot voice after 2.4 s, back to normal after 5 s.
Sound
Plays one of the over 250 built-in sounds.
curl https://api.quak.party/v1/play/sound \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{"sound": "quakquak", "to": ["office"]}'Sonos fetches the sound itself, straight away.
curl https://api.quak.party/v1/play/sound \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{
"sound": "drum-roll",
"to": ["all"],
"process": true,
"effect": "echo",
"intro": "clip:front-door"
}'Mixed on the server with an echo and your own clip as the intro.
Clip
Plays one of your workspace's own clips, uploaded in the web app or saved from the history.
curl https://api.quak.party/v1/play/clip \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{"clip": "front-door"}'The clip by its slug, on the default speakers.
curl https://api.quak.party/v1/play/clip \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{
"clip": "front-door",
"to": ["living-room"],
"volume": 15,
"priority": true,
"quietHours": "none"
}'The doorbell: only in the living room, quietly, with priority so nothing cuts it off, also during quiet hours.
File
Uploads and plays an audio file once, up to 10 MB and 3 minutes.
curl https://api.quak.party/v1/play/file \
-H "Authorization: Bearer $QUAK_API_KEY" \
-F file=@doorbell.mp3 \
-F to=officeAny common audio format, sent as multipart.
curl https://api.quak.party/v1/play/file \
-H "Authorization: Bearer $QUAK_API_KEY" \
-F file=@memo.m4a \
-F ambience=rain \
-F intro=quakquak \
-F gap=300A voice memo in the rain, with the quak sound and a short pause before it.
URL
Plays audio from a public URL.
curl https://api.quak.party/v1/play/url \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{"url": "https://example.com/news.mp3"}'The server downloads and converts it, so intro, outro and effects apply.
curl https://api.quak.party/v1/play/url \
-H "Authorization: Bearer $QUAK_API_KEY" \
--json '{
"url": "https://example.com/gong.mp3",
"process": false,
"to": ["kitchen", "office"]
}'Sonos fetches a plain MP3 itself: faster, without processing.
Common parameters
Missing parameters come from your defaults (PATCH /v1/workspace/defaults), so most calls only need the content.
| Parameter | Meaning |
|---|---|
to | Speaker slugs from /v1/speakers, as an array or comma-separated. Default: your default speakers. |
volume | 10 to 100. 10 is the quietest Sonos plays an announcement. |
intro, outro | A sound slug, clip:<slug> for your own clip, or none. |
effect, effectIntensity | A voice effect (robot, helium …) and its strength: off, weak, medium (default) or strong. |
ambience, ambienceIntensity | An ambience (stadium, train station …) and its strength like above, combinable with a voice effect. |
quietHours | Overrides your quiet hours for this play, none lifts them. |
priority | true plays over everything, also urgent clips of other apps such as a doorbell. For urgent announcements only. |
preview | true only renders the audio and returns its audioUrl, nothing plays on Sonos. |
Credits
Every play costs credits once, when it plays, however many speakers it reaches. What each kind costs, with the rate of every voice, is under What costs what on the pricing page. The response carries the credits of the play, the header X-Quak-Credits your balance.
Plans and packs are on the pricing page.
Responses and errors
Successful responses wrap their payload in data, errors in error with a stable code and a readable message. 4xx means you need to change something, 5xx means the request was fine and you can send it again later.
{
"error": {
"code": "ERROR_INSUFFICIENT_CREDITS",
"message": "…"
}
}| Status | Code | When |
|---|---|---|
| 400 | ERROR_INVALID_PARAMS | A parameter is missing or invalid, field names it. |
| 401 | ERROR_MISSING_API_KEY, ERROR_INVALID_API_KEY | No API key, or an invalid one. |
| 402 | ERROR_INSUFFICIENT_CREDITS | Not enough credits for this announcement. |
| 404 | ERROR_NOT_FOUND | The play or clip doesn't exist. |
| 409 | ERROR_SONOS_RECONNECT_REQUIRED | Sonos rejected the login, reconnect your Sonos account. Nothing is charged. |
| 424 | ERROR_SONOS_FAILED | No speaker accepted the announcement. Nothing is charged, the play is in the history as FAILED. |
| 429 | ERROR_RATE_LIMITED | Too many requests in a short time. Wait the seconds in Retry-After, then try again. |
| 503 | ERROR_TTS_FAILED | Speech synthesis is down. Nothing is charged, try again later. |
Rate limits
Generous limits guard against floods and loops, not against normal use. Every answer of a limited route says where you stand, with the headers of the IETF draft: RateLimit-Policy: "tts";q=30;w=60 (30 requests per 60 seconds in the group tts) and RateLimit: "tts";r=29;t=42 (29 left, the window ends in 42 seconds). Over the limit the answer is 429 ERROR_RATE_LIMITED with Retry-After in seconds.
| Group | What | Limit |
|---|---|---|
auth | Login and sign-up | 120 an hour per IP, 15 an hour per email address |
login-poll | POST /v1/user/login/key | 300 per 15 minutes per IP |
mail | Invitations, a new email address, deleting an account or workspace | 20 an hour per key |
tts | POST /v1/play/text, also previews | 30 a minute per workspace |
play | All other plays, replays, saving and uploading clips | 60 a minute per workspace |
catalog | Sounds, votes, invitations | 1,200 a minute per IP |
api | Everything else with a key | 600 a minute per key |
open | Everything else without a key | 600 a minute per IP |
Live talk, live status and other WebSockets, trigger URLs and the MCP server have no such limits.
Versions
The version is part of the path, and /v1 is stable to build on. New routes, fields and error codes can come at any time: ignore fields you don't know, and treat an unknown code like its HTTP status. Lists of values grow too (a new platform or status), so handle a value you don't know instead of failing on it.
Libraries, CLI, MCP and apps
The CLI (quak text, quak sound, quak talk …), the MCP server for AI assistants and the apps have their own pages under Apps & Integrations, with install instructions. They all use this API, with the same account and credits.
The JavaScript library @quak/js (npm i @quak/js) has types generated from the OpenAPI schema and a small layer for playing, talking and stopping, for Node, Bun, Deno and the browser. Any other HTTP client works too (JSON with Content-Type: application/json, uploads as multipart/form-data), or generate one for your language from the OpenAPI schema.
Links into the app
Your app or integration can link straight to a page of the web app. Add ?workspace=<id> and it opens in that workspace: the id from GET /v1/workspaces. Only ids, slugs can change.
https://quak.party/app/history?workspace=8f1c2a4e-…/app/play/textPlay a text; also talk, sound, clip, file and url/app/historyWhat played lately/app/history/<play id>One play, e.g. from a notification/app/settingsSpeakers and groups, playback defaults, keys, triggers, users, billing, general/app/settings/billingPlan and credits; /credits for where they came from/app/profileThe person's own settings; /logins for their devices
The web app then works in that workspace, as if it had been picked in its switcher, and drops the parameter from the address. A workspace the person isn't a member of is ignored, the current one stays. Signed out, the link goes through the login first. The Stream Deck's Open Quak key links this way, with the workspace of the key.