# cartesia-ai/cartesia-js architecture

> Architecture diagram of the GitHub repository cartesia-ai/cartesia-js, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cartesia-ai/cartesia-js
- Repository: https://github.com/cartesia-ai/cartesia-js

## Overview

1. **Overall shape**
   - This is a generated TypeScript SDK for the Cartesia API, not an application server.
   - The public entrypoint is `src/index.ts`, which exposes a `Cartesia` client, resource namespaces, shared types, and helpers like `toFile`.
   - The SDK targets multiple runtimes via a `fetch`-first design: browser, Node, Deno, Bun, and edge environments.

2. **Primary architectural flow**
   - Consumer code instantiates `Cartesia` from `src/client.ts`.
   - A resource method such as `client.tts.generate()` or `client.voices.list()` builds a request, sends it through the client’s transport layer, and returns an `APIPromise`.
   - That promise can be awaited for parsed data, or inspected as a raw `Response` through helpers like `.asResponse()` and `.withResponse()`.

3. **Resource layer: API surface by domain**
   - `src/resources/` is the main API mapping layer and mirrors Cartesia product areas: `tts`, `stt`, `voices`, `voice-changer`, `datasets`, `agents`, `fine-tunes`, `pronunciation-dicts`, and `access-token`.
   - Each domain is split into endpoint-specific modules and index files, so architecture diagrams should show a resource namespace tree underneath the client.
   - `src/resources/top-level.ts` and `src/resources/shared.ts` provide common request/response shapes reused across domains.

4. **Core abstractions**
   - `src/core/` contains the reusable SDK primitives:
     - `resource.ts` for base resource behavior
     - `api-promise.ts` for lazy response handling
     - `pagination.ts` for auto-pagination
     - `streaming.ts` for streamed responses
     - `uploads.ts` for file upload handling
     - `EventEmitter.ts` for event-driven flows
   - These abstractions are the backbone underneath the generated resource methods, keeping the domain modules thin.

5. **HTTP transport and request construction**
   - `src/client.ts` and `src/internal/request-options.ts` coordinate request options like retries, timeout, headers, fetch overrides, and logging.
   - `src/internal/headers.ts`, `src/internal/qs/`, `src/internal/parse.ts`, and `src/internal/utils/` handle request serialization: query strings, headers, base64, UUIDs, sleep/backoff, and environment detection.
   - The library assumes a global `fetch` by default but allows a custom fetch implementation or runtime-specific proxy/client settings.

6. **Response handling, pagination, and errors**
   - Parsing and error mapping are centralized in `src/internal/errors.ts`, `src/error.ts`, and `src/core/error.ts`.
   - Non-2xx responses become typed API errors, while connection failures and timeouts become connection-specific errors.
   - Pagination is abstracted so list endpoints can be consumed either page-by-page or via async iteration across pages.

7. **File upload subsystem**
   - Upload support is split across `src/core/uploads.ts`, `src/uploads.ts`, `src/internal/uploads.ts`, and `src/internal/to-file.ts`.
   - The SDK accepts several upload forms: web `File`, fetch `Response`, Node streams, or converted binary data.
   - This is especially important for dataset file endpoints, where upload handling affects both request shape and runtime compatibility.

8. **Realtime/websocket subsystem**
   - Realtime speech features use a separate websocket path in `src/internal/ws.ts`, `src/internal/ws-adapter-browser.ts`, `src/internal/ws-adapter-node.ts`, and `src/internal/lib/tts/ws.ts`.
   - STT and TTS each have dedicated websocket-oriented resource trees under `src/resources/stt/` and `src/resources/tts/`.
   - The STT side is further split into auto-finalize and manual-finalize flows, indicating different session lifecycles and completion semantics.

9. **Backwards compatibility layer**
   - `src/backcompat/` contains wrappers and adapters for older shapes of the public API.
   - Files like `tts-wrapper.ts`, `voices-wrapper.ts`, `voice-changer-wrapper.ts`, and `types.ts` suggest the SDK preserves older method signatures or object shapes while routing to the newer resource model.
   - This layer sits between the main public export surface and the newer generated resource structure.

