Skip to main content

Overview

HakimSTTService transcribes audio into text using Hakim’s Arabic-first realtime speech-to-text API. It is a WebsocketSTTService that opens one persistent connection to WSS /v1/audio/transcriptions/stream, forwarding audio continuously and relying on Pipecat’s own VAD to signal end-of-turn — the same pattern used by other continuous-streaming STT plugins in this framework (e.g. AssemblyAI, Deepgram).

Source Repository

Source code, examples, and issues for the Hakim integration

Hakim Docs

Learn more about Hakim’s speech services

API Keys

Create and manage your Hakim API keys from the dashboard (Settings -> API keys)

Installation

This is a community-maintained package distributed separately from pipecat-ai, built and maintained by the Hakim team. It is not yet published to PyPI, so install it directly from GitHub:

Prerequisites

Hakim Account Setup

Before using the Hakim STT service, you need:
  1. Hakim Account: Sign up at tryhakim.ai
  2. API Key: Generate a key (format: hk_live_...) from the dashboard (Settings -> API keys), with the stt:write scope

Required Environment Variables

  • HAKIM_API_KEY: Your Hakim API key. Falls back to this environment variable if api_key is not passed to the constructor.

Configuration

api_key
str
default:"None"
Hakim API key. Falls back to the HAKIM_API_KEY environment variable if not provided.
language
Language
default:"Language.AR"
Language hint for transcription.
input_audio_format
str
default:"pcm16"
Audio format of the input stream. One of "pcm16", "opus", or "mulaw". Pipecat’s transport delivers PCM16 by default, so the default matches without any client-side transcoding.
sample_rate
int
default:"16000"
Must match the sample rate of audio frames actually sent to the service.
region
str
default:"auto"
Pins the session to a specific regional endpoint. One of "auto", "de", "uae", or "ksa". "auto" picks the closest healthy region.
base_url
str
default:"None"
Overrides the region table entirely (staging / self-hosted). Takes precedence over region.
settings
HakimSTTService.Settings
default:"None"
Runtime-updatable settings. See Settings below.

Settings

Runtime-updatable configuration passed via the settings constructor argument using HakimSTTService.Settings(...).
See the source repository for the authoritative, up-to-date configuration options.

Usage

Compatibility

Tested with Pipecat v1.5.0. Check the source repository for the latest tested version and changelog.