SDKs
Hakim AI ships two official SDKs, both wrapping the same public REST/WebSocket API documented in the reference.
TypeScript / JavaScript
npm install @tryhakim/voice
import { Hakim } from '@tryhakim/voice';
const hakim = new Hakim({ apiKey: process.env.HAKIM_API_KEY! });
const speech = await hakim.audio.speech.create({
model: 'hakim-fast-v1',
input: 'مرحبا، أنا حكيم.',
voice: 'your-voice-id',
response_format: 'mp3',
});
Streaming synthesis (low-latency start):
const { stream } = await hakim.audio.speech.stream({
model: 'hakim-fast-v1',
input: 'مرحبا',
voice: 'your-voice-id',
});
for await (const chunk of stream) {
process.stdout.write(chunk);
}
Source and full API surface: github.com/tryHakimAI/hakim-node.
Python
pip install hakim
from hakim import Hakim
client = Hakim(api_key=os.environ["HAKIM_API_KEY"])
audio = client.audio.speech.create(
model="hakim-fast-v1",
input="مرحبا، أنا حكيم.",
voice="your-voice-id",
)
Ships both a sync (Hakim) and async (AsyncHakim) client. Source and full API
surface: github.com/tryHakimAI/hakim-python.
Voice agent integrations
Building a realtime voice agent instead of calling the API directly? Drop-in plugins are available for two popular open-source frameworks:
- LiveKit Agents plugin ·
HakimSTT/HakimTTS. - Pipecat plugin ·
HakimSTTService/HakimTTSService.
Both talk to Hakim's public REST/WebSocket API directly, so they work anywhere the underlying framework runs.
Both SDKs respect the Authorization: Bearer header and retry on 429
according to the Retry-After response.