Audio

Text-to-speech and transcription (Whisper) endpoints for generating audio from text and converting audio files to text.

Tchavi supports two audio endpoints: text-to-speech (TTS) for generating audio from text, and transcription (Whisper) for converting audio files to text.

Text-to-Speech

POST/v1/audio/speech

Converts text to spoken audio. Returns raw audio bytes. Billing is per 1K characters of input, prorated to the character and rounded up once to a thousandth of a credit.

OpenAI's voices stop on 6 January 2027

OpenAI shuts down tts-1, tts-1-hd and gpt-4o-mini-tts on 6 January 2027, and Tchavi stops serving them that day. Move to voxtral-tts-3 or gemini-3.8-flash-lite-tts: change the model and the voice, whose names differ. Neither takes speed, instructions or language.

ModelCredits / 1K charsMax inputNotes
voxtral-tts-3294 096 charsMistral. 66 preset voices, including a French voice in six moods (fr_marie_neutral, fr_marie_happy…). mp3 by default
gemini-3.8-flash-lite-tts33.81 until 31 Dec 2026, then 67.624 096 charsGoogle. 30 voices (Kore, Puck, Charon…). Answers wav (24 kHz, the default) or raw pcm only
tts-1324 096 charsOpenAI. Fastest. Retires 6 January 2027
tts-1-hd644 096 charsOpenAI. Higher audio quality. Retires 6 January 2027
gpt-4o-mini-tts402 000 charsOpenAI. Steerable: accepts instructions to direct tone, pace, accent, emotion. Retires 6 January 2027

Until 31 December 2026, gemini-3.8-flash-lite-tts is half price: 33.81 credits per 1,000 characters. On 1 January 2027 the rate becomes 67.62 credits, because Google doubles the price of its audio output that day.

ParameterTypeRequiredDescription
modelstringYesOne of the models above
inputstringYesThe text to convert to speech (max 4 096 characters; 2 000 for gpt-4o-mini-tts)
voicestringYesvoxtral-tts-3 and gemini-3.8-flash-lite-tts: one of the model's preset voices, listed on its model page; any other is refused with a 400, free. OpenAI models: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer; gpt-4o-mini-tts also accepts cedar, marin and verse
instructionsstringNogpt-4o-mini-tts only: how to speak, e.g. "Warm, slow, like a bedtime story". Other models reject it with a 400
response_formatstringNovoxtral-tts-3: mp3, wav, pcm, flac, opus (default mp3). gemini-3.8-flash-lite-tts: wav or pcm (default wav). OpenAI models: mp3, opus, aac, flac, wav, pcm (default mp3). The first two refuse any other value with a 400, free
speednumberNoOpenAI models only: playback speed 0.25–4.0. Default: 1.0. The other two refuse any speed but 1 with a 400, free
import Tchavi from '@tchavi/sdk';
import { writeFileSync } from 'fs';

const client = new Tchavi({ apiKey: 'YOUR_API_KEY' });

const response = await client.audio.speech.create({
  model: 'voxtral-tts-3',
  input: 'Tchavi is the best AI API gateway in Africa.',
  voice: 'gb_jane_neutral',
  response_format: 'mp3',
});

const buffer = Buffer.from(await response.arrayBuffer());
writeFileSync('speech.mp3', buffer);

Transcription (Whisper)

POST/v1/audio/transcriptions

Transcribes audio files to text. Send as multipart/form-data. Billing is 13 credits per minute of audio, rounded up to the next whole minute; the actual audio duration is returned in tchavi.duration_minutes (for example 0.16 for 10 seconds), before that rounding.

ParameterTypeRequiredDescription
modelstringYes"whisper-1"
filefileYesAudio file (mp3, wav, m4a, webm, ogg…). Max 25 MB
languagestringNoISO-639-1 code (e.g. "fr", "en"). Auto-detected if omitted
response_formatstringNojson, text, srt, vtt, verbose_json. Default: json
promptstringNoOptional text to guide the model's style or continue a previous segment. Must match the audio language.
temperaturenumberNoSampling temperature 0–1. Higher values yield more varied transcriptions. Default: 0

Transcription models (pass the id as model):

ModelCredits per minuteBillingFormatsMax fileLanguages
whisper-113Rounded up to the whole minutemp3, wav, m4a, webm, ogg…25 MBAuto-detected
scribe-v28.491Per second of audioAudio files25 MB90+, including French, Swahili and Hausa
mai-transcribe-23.860Per second of audioWAV, MP3, FLAC25 MB60, including French and Swahili; detected if omitted

scribe-v2 and mai-transcribe-2 answer in json or verbose_json only, and refuse prompt and keyterms. mai-transcribe-2, like scribe-v2, accepts diarize=true (with response_format=verbose_json), which asks for labels on who speaks. We have not measured the quality of those labels on mai-transcribe-2. Wolof, Yoruba, Hausa, Lingala and Fon are not among the 60 languages of mai-transcribe-2: use scribe-v2 for more African languages. The maker's launch rate for mai-transcribe-2 ends on 31 December 2026, so its price may change from January 2027.

import Tchavi from '@tchavi/sdk';
import { createReadStream } from 'fs';

const client = new Tchavi({ apiKey: 'YOUR_API_KEY' });

const result = await client.audio.transcriptions.create({
  model: 'whisper-1',
  file: createReadStream('audio.mp3'),
  language: 'fr',
});

console.log(result.text);
console.log('Duration:', result.tchavi.duration_minutes, 'min');
console.log('Credits used:', result.tchavi.credits_used);

On this page