@ai_kit/core includes model-agnostic audio transcription support, compatible with any OpenAI-compatible endpoint (Scaleway Whisper large v3, OpenAI whisper-1, etc.).
Four public primitives
| Export | Role |
|---|---|
createTranscriptionModel(config) | Creates a TranscriptionModelV3 provider |
createTranscriptionStreamingModel(config) | Creates a native streaming model (no AI SDK) that emits partial text over SSE |
transcribe(options) | Standalone function: loads audio (path / URL / buffer), calls the model, returns the transcript |
createTranscriptionTool(model, options?) | Returns an AI SDK tool() to attach directly to an Agent |
createTranscriptionModel
/audio/transcriptions endpoint (response_format=verbose_json).
transcribe
audio accepts a file path, an http(s) URL, or a Buffer / Uint8Array. The inputType is auto-detected when omitted.
Return value
createTranscriptionStreamingModel — streaming (native)
For long recordings you can stream the transcript as it is produced instead of waiting for the whole file. This primitive talks directly to the OpenAI-compatible /audio/transcriptions endpoint with stream=true and parses the server-sent events natively — it does not use the AI SDK’s experimental_transcribe.
Chunk shape
delta events carry incremental text; the single closing done event carries the full accumulated text (equal to the concatenation of all deltas). Pass an AbortSignal via abortSignal to cancel mid-stream.
Streaming uses the default JSON stream format —
verbose_json (and therefore per-segment timestamps) is not available while streaming. Use transcribe / createTranscriptionModel when you need segments.createTranscriptionTool — attach to an Agent
audio (path / URL / base64), inputType, language.
Supported audio formats
flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm (identical to OpenAI Whisper).