10. **Platform and runtime shims**
   - `src/internal/shims.ts`, `shim-types.ts`, and `detect-platform.ts` provide runtime-specific branching.
   - These abstractions matter because the SDK must work across browser, Node, Bun, Deno, and edge runtimes without depending on Node-only APIs.
   - The websocket adapter split is the clearest sign that runtime differences are treated as a first-class architectural boundary.

11. **Testing strategy**
   - `tests/` mirrors the source layout, with dedicated tests for API resources, internals, query-string behavior, uploads, streaming, websocket behavior, and helper utilities.
   - The structure suggests the repo is validated both at the contract level, for generated endpoints, and at the utility level, for cross-runtime helpers.
   - This mirrors the SDK architecture: transport, parsing, and domain resources are all independently exercised.

12. **Build, release, and repository tooling**
   - `scripts/` contains formatting, linting, test, build, and packaging helpers; `bin/publish-npm` and GitHub workflows handle release publication.
   - The project uses TypeScript build configs, Jest, ESLint, Prettier, and release automation via Release Please and CI workflows.
   - `api.md` is the generated API reference, reinforcing that the repository is source-first but documentation-driven.

13. **Examples and integration points**
   - `examples/node_examples.ts` and `examples/nextjs/` show how the SDK is consumed in Node and a React/Next.js environment.
   - The Next.js example includes an API route, which demonstrates server-side token usage rather than a browser-only integration.
   - These examples are useful for diagramming the “consumer side” of the architecture: app code calls the SDK, the SDK calls Cartesia’s REST or realtime endpoints.

14. **High-level diagram boundary**
   - The main external boundary is the Cartesia API itself, accessed over HTTP and websocket connections.
   - Internally, the SDK is organized as: public client → resource namespaces → core abstractions → internal transport/serialization/runtime helpers.
   - Backcompat and runtime adapters sit at the edges, while generated resources and shared core utilities form the center of the system.

