Skip to main content

Cartesia smart home integration, free and open source

Cartesia integration for Gladys Assistant

Cartesia Sonic voices for Gladys announcements, with your own API key.

Gives Gladys the voices of Cartesia (the Sonic models: its voice library, or a voice you cloned there) for its announcements (the "Play a notification" scene action) and the voice assistant reply, with the API key of your own Cartesia account. Unofficial: not affiliated with Cartesia.

This integration has never been tested with a real Cartesia account yet: it was built from the Cartesia API documentation (docs.cartesia.ai, "Text-to-Speech (Bytes)", "API Errors", "Pricing", "Concurrency", December 2026) and tested against a local imitation of that API.

What it does​

Gladys sends a text (2,000 characters at most) and the language of the user. The integration picks the voice you chose for that language (French, English or German; the voice of the "Language when unknown" otherwise, which then speaks the language asked), asks Cartesia for an MP3 clip (44.1 kHz, 128 kbit/s) with the model you chose, and hands it to Gladys, which plays it on your speakers.

Then, in Gladys, open Integrations → Artificial Intelligence, card Voice, and select Cartesia.

Limits of Gladys itself (not of this integration): the clip is served to speakers on your local network, and the voice assistant reply stays in text in an HTTPS page (see the Gladys documentation).

What it costs​

Cartesia bills text to speech in credits, "about 1 credit per character" of text, varying slightly with its pre-processing (docs.cartesia.ai/pricing, December 2026), from the monthly credits of your plan (the Free plan included). Once they are used, requests fail, unless overages are enabled on your account (then they are billed on top).

To keep the bill under control:

  • Maximum length of a text (default 1,000 characters, about a minute of speech): a longer text is cut before it is sent, at a space when there is one in the second half.
  • Daily limit (default 10,000 credits, about 8,000 characters): the integration counts 1.25 credits per character (a UTF-16 unit, never fewer than the characters you see), a margin above Cartesia's announced count (which varies slightly with its pre-processing). The limit applies to any 24 hours (a sliding window, counted per minute), not to a calendar day. Each request is counted in memory before it leaves, and written to /data (the write waited for 1 s at most). A request that may have been billed stays counted: no answer, connection cut, unusable clip, a redirect, and every other error status (429, 402, 403, 5xx, others). Only a request that never left, or one refused with 400, 401, 404 or 422, is given back: these are assumed rejected before any synthesis, from the general sentence of Cartesia's pricing page "errors will not consume credits" (no status is listed there). An announcement is not held up by /data more than 3 s (2 s at most for the first read, 1 s for a write).
  • Reserve budget: as long as /data could not be read (unreadable, read-only, mounted wrongly) or cannot be written, the count could be lost at a restart, so only 2 requests in 24 hours leave (each bounded by the maximum length), within the daily limit. Past them, nothing is sent and the status says so; it lifts as soon as /data is written again. A /data that is really empty (first start) keeps the normal limit. A cut of power or a crash at the wrong moment can lose the count of one request.
  • The same text in the same voice, language, model and speed is played again from memory (7 days, 50 clips, lost at a restart), not billed twice; asked several times at once (a scene announcing on several speakers), it makes one request whose answer all share.
  • At most 2 requests at once (the Free plan allows 2) and 8 waiting; more at the same moment are refused ("Too many announcements").
  • No retry: a request that may have left is not sent again by the integration (a retry could be billed twice).

