Skip to main content

Overview

Hathora is a hosting provider for several models for voice AI, which can be utilized under the single HathoraSTTService.

Installation

To use Hathora services, install the required dependencies:
pip install "pipecat-ai[hathora]"

Prerequisites

Hathora Account Setup

Before using Hathora STT services, you need:
  1. Hathora Account: Sign up at Hathora Models Console
  2. API Key: Generate an API token from your Tokens page

Hathora Model Specifier

The HathoraSTTService accepts a model: str parameter which corresponds to the model you would like to use. You can find available specifiers here

Configuration

HathoraSTTService

model
str
required
Model to use for transcription. Find available models at models.hathora.dev.
api_key
str
default:"None"
Hathora API key for authentication. Falls back to the HATHORA_API_KEY environment variable.
base_url
str
default:"https://api.models.hathora.dev/inference/v1/stt"
Base API URL for the Hathora STT service.
sample_rate
int
default:"None"
Audio sample rate in Hz. When None, uses the pipeline’s configured sample rate.
params
InputParams
default:"None"
Optional configuration parameters. See InputParams below.

InputParams

ParameterTypeDefaultDescription
languagestrNoneLanguage code, if supported by the selected model.
configlist[ConfigOption]NoneAdditional model-specific configuration options. Refer to Hathora docs for supported options per model. Each ConfigOption has a name and value field.

Usage

Basic Setup

from pipecat.services.hathora import HathoraSTTService

stt = HathoraSTTService(
    model="your-model-specifier",
    api_key=os.getenv("HATHORA_API_KEY"),
)

With Language and Config Options

from pipecat.services.hathora import HathoraSTTService
from pipecat.services.hathora.utils import ConfigOption

stt = HathoraSTTService(
    model="your-model-specifier",
    api_key=os.getenv("HATHORA_API_KEY"),
    params=HathoraSTTService.InputParams(
        language="en",
        config=[
            ConfigOption(name="option_name", value="option_value"),
        ],
    ),
)

Notes

  • Segmented transcription: HathoraSTTService extends SegmentedSTTService, meaning it processes complete audio segments (after VAD detects the user has stopped speaking) rather than streaming audio in real time.
  • Model-specific features: Configuration options and language support vary by model. Check the Hathora documentation for details on each model’s capabilities.