Docs/AI SDK

Endpoints

Audio Endpoint

Last updated March 3, 2026

Speech-to-text transcription and text-to-speech generation.

Convert speech to text and text to speech using OpenAI's Whisper and TTS models.

Transcription (Speech-to-Text)

Codetext
const response = await cencori.ai.transcribe({
  file: audioFile,  // File, Blob, or Buffer
  model: 'whisper-1'
});
 
console.log(response.text);

Parameters

ParameterTypeRequiredDescription
fileFileYesAudio file
modelstringYes'whisper-1'
languagestringNoSource language
promptstringNoContext hint
responseFormatstringNo'json', 'text', 'srt', 'vtt'

Text-to-Speech

Codetext
const response = await cencori.ai.speech({
  input: 'Hello, welcome to Cencori',
  model: 'tts-1',
  voice: 'alloy'
});
 
// response.audio is an ArrayBuffer
const blob = new Blob([response.audio], { type: 'audio/mpeg' });

Parameters

ParameterTypeRequiredDescription
inputstringYesText to speak
modelstringYes'tts-1' or 'tts-1-hd'
voicestringYesVoice selection
speednumberNo0.25 to 4.0
responseFormatstringNo'mp3', 'opus', 'aac', 'flac'

Available Voices

VoiceDescription
alloyNeutral tone
echoWarm, conversational
fableExpressive, dramatic
onyxDeep, authoritative
novaFriendly, upbeat
shimmerSoft, calm

HTTP API

Transcription

Codetext
curl -X POST https://cencori.com/api/ai/audio/transcriptions \
  -H "CENCORI_API_KEY: csk_..." \
  -F file=@audio.mp3 \
  -F model=whisper-1

Speech

Codetext
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": "tts-1",
    "voice": "alloy"
  }' \
  --output speech.mp3