Integración domótica Cartesia, gratuita y de código abierto

Cartesia Sonic voices for Gladys announcements, with your own API key.
La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.
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/datamore than 3 s (2 s at most for the first read, 1 s for a write). - Reserve budget: as long as
/datacould 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/datais written again. A/datathat 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
- 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. - 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
| Field | What it does |
|---|---|
| API key | Kept by Gladys in its database, never shown again, sent only to Cartesia (as a Bearer token). |
| Model | sonic-3.6 (default), sonic-3.5 or sonic-3. sonic-latest is not offered: it changes without notice. |
| French / English / German voice | The identifier (or page address) of a Cartesia voice. Required for the default language; empty for another: the default voice. |
| Language when unknown | The language and voice used when Gladys sends no language or another one. |
| Speaking speed | 0.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
/datais read), until you enter another key or the Test button succeeds (it sends anyway)./datakeeps 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/dataacross 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 asvoice_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.
Parámetros de configuración
Estos son los parámetros que Cartesia te pide en su pantalla de configuración en Gladys.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| Your Cartesia account | section | No | Cartesia 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 key | secret | Sí | Kept by Gladys in its database, never shown again, sent only to Cartesia. |
| Model | select | No | All bill about 1 credit per character. sonic-latest, which changes without notice, is not offered. |
| French voice | string | No | The 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 voice | string | No | The 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 voice | string | No | The 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 unknown | select | No | The language (and voice) used when Gladys sends no language, or another one. Its voice is required. |
| Speaking speed | select | No | |
| Daily limit (credits) | number | No | Nothing 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) | number | No | A longer text is cut (at a space when possible) before it is sent: 1,000 characters is about a minute of speech. |
Cómo instalar Cartesia en Gladys
- En Gladys, abre Integraciones: Cartesia aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
- Haz clic en Instalar. Gladys descarga la imagen Docker (
ghcr.io/lm1lc3n7/gladys-cartesia:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración). - Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
- También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-cartesia.
Cartesia requiere Gladys >=5.3.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.
¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.
Sobre las integraciones externas
Cartesia es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene LM1LC3N7, no el equipo principal de Gladys.
- Explorar todas las integraciones, nativas y de la comunidad
- Crear y publicar tu propia integración externa
- Código fuente en GitHub — fuente de esta documentación