Quak

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:

  1. Sign up, free with credits to start.
  2. 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.
  3. Get an API key: make one in the web app under Settings → API keys, or log in from a script (see Authentication).
  4. Look up the slugs of your speakers and groups (GET /v1/speakers).
  5. Play something:
POST /v1/play/text
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:

the same, with the header
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:

login with a magic link
# 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-After

With 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.

POST /v1/keys
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.

GET /v1/speakers
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:

StatusMeans
201Played (or, with preview, the audio was made). The play has its speakers and creditsUsed.
202Scheduled with startIn: status: "SCHEDULED", it plays at startsAt.
200Not 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).

RouteWhat
POST /v1/play/textSpeak a text with a voice from /v1/voices
POST /v1/play/talkA recording from the mic, plays when you let go (multipart)
POST /v1/play/soundA built-in sound from /v1/sounds
POST /v1/play/clipOne of your own clips from /v1/clips
POST /v1/play/fileAn uploaded file (multipart)
POST /v1/play/urlAudio 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.

textTry it on your Sonos, you check it before it plays
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.

text, with moreTry it on your Sonos, you check it before it plays
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.

talk
curl https://api.quak.party/v1/play/talk \
  -H "Authorization: Bearer $QUAK_API_KEY" \
  -F file=@recording.m4a \
  -F to=all

A recording on every speaker, sent as multipart.

talk, with more
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.

soundTry it on your Sonos, you check it before it plays
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.

sound, with moreTry it on your Sonos, you check it before it plays
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.

clipTry it on your Sonos, you check it before it plays
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.

clip, with moreTry it on your Sonos, you check it before it plays
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.

file
curl https://api.quak.party/v1/play/file \
  -H "Authorization: Bearer $QUAK_API_KEY" \
  -F file=@doorbell.mp3 \
  -F to=office

Any common audio format, sent as multipart.

file, with more
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=300

A voice memo in the rain, with the quak sound and a short pause before it.

URL

Plays audio from a public URL.

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.

url, with more
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.

ParameterMeaning
toSpeaker slugs from /v1/speakers, as an array or comma-separated. Default: your default speakers.
volume10 to 100. 10 is the quietest Sonos plays an announcement.
intro, outroA sound slug, clip:<slug> for your own clip, or none.
effect, effectIntensityA voice effect (robot, helium …) and its strength: off, weak, medium (default) or strong.
ambience, ambienceIntensityAn ambience (stadium, train station …) and its strength like above, combinable with a voice effect.
quietHoursOverrides your quiet hours for this play, none lifts them.
prioritytrue plays over everything, also urgent clips of other apps such as a doorbell. For urgent announcements only.
previewtrue 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 response
{
  "error": {
    "code": "ERROR_INSUFFICIENT_CREDITS",
    "message": "…"
  }
}
StatusCodeWhen
400ERROR_INVALID_PARAMSA parameter is missing or invalid, field names it.
401ERROR_MISSING_API_KEY, ERROR_INVALID_API_KEYNo API key, or an invalid one.
402ERROR_INSUFFICIENT_CREDITSNot enough credits for this announcement.
404ERROR_NOT_FOUNDThe play or clip doesn't exist.
409ERROR_SONOS_RECONNECT_REQUIREDSonos rejected the login, reconnect your Sonos account. Nothing is charged.
424ERROR_SONOS_FAILEDNo speaker accepted the announcement. Nothing is charged, the play is in the history as FAILED.
429ERROR_RATE_LIMITEDToo many requests in a short time. Wait the seconds in Retry-After, then try again.
503ERROR_TTS_FAILEDSpeech 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.

GroupWhatLimit
authLogin and sign-up120 an hour per IP, 15 an hour per email address
login-pollPOST /v1/user/login/key300 per 15 minutes per IP
mailInvitations, a new email address, deleting an account or workspace20 an hour per key
ttsPOST /v1/play/text, also previews30 a minute per workspace
playAll other plays, replays, saving and uploading clips60 a minute per workspace
catalogSounds, votes, invitations1,200 a minute per IP
apiEverything else with a key600 a minute per key
openEverything else without a key600 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.