Audio and STT
Transcribe or translate audio through the route assigned to your API key.
LatentKit supports audio input and speech-to-text through routed /v1
endpoints. Use /v1/transcription for transcription and /v1/translation for
audio translation. Queued transcription is available through
/v1/transcription/jobs for enabled workspaces.
For the reverse direction — generating spoken audio from text — see Speech (Text-to-Speech).
Your application still authenticates with one LatentKit API key. The key's assigned route must include an audio_input model, such as OpenAI gpt-4o-transcribe, gpt-4o-mini-transcribe, gpt-4o-transcribe-diarize, or whisper-1.
Batch Transcription
POST /v1/transcription accepts JSON or multipart form data.
Multipart upload
Use multipart form data when your backend has a local audio file.
curl https://ai.latentkit.com/v1/transcription \
-H "Authorization: Bearer $LATENTKIT_API_KEY" \
-F [email protected] \
-F language=en \
-F response_format=jsonJSON input
Use JSON when your backend already has base64 audio or an approved audio URL.
curl https://ai.latentkit.com/v1/transcription \
-H "Authorization: Bearer $LATENTKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"audio": {
"base64": "<base64-audio>",
"media_type": "audio/mpeg",
"filename": "meeting.mp3"
},
"language": "en",
"response_format": "json"
}'Required audio input can be one of:
- multipart
file audio.base64audio.dataaudio.url- base64
input
Audio files are capped at 25 MiB by default. Supported OpenAI-compatible upload formats include mp3, mp4, mpeg, mpga, m4a, wav, and webm.
Common STT fields:
mode:batch,async, orrealtimelanguagediarizationspeaker_count_hinttimestamps:word,segment, orbothcustom_vocabulary/keytermssmart_formattingdetect_languageprofanity_filterredactionmultichannel
Required features are checked before provider selection. If a fallback route would drop a required feature such as diarization, timestamps, redaction, realtime mode, or keyterms, routing fails closed instead of silently degrading the transcript.
OpenAI Transcribe Models
OpenAI-compatible transcription routes are first-class audio_input routes in LatentKit.
| Model | Typical use | Notes |
|---|---|---|
gpt-4o-transcribe | Higher-quality batch transcription | Supports prompt context and JSON or text responses |
gpt-4o-mini-transcribe | Lower-cost batch transcription | Supports prompt context and JSON or text responses |
gpt-4o-transcribe-diarize | Speaker-aware transcripts | Use with diarization and response_format: "diarized_json" when configured on the route |
whisper-1 | Compatibility, translations, and timestamp-heavy workflows | Supports verbose timestamp formats where the upstream model allows them |
LatentKit decides the exact provider/model from the route assigned to the API key. Do not send provider or model in application requests; transcription route-control fields are rejected, including nested audio.provider and audio.model.
SDK Examples
import { LatentKit } from '@latentkit/sdk';
const client = new LatentKit({
apiKey: process.env.LATENTKIT_API_KEY!,
});
const transcript = await client.transcription.create({
audio: {
base64: '<base64-audio>',
media_type: 'audio/mpeg',
filename: 'meeting.mp3',
},
language: 'en',
prompt: 'Meeting about product roadmap and LatentKit routing.',
response_format: 'json',
});
console.log(transcript.content);import os
from latentkit import LatentKit
with LatentKit(api_key=os.environ["LATENTKIT_API_KEY"]) as client:
transcript = client.transcription.create(
audio={
"base64": "<base64-audio>",
"media_type": "audio/mpeg",
"filename": "meeting.mp3",
},
language="en",
prompt="Meeting about product roadmap and LatentKit routing.",
response_format="json",
)
print(transcript["content"])Response Shape
STT responses use the same routed response envelope as chat responses and may include:
textincontentstatuslanguagelanguage_confidenceduration_secondssegmentswordswarningsusage.audio_secondsusage.billable_audio_seconds
Available providers
The live provider and model list depends on your workspace connections and
plan. Open Connections and Routes in the console to see which
audio_input models can be assigned to your key.
Audio URL Safety
Remote audio.url input may be disabled for your workspace. When it is
available, the URL must use HTTPS, match an approved host, return a supported
audio type and declared size, and remain within the service limits. Use a
multipart upload or base64 input when remote URLs are unavailable.
Managed Billing
Platform Access audio availability depends on the selected model, plan, and supported usage metering. BYOK uses your provider account. Check the route and estimated cost in the console before sending production audio workloads.