Voice API
Text-to-speech and speech-to-text across OpenAI, Deepgram, Cartesia, ElevenLabs, AssemblyAI, and Spitch — one API, provider inferred from the model.
Turn text into speech and speech into text through a single billable, logged, PII-redacted gateway. Pick a model and the gateway routes to the right provider — OpenAI, Deepgram, Cartesia, ElevenLabs, AssemblyAI, or Spitch — with BYOK, spend caps, and cost tracking applied the same way as the rest of the platform.
Endpoints
The provider is inferred from model — you never pass a provider name. Both endpoints default to OpenAI for backward compatibility.
Text-to-Speech
const { audio } = await cencori.voice.speak({
input: 'Hello, welcome to Cencori.',
model: 'aura-asteria-en', // Deepgram — provider inferred
});
// audio is an ArrayBuffer
await fs.writeFile('hello.mp3', Buffer.from(audio));Parameters
TTS models
Speech-to-Text
const { text } = await cencori.voice.transcribe({
audio: fileBytes, // Blob, ArrayBuffer, or Uint8Array
model: 'nova-3', // Deepgram — provider inferred
});Parameters
STT models
Speaker diarization
Use diarize() (or diarize: true + responseFormat: 'verbose_json') with a diarization-capable model to get speaker-attributed segments:
const { segments } = await cencori.voice.diarize({
audio: meetingBytes,
model: 'assemblyai-universal',
});
for (const s of segments) {
console.log(`${s.speaker}: ${s.text}`);
}Subtitles (SRT / VTT)
Set responseFormat to srt or vtt to get ready-to-use subtitles with timestamps:
const { text: srt } = await cencori.voice.transcribe({
audio: videoAudio,
model: 'nova-3',
responseFormat: 'srt',
});African languages with Spitch
Spitch is the only provider here doing native Yoruba, Hausa, Igbo, and Amharic — both TTS and STT. Ideal for WhatsApp voice notes and West-African products:
// Speak Yoruba
const { audio } = await cencori.voice.speak({
input: 'Bawo ni, e ku aaro.',
model: 'spitch-tts',
voice: 'sade',
language: 'yo',
});
// Transcribe a Yoruba voice note
const { text } = await cencori.voice.transcribe({
audio: voiceNote,
model: 'spitch-stt',
language: 'yo',
});SDKs
The same surface exists in every SDK — TypeScript, Python, Go, PHP, and Rust.
# Python
audio = cencori.voice.speak("Hello from Cencori.", model="aura-asteria-en")
open("hello.mp3", "wb").write(audio)
result = cencori.voice.transcribe("hello.mp3", model="nova-3")
print(result["text"])// Go
out, _ := c.Voice.Speak(ctx, &cencori.SpeakParams{Input: "Hello.", Model: "aura-asteria-en"})
os.WriteFile("hello.mp3", out.Audio, 0644)
tr, _ := c.Voice.Transcribe(ctx, out.Audio, &cencori.TranscribeParams{Model: "nova-3"})
fmt.Println(tr.Text)Drop-in React components
import { VoiceRecorder, SpeakButton } from 'cencori/react';
// Record from the mic and get the transcript
<VoiceRecorder model="nova-3" apiKey={key} onTranscript={(text) => console.log(text)} />
// Play any text as speech
<SpeakButton text="Hello from Cencori." model="aura-asteria-en" apiKey={key} />HTTP API
Speech (TTS)
curl -X POST https://cencori.com/api/ai/audio/speech \
-H "CENCORI_API_KEY: csk_..." \
-H "Content-Type: application/json" \
-d '{
"input": "Hello world",
"model": "aura-asteria-en"
}' \
--output speech.mp3The response carries an X-Provider header telling you which provider served the request.
Transcription (STT)
curl -X POST https://cencori.com/api/ai/audio/transcriptions \
-H "CENCORI_API_KEY: csk_..." \
-F file=@audio.mp3 \
-F model=nova-3 \
-F diarize=true \
-F response_format=verbose_jsonPricing & billing
TTS bills per 1,000 characters; STT bills per minute of audio. Every request is logged to ai_requests with the provider, model, provider cost, and your Cencori charge (provider cost + markup) — visible in the dashboard alongside chat and vision usage. BYOK keys are used when configured; otherwise the platform key is used.