Main entry points: [`src/resources/index.ts`](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/index.ts) (Resources index), [`src/core/api-promise.ts`](https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/api-promise.ts) (API promise), [`src/client.ts`](https://github.com/cartesia-ai/cartesia-js/blob/main/src/client.ts) (Cartesia client), [`src/resources/tts.ts`](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/tts.ts) (TTS)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public SDK"]
  node_src_index["SDK entrypoint<br/>public exports<br/>[index.ts]"]
  node_src_client["Cartesia client<br/>client factory<br/>[client.ts]"]
end

subgraph group_resources["Resource Layer"]
  node_src_resources_index["Resources index<br/>namespace wiring<br/>[index.ts]"]
  node_src_resources_top_level["Top-level shapes<br/>shared schema<br/>[top-level.ts]"]
  node_src_resources_shared["Shared models<br/>shared schema<br/>[shared.ts]"]
  node_tts_ns["TTS<br/>resource namespace<br/>[tts.ts]"]
  node_stt_ns["STT<br/>resource namespace<br/>[stt.ts]"]
  node_voices_ns["Voices<br/>resource namespace<br/>[voices.ts]"]
  node_datasets_ns["Datasets<br/>resource namespace<br/>[datasets.ts]"]
  node_agents_ns["Agents<br/>resource namespace<br/>[agents.ts]"]
  node_fine_tunes_ns["Fine-tunes<br/>resource namespace<br/>[fine-tunes.ts]"]
  node_pronunciation_dicts_ns["Pronunciation dicts<br/>resource namespace"]
  node_access_token_ns["Access token<br/>resource namespace<br/>[access-token.ts]"]
end

subgraph group_core["Core Primitives"]
  node_api_promise["API promise<br/>async response wrapper<br/>[api-promise.ts]"]
  node_resource_base["Resource base<br/>resource primitive<br/>[resource.ts]"]
  node_pagination["Pagination<br/>iteration helper<br/>[pagination.ts]"]
  node_streaming["Streaming<br/>response helper<br/>[streaming.ts]"]
  node_uploads["Uploads<br/>file helper<br/>[uploads.ts]"]
end

subgraph group_transport["Transport & Runtime"]
  node_request_options["Request options<br/>transport config<br/>[request-options.ts]"]
  node_headers["Headers<br/>serialization<br/>[headers.ts]"]
  node_qs["Query strings<br/>serialization<br/>[index.ts]"]
  node_parse["Parsing<br/>[parse.ts]"]
  node_errors["Errors<br/>error mapping<br/>[errors.ts]"]
  node_ws_core["Websocket core<br/>realtime transport<br/>[ws.ts]"]
  node_ws_browser["Browser WS<br/>ws adapter"]
  node_ws_node["Node WS<br/>ws adapter<br/>[ws-adapter-node.ts]"]
  node_platform["Platform shims<br/>runtime detection<br/>[detect-platform.ts]"]
  node_internal_uploads["Upload internals<br/>upload plumbing<br/>[uploads.ts]"]
  node_to_file["toFile helper<br/>binary conversion<br/>[to-file.ts]"]
end

subgraph group_compat["Backcompat"]
  node_backcompat_index["Backcompat index<br/>compat layer<br/>[index.ts]"]
  node_tts_wrapper["TTS wrapper<br/>compat adapter<br/>[tts-wrapper.ts]"]
  node_voices_wrapper["Voices wrapper<br/>compat adapter<br/>[voices-wrapper.ts]"]
  node_voice_changer_wrapper["Voice changer wrapper<br/>compat adapter"]
end

node_external_api(("Cartesia API<br/>external service"))

node_src_index -->|"exports"| node_src_client
node_src_index -->|"exports"| node_src_resources_index
node_src_index -->|"exports"| node_backcompat_index
node_src_index -->|"exports"| node_api_promise
node_src_client -->|"uses"| node_request_options
node_src_client -->|"creates"| node_resource_base
node_src_client -->|"calls"| node_external_api
node_src_resources_index -->|"shares"| node_src_resources_top_level
node_src_resources_index -->|"shares"| node_src_resources_shared
node_src_resources_index -->|"includes"| node_tts_ns
node_src_resources_index -->|"includes"| node_stt_ns
node_src_resources_index -->|"includes"| node_voices_ns
node_src_resources_index -->|"includes"| node_datasets_ns
node_src_resources_index -->|"includes"| node_agents_ns
node_src_resources_index -->|"includes"| node_fine_tunes_ns
node_src_resources_index -->|"includes"| node_pronunciation_dicts_ns
node_src_resources_index -->|"includes"| node_access_token_ns
node_tts_ns -->|"returns"| node_api_promise
node_stt_ns -->|"returns"| node_api_promise
node_voices_ns -->|"returns"| node_api_promise
node_datasets_ns -->|"uses"| node_uploads
node_datasets_ns -->|"uses"| node_pagination
node_agents_ns -->|"uses"| node_pagination
node_tts_ns -->|"uses"| node_streaming
node_stt_ns -->|"uses"| node_streaming
node_resource_base -->|"reads"| node_request_options
node_resource_base -->|"builds"| node_headers
node_resource_base -->|"serializes"| node_qs
node_api_promise -->|"parses"| node_parse
node_api_promise -->|"maps"| node_errors
node_request_options -->|"adapts to"| node_platform
node_parse -->|"emits"| node_errors
node_ws_core -->|"adapts"| node_ws_browser
node_ws_core -->|"adapts"| node_ws_node
node_tts_ns -->|"realtime"| node_ws_core
node_stt_ns -->|"realtime"| node_ws_core
node_uploads -->|"uses"| node_internal_uploads
node_internal_uploads -->|"converts"| node_to_file
node_backcompat_index -->|"wraps"| node_tts_wrapper
node_backcompat_index -->|"wraps"| node_voices_wrapper
node_backcompat_index -->|"wraps"| node_voice_changer_wrapper
node_tts_wrapper -->|"delegates"| node_tts_ns
node_voices_wrapper -->|"delegates"| node_voices_ns
node_voice_changer_wrapper -->|"delegates"| node_src_resources_index
node_src_client -->|"produces"| node_api_promise
node_src_client -->|"opens"| node_ws_core

click node_src_index "https://github.com/cartesia-ai/cartesia-js/blob/main/src/index.ts"
click node_src_client "https://github.com/cartesia-ai/cartesia-js/blob/main/src/client.ts"
click node_src_resources_index "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/index.ts"
click node_src_resources_top_level "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/top-level.ts"
click node_src_resources_shared "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/shared.ts"
click node_tts_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/tts.ts"
click node_stt_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/stt.ts"
click node_voices_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/voices.ts"
click node_datasets_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/datasets.ts"
click node_agents_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/agents.ts"
click node_fine_tunes_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/fine-tunes.ts"
click node_pronunciation_dicts_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/pronunciation-dicts.ts"
click node_access_token_ns "https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/access-token.ts"
click node_api_promise "https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/api-promise.ts"
click node_resource_base "https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/resource.ts"
click node_pagination "https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/pagination.ts"
click node_streaming "https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/streaming.ts"
click node_uploads "https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/uploads.ts"
click node_request_options "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/request-options.ts"
click node_headers "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/headers.ts"
click node_qs "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/qs/index.ts"
click node_parse "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/parse.ts"
click node_errors "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/errors.ts"
click node_ws_core "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/ws.ts"
click node_ws_browser "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/ws-adapter-browser.ts"
click node_ws_node "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/ws-adapter-node.ts"
click node_platform "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/detect-platform.ts"
click node_internal_uploads "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/uploads.ts"
click node_to_file "https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/to-file.ts"
click node_backcompat_index "https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/index.ts"
click node_tts_wrapper "https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/tts-wrapper.ts"
click node_voices_wrapper "https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/voices-wrapper.ts"
click node_voice_changer_wrapper "https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/voice-changer-wrapper.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_src_index,node_src_client toneBlue
class node_src_resources_index,node_src_resources_top_level,node_src_resources_shared,node_tts_ns,node_stt_ns,node_voices_ns,node_datasets_ns,node_agents_ns,node_fine_tunes_ns,node_pronunciation_dicts_ns,node_access_token_ns toneAmber
class node_api_promise,node_resource_base,node_pagination,node_streaming,node_uploads toneMint
class node_request_options,node_headers,node_qs,node_parse,node_errors,node_ws_core,node_ws_browser,node_ws_node,node_platform,node_internal_uploads,node_to_file toneRose
class node_backcompat_index,node_tts_wrapper,node_voices_wrapper,node_voice_changer_wrapper toneIndigo
class node_external_api toneNeutral
```

## Components

### Public SDK

Consumer entrypoints and compatibility surface

- [SDK entrypoint](https://github.com/cartesia-ai/cartesia-js/blob/main/src/index.ts): public exports · Primary package surface · `src/index.ts`
- [Cartesia client](https://github.com/cartesia-ai/cartesia-js/blob/main/src/client.ts): client factory · Configures requests and exposes resources · `src/client.ts`

### Resource Layer

Generated API namespaces by Cartesia domain

- [Resources index](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/index.ts): namespace wiring · Collects resource namespaces · `src/resources/index.ts`
- [Top-level shapes](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/top-level.ts): shared schema · Common request and response models · `src/resources/top-level.ts`
- [Shared models](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/shared.ts): shared schema · Reusable resource types · `src/resources/shared.ts`
- [TTS](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/tts.ts): resource namespace · Text-to-speech APIs and realtime flows · `src/resources/tts.ts`
- [STT](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/stt.ts): resource namespace · Speech-to-text APIs and session flows · `src/resources/stt.ts`
- [Voices](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/voices.ts): resource namespace · Voice listing and management · `src/resources/voices.ts`
- [Datasets](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/datasets.ts): resource namespace · Dataset and file operations · `src/resources/datasets.ts`
- [Agents](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/agents.ts): resource namespace · Agent, call, deployment, and metrics APIs · `src/resources/agents.ts`
- [Fine-tunes](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/fine-tunes.ts): resource namespace · Fine-tuning lifecycle endpoints · `src/resources/fine-tunes.ts`
- [Pronunciation dicts](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/pronunciation-dicts.ts): resource namespace · Pronunciation dictionary endpoints · `src/resources/pronunciation-dicts.ts`
- [Access token](https://github.com/cartesia-ai/cartesia-js/blob/main/src/resources/access-token.ts): resource namespace · Token issuance endpoint · `src/resources/access-token.ts`

### Core Primitives

Reusable SDK behavior shared by all resources

- [API promise](https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/api-promise.ts): async response wrapper · Lazy parsing and raw response access · `src/core/api-promise.ts`
- [Resource base](https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/resource.ts): resource primitive · Shared method behavior for generated resources · `src/core/resource.ts`
- [Pagination](https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/pagination.ts): iteration helper · Page traversal and async iteration · `src/core/pagination.ts`
- [Streaming](https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/streaming.ts): response helper · Streamed response handling · `src/core/streaming.ts`
- [Uploads](https://github.com/cartesia-ai/cartesia-js/blob/main/src/core/uploads.ts): file helper · Binary and file upload handling · `src/core/uploads.ts`

### Transport & Runtime

HTTP, websocket, serialization, and runtime adapters

- [Request options](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/request-options.ts): transport config · Timeouts, retries, headers, fetch override, logging · `src/internal/request-options.ts`
- [Headers](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/headers.ts): serialization · Request header assembly · `src/internal/headers.ts`
- [Query strings](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/qs/index.ts): serialization · Query encoding and formatting · `src/internal/qs/index.ts`
- [Parsing](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/parse.ts): response parsing · Body parsing and normalization · `src/internal/parse.ts`
- [Errors](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/errors.ts): error mapping · Typed API and connection errors · `src/internal/errors.ts`
- [Websocket core](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/ws.ts): realtime transport · Shared websocket plumbing · `src/internal/ws.ts`
- [Browser WS](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/ws-adapter-browser.ts): ws adapter · Browser websocket adapter · `src/internal/ws-adapter-browser.ts`
- [Node WS](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/ws-adapter-node.ts): ws adapter · Node websocket adapter · `src/internal/ws-adapter-node.ts`
- [Platform shims](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/detect-platform.ts): runtime detection · Cross-runtime feature detection and shims · `src/internal/detect-platform.ts`
- [Upload internals](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/uploads.ts): upload plumbing · Runtime-specific upload conversion · `src/internal/uploads.ts`
- [toFile helper](https://github.com/cartesia-ai/cartesia-js/blob/main/src/internal/to-file.ts): binary conversion · Converts input into uploadable file data · `src/internal/to-file.ts`

### Backcompat

Wrappers for older public API shapes

- [Backcompat index](https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/index.ts): compat layer · Legacy API surface exports · `src/backcompat/index.ts`
- [TTS wrapper](https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/tts-wrapper.ts): compat adapter · Legacy TTS method shape · `src/backcompat/tts-wrapper.ts`
- [Voices wrapper](https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/voices-wrapper.ts): compat adapter · Legacy voices method shape · `src/backcompat/voices-wrapper.ts`
- [Voice changer wrapper](https://github.com/cartesia-ai/cartesia-js/blob/main/src/backcompat/voice-changer-wrapper.ts): compat adapter · Legacy voice-changer method shape · `src/backcompat/voice-changer-wrapper.ts`

### Other components

- **Cartesia API**: external service · Remote REST and realtime endpoints

## Connections

- SDK entrypoint → Cartesia client: exports
- SDK entrypoint → Resources index: exports
- SDK entrypoint → Backcompat index: exports
- SDK entrypoint → API promise: exports
- Cartesia client → Request options: uses
- Cartesia client → Resource base: creates
- Cartesia client → Cartesia API: calls
- Resources index → Top-level shapes: shares
- Resources index → Shared models: shares
- Resources index → TTS: includes
- Resources index → STT: includes
- Resources index → Voices: includes
- Resources index → Datasets: includes
- Resources index → Agents: includes
- Resources index → Fine-tunes: includes
- Resources index → Pronunciation dicts: includes
- Resources index → Access token: includes
- TTS → API promise: returns
- STT → API promise: returns
- Voices → API promise: returns
- Datasets → Uploads: uses
- Datasets → Pagination: uses
- Agents → Pagination: uses
- TTS → Streaming: uses
- STT → Streaming: uses
- Resource base → Request options: reads
- Resource base → Headers: builds
- Resource base → Query strings: serializes
- API promise → Parsing: parses
- API promise → Errors: maps
- Request options → Platform shims: adapts to
- Parsing → Errors: emits
- Websocket core → Browser WS: adapts
- Websocket core → Node WS: adapts
- TTS → Websocket core: realtime
- STT → Websocket core: realtime
- Uploads → Upload internals: uses
- Upload internals → toFile helper: converts
- Backcompat index → TTS wrapper: wraps
- Backcompat index → Voices wrapper: wraps
- Backcompat index → Voice changer wrapper: wraps
- TTS wrapper → TTS: delegates
- Voices wrapper → Voices: delegates
- Voice changer wrapper → Resources index: delegates
- Cartesia client → API promise: produces
- Cartesia client → Websocket core: opens
