Skip to content

Audio

BVE Gateway supports two audio endpoints: speech synthesis (TTS) and audio transcription (Whisper).

POST https://api.bve.me/v1/audio/speech

Requires Authorization: Bearer sk-bve-YOUR_KEY.

Converts text to audio. Returns a binary audio stream (audio/mpeg).

{
"model": "tts-1",
"input": "Hello, world!",
"voice": "alloy"
}
FieldTypeRequiredDescription
modelstringYestts-1, tts-1-hd, or gpt-4o-mini-tts
inputstringYesText to synthesize (max 4096 characters)
voicestring or objectYesBuilt-in voice ID or a custom voice object like { "id": "voice_1234" }
instructionsstringNoVoice/style instructions (max 4096 characters). Not supported by tts-1 or tts-1-hd.
response_formatstringNoAudio format: mp3 (default), opus, aac, flac, wav, pcm
speednumberNoSpeed multiplier 0.25–4.0 (default 1.0)
stream_formatstringNoStream mode: audio or sse. sse is not supported by tts-1 or tts-1-hd.

Supported voices:

VoiceDescription
alloyNeutral, balanced
ashWarm, conversational
balladRich, lyrical
cedarGrounded, resonant
coralBright, expressive
echoClear, precise
fableStorytelling cadence
marinNatural, polished
novaEnergetic, upbeat
onyxDeep, authoritative
sageCalm, measured
shimmerSoft, gentle
verseCrisp, articulate

Custom voices created upstream can also be referenced by passing a voice object with an id field, for example:

{
"model": "gpt-4o-mini-tts",
"input": "Hello from a custom voice.",
"voice": { "id": "voice_1234" }
}
Terminal window
curl https://api.bve.me/v1/audio/speech \
-H "Authorization: Bearer sk-bve-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "Hello from BVE Gateway!",
"voice": "alloy"
}' \
--output speech.mp3
import OpenAI from 'openai';
import fs from 'fs';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
const mp3 = await client.audio.speech.create({
model: 'tts-1',
voice: 'alloy',
input: 'Hello from BVE Gateway!',
});
const buffer = Buffer.from(await mp3.arrayBuffer());
fs.writeFileSync('speech.mp3', buffer);

For lower latency, stream audio bytes as they are generated rather than waiting for the full audio file:

import OpenAI from 'openai';
import fs from 'fs';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
const response = await client.audio.speech.create({
model: 'gpt-4o-mini-tts',
voice: 'alloy',
input: 'Streaming audio from BVE Gateway.',
response_format: 'mp3',
});
const writeStream = fs.createWriteStream('speech.mp3');
for await (const chunk of response.body as AsyncIterable<Uint8Array>) {
writeStream.write(chunk);
}
writeStream.end();
  • Response is a binary audio stream, not JSON.
  • tts-1-hd produces higher-quality audio at higher latency and cost.
  • gpt-4o-mini-tts is a GPT-4o-mini-based TTS model with improved naturalness.
  • All three fields (model, input, voice) are required. Missing or invalid values return 400 missing_required_parameter or 400 invalid_value.
  • input is limited to 4096 characters. Oversized TTS inputs are rejected at the gateway with 400 invalid_value.
  • voice may be either a built-in string or a custom voice object with an id field.
  • instructions must be a string of 4096 characters or fewer when provided.
  • Invalid response_format values and out-of-range speed values are rejected at the gateway with 400 invalid_value before the request is proxied upstream.
  • stream_format must be either audio or sse.
  • Sending a TTS model to any other endpoint (e.g., /v1/chat/completions) returns 400 model_endpoint_mismatch.

POST https://api.bve.me/v1/audio/transcriptions

Requires Authorization: Bearer sk-bve-YOUR_KEY.

Transcribes audio to text using Whisper. Accepts multipart/form-data.

FieldTypeRequiredDescription
filebinaryYesAudio file (mp3, mp4, mpeg, mpga, m4a, wav, webm)
modelstringYesSee model table below
languagestringNoISO-639-1 language code (e.g. en)
promptstringNoOptional context/style prompt
response_formatstringNojson (default), text, srt, verbose_json, vtt
temperaturenumberNoSampling temperature 0–1
timestamp_granularities[]string[]NoTimestamp granularities to include: word, segment (repeated form field)
Terminal window
curl https://api.bve.me/v1/audio/transcriptions \
-H "Authorization: Bearer sk-bve-YOUR_KEY" \
-F file="@audio.mp3" \
-F model="whisper-1"

Response:

{
"text": "Hello, this is the transcribed text."
}
import OpenAI from 'openai';
import fs from 'fs';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
const transcription = await client.audio.transcriptions.create({
file: fs.createReadStream('audio.mp3'),
model: 'whisper-1',
});
console.log(transcription.text);
const transcription = await client.audio.transcriptions.create({
file: fs.createReadStream('audio.mp3'),
model: 'whisper-1',
response_format: 'verbose_json',
timestamp_granularities: ['word'],
});
for (const word of transcription.words ?? []) {
console.log(`${word.word}: ${word.start}s – ${word.end}s`);
}
ModelProviderNotes
whisper-1OpenAIStandard Whisper transcription
gpt-4o-transcribeOpenAIGPT-4o-based transcription (auto-updates to latest)
gpt-4o-transcribe-2025-03-20OpenAIPinned March 2025 snapshot of gpt-4o-transcribe
gpt-4o-mini-transcribeOpenAILighter, faster GPT-4o Mini-based transcription
gpt-4o-transcribe-diarizeOpenAIGPT-4o transcription with speaker diarization (auto-updates)
gpt-4o-transcribe-diarize-2025-03-20OpenAIPinned March 2025 snapshot of gpt-4o-transcribe-diarize
whisper-large-v3GroqGroq-hosted Whisper large v3
whisper-large-v3-turboGroqFaster Groq Whisper large v3
distil-whisper-large-v3-enGroqGroq distilled Whisper (English only, fastest)
  • Both model and file fields are required. Missing either returns 400 missing_required_parameter.
  • Sending a TTS, embedding, or image-generation model to this endpoint returns 400 model_endpoint_mismatch.
  • Audio translations (POST /v1/audio/translations) are not supported by Fuelix and return 404.
  • Maximum file size is 25 MB (OpenAI limit; Fuelix may enforce lower).
  • The multipart request is forwarded directly — no re-encoding.
  • response_format must be one of json, text, srt, verbose_json, vtt. Invalid values return 400 invalid_value at the gateway.
  • temperature must be a number in [0, 1]. Non-numeric strings return 400 invalid_type; out-of-range values return 400 invalid_value.
  • timestamp_granularities[] is sent as repeated form fields (e.g. -F 'timestamp_granularities[]=word' -F 'timestamp_granularities[]=segment'). Each value must be word or segment; unknown values return 400 invalid_value with param: "timestamp_granularities".

BVE Gateway adds the following headers to every audio endpoint response:

HeaderExampleDescription
X-Request-Id550e8400-…Server-generated UUID for this request
X-BVE-Client-Idmy-trace-123Echo of the client-supplied X-Request-Id (when present and valid). Absent when not sent or invalid.
X-BVE-Latency312Total gateway latency in milliseconds
X-BVE-Modeltts-1Model ID used for this request
X-BVE-Key-Nameprod-keyDisplay name of the authenticated key

The standard X-RateLimit-* per-key headers (requests per minute, per day, and optional monthly caps) are also present. See Rate Limits & Quotas for the full table.