Skip to main content
@komaa/standin-sdk/cartesia puts Cartesia on a real Microsoft Teams call. StandIn answers the call and dials your worker; this plugin answers that dial, opens one session per call, and relays the audio both ways.

Install and run

There is nothing to install beyond the SDK. Cartesia is reached over an ordinary WebSocket, so this plugin adds no dependency.
Expose port 9442 at the /msteams/calling path and register the public wss:// URL as your StandIn identity’s agent voice URL. The full walkthrough is in the Quickstart, and there is a runnable example at examples/cartesia-msteams-connector.

The audio format

Audio is pinned to pcm_16000 in both directions, which is exactly what a Microsoft Teams call carries.

Your agent stays your agent

Cartesia runs the agent, so this plugin is transport and nothing else. There are no call tools to declare here, because whatever the agent does it does in its own code on Cartesia’s platform. Caller details reach that code as stream metadata, call context arrives as custom events, and a key press arrives as a real dtmf event.
CARTESIA_SYSTEM_PROMPT is optional on purpose. Left unset, the agent keeps exactly the prompt you wrote on Cartesia’s side. Set it and the caller’s details are appended to yours. Nothing here ever silently rewrites a deployed prompt.

Inside your own worker

The plugin is a CallHandler like any other:
Read the configuration once, then close over it. handlerFactory runs once per call, so new CartesiaHandler() with nothing passed reads the environment again on every call, and a key removed after startup would fail the next caller rather than failing you. serve(), which is what npx standin-cartesia runs, does exactly this, then waits for SIGINT or SIGTERM before calling server.aclose(). server.start() returns as soon as the listener is bound, so a script that ends there exits before a single call arrives, and aclose() is what drains live calls and releases the port.

Configuration

The configuration is read once when the worker starts, not per call, so a missing key stops the worker at startup rather than surprising the first caller. CARTESIA_API_HOST is checked against the cartesia.ai suffix, because your API key travels to it: a wrong host would be credential leakage rather than a failed call. The reasoning behind that shape is on Configuration.

Next

Realtime providers

The startup buffer, the echo guard and barge-in that every provider plugin sits on.

Configuration

Every STANDIN_ variable, and the helpers for reading your own.