Transcribes an audio buffer using the OpenAI Whisper API.
The audio is sent as a multipart form upload with the file, model, and optional parameters (language, prompt, temperature, response_format).
Raw audio data and metadata. The data buffer is wrapped
in a Blob and sent as a form file field. If fileName is not provided,
a default name is generated from the format field.
Optional transcription settings including language hint, context prompt, temperature for sampling, and response format.
A promise resolving to the normalized transcription result.
When the OpenAI API returns a non-2xx status code.
const result = await provider.transcribe(
{ data: mp3Buffer, mimeType: 'audio/mpeg', fileName: 'voice.mp3' },
{ language: 'fr', prompt: 'Discussion about AI' },
);
Readonly idUnique provider identifier used for registration and resolution.
Readonly displayHuman-readable display name for UI and logging.
Readonly supportsWhisper API is batch-only; streaming requires a WebSocket adapter.
Speech-to-text provider that uses the OpenAI transcription API.
API Contract
POST {baseUrl}/audio/transcriptionsAuthorization: Bearer <apiKey>multipart/form-data(FormData with file blob)response_formatfield. When the caller names none, OpenAI'sgpt-transcription models are asked forjson, and every other model,whisper-1and a whisper-compatible server's own included, forverbose_json(segments, language and duration).Models
gpt-transcribe(default): the model OpenAI recommends for recorded speech. It returns the text and the detectedlanguages, and it takes language hints as alanguageslist.whisper-1: removed from the API on 2027-02-26. It serves segment timestamps,srtandvtt, so a call that asks for one of those formats runs on it unless the call names a model or the configured model serves the format itself. A configuredgpt-model does not.Supported Response Formats
verbose_json: full JSON with segments, duration and language (whisper-1)json: JSON with the text (the newer models also returnlanguages)text: plain text, no JSONsrt: SubRip subtitles (whisper-1)vtt: WebVTT subtitles (whisper-1)When
text,srt, orvttformat is used, the response is returned as plain text and segments are not available.See
OpenAIWhisperSpeechToTextProviderConfig for configuration options See
normalizeSegments()for the segment normalization logic.Example