> ## Documentation Index
> Fetch the complete documentation index at: https://daily-docs-source-analytics-user-turn-strategies.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Together AI

> Speech-to-text service using Together AI's real-time transcription API

## Overview

`TogetherSTTService` provides real-time speech recognition using Together AI's WebSocket API with OpenAI-compatible speech-to-text endpoints. It supports streaming transcription with interim results and automatic reconnection.

<CardGroup cols={2}>
  <Card title="Together AI STT API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.together.stt.html">
    Pipecat's API methods for Together AI STT
  </Card>

  <Card title="Example Implementation" icon="play" href="https://github.com/pipecat-ai/pipecat/blob/main/examples/transcription/transcription-together.py">
    Complete transcription example
  </Card>

  <Card title="Together AI Documentation" icon="book" href="https://docs.together.ai/reference/audio-transcriptions-realtime">
    Official Together AI Realtime API documentation
  </Card>

  <Card title="Together AI Platform" icon="microphone" href="https://together.ai/">
    Access models and manage API keys
  </Card>
</CardGroup>

## Installation

To use Together AI STT services, install the required dependencies:

```bash theme={null}
uv add "pipecat-ai[together]"
```

## Prerequisites

### Together AI Account Setup

Before using Together AI STT services, you need:

1. **Together AI Account**: Sign up at [Together AI](https://together.ai/)
2. **API Key**: Generate an API key from your account dashboard
3. **Model Selection**: Choose from available transcription models

### Required Environment Variables

* `TOGETHER_API_KEY`: Your Together AI API key for authentication

## Configuration

<ParamField path="api_key" type="str" required>
  Together AI API key for authentication.
</ParamField>

<ParamField path="sample_rate" type="int" default="None">
  Audio sample rate in Hz. When `None`, uses the pipeline's configured sample
  rate.
</ParamField>

<ParamField path="base_url" type="str" default="wss://api.together.ai/v1">
  WebSocket base URL for Together AI API.
</ParamField>

<ParamField path="settings" type="TogetherSTTService.Settings" default="None">
  Runtime-configurable settings. See [Settings](#settings) below.
</ParamField>

<ParamField path="ttfs_p99_latency" type="float" default="1.00">
  P99 latency from speech end to final transcript in seconds. Override for your
  deployment. See
  [https://github.com/pipecat-ai/stt-benchmark](https://github.com/pipecat-ai/stt-benchmark).
</ParamField>

### Settings

Runtime-configurable settings passed via the `settings` constructor argument using `TogetherSTTService.Settings(...)`. These can be updated mid-conversation with `STTUpdateSettingsFrame`. See [Service Settings](/pipecat/fundamentals/service-settings) for details.

| Parameter  | Type              | Default                     | Description                               |
| ---------- | ----------------- | --------------------------- | ----------------------------------------- |
| `model`    | `str`             | `"openai/whisper-large-v3"` | Model identifier. *(Inherited.)*          |
| `language` | `Language \| str` | `Language.EN`               | Language for transcription. *(Inherited)* |

## Usage

### Basic Setup

```python theme={null}
import os
from pipecat.services.together import TogetherSTTService

stt = TogetherSTTService(
    api_key=os.getenv("TOGETHER_API_KEY"),
)
```

### With Custom Settings

```python theme={null}
from pipecat.services.together import TogetherSTTService
from pipecat.transcriptions.language import Language

stt = TogetherSTTService(
    api_key=os.getenv("TOGETHER_API_KEY"),
    settings=TogetherSTTService.Settings(
        model="openai/whisper-large-v3",
        language=Language.EN,
    ),
)
```

### In a Voice Pipeline

```python theme={null}
from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.pipeline.pipeline import Pipeline
from pipecat.processors.audio.vad_processor import VADProcessor
from pipecat.services.together import TogetherSTTService

stt = TogetherSTTService(api_key=os.getenv("TOGETHER_API_KEY"))
vad_processor = VADProcessor(vad_analyzer=SileroVADAnalyzer())

pipeline = Pipeline([
    transport.input(),
    vad_processor,
    stt,
    # ... rest of pipeline
])
```

## Notes

* Together AI's STT service uses an OpenAI-compatible WebSocket protocol for real-time transcription.
* The service automatically handles reconnection on connection errors.
* Transcription is committed when `VADUserStoppedSpeakingFrame` is received.
