For the complete documentation index, see llms.txt. This page is also available as Markdown.

Speech to Text (Transcriptions)

Transcribe Audio (Speech to Text)

post

Transcribes an audio file to text. This is the single speech-to-text endpoint on FastRouter — it is OpenAI-compatible (same multipart form fields and the same response shapes as POST https://api.openai.com/v1/audio/transcriptions) and it also serves non-OpenAI STT models such as sarvam/saaras:v3.

Available at both:

  • POST https://api.fastrouter.ai/api/v1/audio/transcriptions

  • POST https://api.fastrouter.ai/v1/audio/transcriptions

Send the request as multipart/form-data with the audio in the file form field. Max upload size at the gateway: 64 MiB (openai/whisper-1 additionally caps uploads at 25 MB upstream).

curl --request POST \
  --url https://api.fastrouter.ai/api/v1/audio/transcriptions \
  --header 'authorization: Bearer $FASTROUTER_API_KEY' \
  --header 'content-type: multipart/form-data' \
  --form model=openai/whisper-1 \
  --form 'file=@/path/to/recording.mp3'

Only model and file are required. Every other field is model-specific and is forwarded only to providers that understand it:

Model
Supported optional fields

openai/whisper-1

language, prompt, response_format, temperature, timestamp_granularities[]

openai/gpt-4o-transcribe, openai/gpt-4o-mini-transcribe

language, prompt, response_format (json/text), temperature, chunking_strategy, include[]

sarvam/saaras:v3

language_code, mode, input_audio_codec

Tip: Call GET /api/v1/models and inspect each model's supported_parameters and supported_params_details to see exactly which fields it accepts and the allowed values, ranges, or enums.

Streaming is not supported on this endpoint yet — sending stream=true returns 400.

Response shape. Providers that return an OpenAI-shaped body (the OpenAI models) are passed through verbatim, so segments, words, and logprobs survive; FastRouter merges chat_id and usage.cost into the JSON. Providers that only return a transcript (e.g. Sarvam) get an OpenAI-shaped body synthesized from the transcript, so text is always present for response_format=json.

Billing is per second of audio for duration-billed models (whisper-1, Sarvam) and per token for OpenAI's token-billed transcribe models. The :free slug and fastrouter/free free-tier routing apply here as they do on /chat/completions.

OpenAI reference: https://developers.openai.com/api/reference/resources/audio/subresources/transcriptions/methods/create

Authorizations
AuthorizationstringRequired

FastRouter API Key. Get yours at https://fastrouter.ai

Format: Authorization: Bearer YOUR_API_KEY

Body
modelstringRequired

Speech-to-text model ID in provider/model format — e.g. openai/whisper-1, openai/gpt-4o-transcribe, sarvam/saaras:v3. The bare whisper-1 is also accepted for OpenAI SDK compatibility. Append :free to serve the request from the daily free-tier quota when the model is opted in.

Example: openai/whisper-1
filestring · binaryRequired

Audio file to transcribe. Required. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm. Max upload size: 64 MiB (25 MB for openai/whisper-1).

languagestringOptional

OpenAI models. ISO-639-1 language code of the input audio (e.g. en, es, fr, de). Improves accuracy and latency. Sarvam models use language_code instead.

Example: en
promptstringOptional

OpenAI models. Text prompt to guide the transcription style or continue a previous segment. Can include punctuation, casing, or specific vocabulary.

response_formatstring · enumOptional

Output format:

  • json (default) — JSON with a text field
  • text — plain text only
  • srt — SubRip subtitle format
  • vtt — WebVTT subtitle format
  • verbose_json — JSON with metadata and timestamps

srt, vtt, and verbose_json are supported by whisper-1 only; gpt-4o-transcribe and gpt-4o-mini-transcribe support json and text. Sarvam models always return the json shape.

Default: jsonPossible values:
temperaturenumber · max: 1Optional

OpenAI models. Sampling temperature (0-1). Lower values make output more focused and deterministic; higher values increase randomness.

Default: 0
chunking_strategystringOptional

OpenAI gpt-4o-transcribe / gpt-4o-mini-transcribe. Controls how long audio is split into chunks (e.g. auto, or a server-VAD config). Not supported by whisper-1. Forwarded verbatim to the provider when set.

known_speaker_names[]string[]Optional

OpenAI diarizing models (gpt-4o-transcribe-diarize). Names for the speakers referenced by known_speaker_references[], in the same order. Forwarded verbatim to the provider when set.

known_speaker_references[]string[]Optional

OpenAI diarizing models (gpt-4o-transcribe-diarize). Short reference audio samples (data URIs) for the speakers named in known_speaker_names[], in the same order. Forwarded verbatim to the provider when set.

language_codestringOptional

Sarvam models. BCP-47 language code of the audio (e.g. hi-IN, en-IN). Forwarded to the provider when set; omit to let the provider auto-detect.

Example: hi-IN
modestringOptional

Sarvam models. Provider-specific transcription mode. Forwarded verbatim to the provider when set.

input_audio_codecstringOptional

Sarvam models. Codec hint for the uploaded audio (e.g. mp3, wav). Forwarded verbatim to the provider when set.

Example: mp3
Responses
200

Transcription successful

or
post/api/v1/audio/transcriptions
POST /api/v1/audio/transcriptions HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 61

{
  "model": "openai/whisper-1",
  "file": "(binary: recording.mp3)"
}
{
  "text": "Hello, this is a sample transcription of the audio file.",
  "chat_id": "fr_01ABCXYZ",
  "usage": {
    "type": "duration",
    "seconds": 2,
    "cost": 0.0001
  }
}

Translate Audio to English

post

Translates audio to English text using openai/whisper-1, regardless of source language. Supports MP3, MP4, MPEG, M4A, WAV, WEBM formats (max 25MB). Output formats: json, text, srt, vtt, verbose_json.

Authorizations
AuthorizationstringRequired

FastRouter API Key. Get yours at https://fastrouter.ai

Format: Authorization: Bearer YOUR_API_KEY

Body
filestring · binaryRequired

Audio file to translate to English. Supported formats: mp3, mp4, mpeg, mpga, m4a, wav, webm. Max size: 25MB

modelstring · enumRequired

Model to use for translation. Must be 'whisper-1' or 'openai/whisper-1'

Example: whisper-1Possible values:
promptstringOptional

Optional: English text prompt to guide the translation style. Can help with proper nouns, acronyms, or domain-specific vocabulary.

response_formatstring · enumOptional

Output format:

  • json: Basic JSON with translated English text
  • text: Plain English text only
  • srt: SubRip subtitle format (English)
  • vtt: WebVTT subtitle format (English)
  • verbose_json: JSON with metadata and timestamps
Default: jsonPossible values:
temperaturenumber · max: 1Optional

Sampling temperature (0-1). Lower values (e.g., 0.1) make output more focused and deterministic. Use 0 for most consistent translations.

Default: 0
Responses
200

Translation successful - output is in English

or
post/api/v1/audio/translations
POST /api/v1/audio/translations HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 84

{
  "model": "whisper-1",
  "file": "(binary: speech_spanish.mp3)",
  "response_format": "json"
}
{
  "text": "Hello, this is a sample translation to English."
}

Last updated