Together AI
Realtime speech-to-text with TogetherSTTService, over Together AI's WebSocket API.
Overview
TogetherSTTService: streams audio over a WebSocket to Together's realtime transcription endpoint and pushes interim and final transcriptions.
Upstream page
Pipecat's documentation for the same service.
Source
packages/together/src/stt.ts.
Together AI docs
Speech-to-text models and the realtime API.
Installation
bun add @pipedog/togetherimport { TogetherSTTService } from "@pipedog/together/stt";Prerequisites
- A Together AI account and an API key from Together AI.
- Pass the key as
apiKey. The examples read it fromTOGETHER_API_KEY.
TogetherSTTService
Connects to wss://api.together.ai/v1/realtime?intent=transcription, with Authorization: Bearer <key>.
Configuration
Prop
Type
Settings
Runtime-updatable settings, passed as settings: new TogetherSTTService.Settings({...})
(TogetherSTTSettings). Any setting you leave out keeps the default below.
| Setting | Type | Default | Description |
|---|---|---|---|
model | string | "openai/whisper-large-v3" | Transcription model. |
language | Language | null | Language.EN | Language of the audio. |
Usage
import { STTUpdateSettingsFrame } from "@pipedog/core/frames/frames";
import { TogetherSTTService } from "@pipedog/together/stt";
const stt = new TogetherSTTService({
apiKey: process.env.TOGETHER_API_KEY ?? "",
settings: new TogetherSTTService.Settings({ model: "openai/whisper-large-v3" }),
});Change settings mid-call with an STTUpdateSettingsFrame:
// Queue it on the worker, or push it from a processor upstream of the service.
const update = new STTUpdateSettingsFrame({
delta: new TogetherSTTService.Settings({ model: "openai/whisper-large-v3" }),
});Event handlers
| Event | Description |
|---|---|
on_connected | The WebSocket connected. |
on_disconnected | The WebSocket closed. |
Notes
- Audio is sent as base64 16-bit PCM. When the user stops speaking, the buffer is committed so the final transcript arrives.
- Any settings change reconnects, since the session is configured in the connection URL.
- If the connection drops, the base class reconnects.
Runtime notes
| Runtime | Works | What it needs |
|---|---|---|
| Bun | ✅ yes | Nothing. |
| Node.js | ✅ yes | Nothing. |
| Deno | ✅ yes | Nothing. |
| Cloudflare Workers | ✅ yes | Nothing. |
Generated from pipecat.runtimes and pipecat.compat in packages/together/package.json: ✅ means the compat smoke test passes on that runtime.
- The WebSocket goes through the core
websocketConnect, with headers on the handshake. It works on Bun, Node, Deno and Cloudflare Workers. - Tested against a local WebSocket fake, not against Together AI itself.
pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.
Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).