LLM Gateway
Features

Transcription

Transcribe audio into text (speech-to-text) with word-level timestamps through the audio transcriptions API

LLMGateway exposes a dedicated /v1/audio/transcriptions endpoint for speech-to-text. It transcribes audio files into text with word-level timestamps, optional speaker diarization, and inverse text normalization (spoken numbers and currencies formatted in their written form).

Use it when you want to:

  • Turn recordings, voicemails, or podcast episodes into text
  • Generate captions or searchable transcripts with per-word timing
  • Feed spoken content into a downstream model or RAG pipeline

For the full request and response schema, see the API reference.

Endpoint

POST https://api.llmgateway.io/v1/audio/transcriptions

Authenticate with your LLMGateway API key:

-H "Authorization: Bearer $LLM_GATEWAY_API_KEY"

Transcription models are billed per hour of input audio, against the duration reported by the provider. See the models page for available models and their rates.

Parameters

The request body is multipart/form-data. Either file or url must be provided.

ParameterTypeDefaultDescription
modelstringrequiredThe transcription model to use
filefile—The audio file to transcribe (WAV, MP3, OGG, Opus, FLAC, AAC, MP4, M4A, and more)
urlstring—URL of an audio file to download and transcribe instead of uploading one
languagestring—Language code (e.g. en). Improves accuracy; on xAI it also formats numbers and currencies
diarizestringfalseWhen "true", each word in the response includes a speaker field identifying the detected speaker
filler_wordsstringfalseWhen "true", filler words (e.g. "uh", "um") are kept in the transcript instead of being removed
keytermstring—A key term to bias transcription toward (e.g. product names). Repeat the field for multiple terms. Not supported by ElevenLabs models

Response

The response includes the full transcript, audio duration, and word-level timestamps:

{
	"text": "The balance is $167,983.15.",
	"language": "English",
	"duration": 3.45,
	"words": [
		{ "text": "The", "start": 0.24, "end": 0.48 },
		{ "text": "balance", "start": 0.48, "end": 0.96 },
		{ "text": "is", "start": 0.96, "end": 1.12 },
		{ "text": "$167,983.15.", "start": 1.12, "end": 3.2 }
	],
	"usage": {
		"type": "duration",
		"seconds": 3.45,
		"cost": 0.0000958333,
		"cost_details": {
			"audio_input_cost": 0.0000958333,
			"request_cost": 0,
			"total_cost": 0.0000958333
		}
	}
}

usage.cost is what the request was billed in USD for usage.seconds of audio (see Cost Breakdown).

curl

curl -X POST "https://api.llmgateway.io/v1/audio/transcriptions" \
  -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \
  -F model=grok-stt-1-0 \
  -F language=en \
  -F file=@audio.mp3

Transcribing from a URL

curl -X POST "https://api.llmgateway.io/v1/audio/transcriptions" \
  -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \
  -F model=grok-stt-1-0 \
  -F url="https://example.com/audio.mp3"

How is this guide?

Last updated on

On this page

Ready for production?

Ship to production with SSO, audit logs, spend controls, and guardrails your security team will approve.

Explore Enterprise