Create the API key​

  1. Create an account on play.cartesia.ai, open API Keys (play.cartesia.ai/keys) and create a standard key. An admin key (sk_car_admin_…) is refused by text to speech: the integration says so before sending anything.
  2. Choose voices in the library (play.cartesia.ai/voices) or clone your own: the identifier of a voice is a UUID (0a1b2c3d-…) shown on its page. Paste the identifier or the address of its page (https://play.cartesia.ai/voices/<identifier>).

Configuration​

FieldWhat it does
API keyKept by Gladys in its database, never shown again, sent only to Cartesia (as a Bearer token).
Modelsonic-3.6 (default), sonic-3.5 or sonic-3. sonic-latest is not offered: it changes without notice.
French / English / German voiceThe identifier (or page address) of a Cartesia voice. Required for the default language; empty for another: the default voice.
Language when unknownThe language and voice used when Gladys sends no language or another one.
Speaking speed0.8× to 1.25× (generation_config.speed).
Daily limit (credits)500 to 10,000,000 over any 24 hours; default 10,000.
Maximum length of a text (characters)100 to 2,000; default 1,000.

The Test the voice button asks Cartesia for a short sentence (about 60 counted credits) with the saved settings and says how long it took. Nothing is played. It counts against the daily limit and waits for a pause like an announcement.

When something goes wrong​

The status of the Configuration screen says why:

  • Admin API key: create a standard key; nothing is sent with an admin key.
  • Cartesia refused this API key (HTTP 401: wrong, deleted or regenerated key): nothing more is sent with it, even after a restart (once /data is read), until you enter another key or the Test button succeeds (it sends anyway). /data keeps only two 8-bit prints of a salted hash of the refused key, never the key: a new key is tried at once, after a restart too (the key it replaces is then kept in memory as the refused one); only a key changed while Gladys was stopped has 1 chance in 65,536 to look refused, and the Test button then clears it.
  • No credit left (quota_exceeded, or HTTP 402): enable overages or change plan. No request for 60 s, then 2, 4… minutes up to 1 hour while it goes on; the Test button waits too. This is not a refusal of the key.
  • Denied (HTTP 403): not a refusal of the key; the next announcement tries again.
  • Slow down / Cartesia failed (HTTP 429 or 5xx): no request for 60 s, then 2, 4… minutes up to 1 hour if it goes on (longer when the answer has a Retry-After, 6 hours at most); the Test button waits too. The pause is kept in /data across a restart; a success ends it.
  • Cartesia refused the request (HTTP 400, 404, 422 or another 4xx): usually a voice that does not exist, a voice that does not suit the model, or a language the voice does not speak. Only the status code and the documented error_code (such as voice_not_found) are shown, never the message (it could quote your text).
  • Could not be reached, or the connection was cut: a cut after the request left stays counted.
  • Did not answer in time: Gladys waits 30 s; the integration gives up at 25 s.
  • Not an MP3 clip: the answer was refused (and stays counted: it may have been billed).

Privacy​

The text to speak is sent to Cartesia. The integration never writes it to the logs or to /data (only its length in characters); the clips stay in memory only. A redirect from the Cartesia address is never followed, so the key goes nowhere else.

Configuration settings​

These are the settings Cartesia asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Your Cartesia accountsectionNoCartesia bills text to speech in credits, about 1 credit per character of text, from the monthly credits of your plan (Free plan included); past them, requests fail unless overages are enabled. Create a standard API key (not an admin key) on play.cartesia.ai. The integration counts 1.25 credits per character, a margin above Cartesia’s announced count.
API keysecretYesKept by Gladys in its database, never shown again, sent only to Cartesia.
ModelselectNoAll bill about 1 credit per character. sonic-latest, which changes without notice, is not offered.
French voicestringNoThe identifier of a Cartesia voice (a UUID such as 0a1b2c3d-…, shown on its page at play.cartesia.ai/voices), or the address of that page. Required for the default language; empty for another language: the voice of the default language, speaking that language.
English voicestringNoThe identifier of a Cartesia voice (a UUID such as 0a1b2c3d-…, shown on its page at play.cartesia.ai/voices), or the address of that page. Required for the default language; empty for another language: the voice of the default language, speaking that language.
German voicestringNoThe identifier of a Cartesia voice (a UUID such as 0a1b2c3d-…, shown on its page at play.cartesia.ai/voices), or the address of that page. Required for the default language; empty for another language: the voice of the default language, speaking that language.
Language when unknownselectNoThe language (and voice) used when Gladys sends no language, or another one. Its voice is required.
Speaking speedselectNo
Daily limit (credits)numberNoNothing more is sent to Cartesia once this many credits were counted over the last 24 hours (a sliding window), 1.25 per character. The default, 10,000, is about 8,000 characters a day. A clip served from memory (the same sentence again) is not counted.
Maximum length of a text (characters)numberNoA longer text is cut (at a space when possible) before it is sent: 1,000 characters is about a minute of speech.

How to install Cartesia in Gladys​

  1. In Gladys, open Integrations: Cartesia appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/lm1lc3n7/gladys-cartesia:0.1.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/LM1LC3N7/gladys-cartesia.

Cartesia requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Cartesia is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by LM1LC3N7, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