moeru-ai/airi · error
No audio file provided for transcription.
Error message
No audio file provided for transcription.
What it means
The MiMo transcription provider wraps xsAI-style speech transcription by intercepting the fetch call. The adapter expects the SDK to issue the request as a FormData body containing an audio file under the 'file' key. When the body is not FormData at all, this error is thrown to signal that no audio was supplied to the transcription call.
Source
Thrown at packages/provider-inference/src/providers/cloud/mimo-audio/index.ts:174
for (const byte of bytes)
binary += String.fromCharCode(byte)
return `data:${file.type || 'audio/wav'};base64,${btoa(binary)}`
}
function createMimoTranscriptionProvider(config: MimoTranscriptionConfig) {
const apiKey = config.apiKey?.trim() ?? ''
const baseUrl = normalizeBaseUrl(config.baseUrl)
const defaultModel = config.model || 'mimo-v2-omni'
return {
transcription: (model: string) => ({
baseURL: baseUrl,
model: model || defaultModel,
headers: {},
fetch: async (_input: RequestInfo | URL, init?: RequestInit) => {
if (!(init?.body instanceof FormData))
throw new Error('No audio file provided for transcription.')
const file = init.body.get('file')
if (!(file instanceof Blob))
throw new Error('No audio file provided for transcription.')
const modelName = String(init.body.get('model') || defaultModel)
const dataUri = await readBlobAsDataUri(file)
const base64Data = dataUri.split(',')[1]
const response = await fetch(new URL('chat/completions', baseUrl), {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'api-key': apiKey },
body: JSON.stringify({
model: modelName,
messages: [{
role: 'user',
content: [
{ type: 'text', text: 'Transcribe the audio content.' },
{ type: 'input_audio', input_audio: { data: base64Data, format: audioFormatFromDataUri(dataUri) } },View on GitHub (pinned to f679616c34)
Solutions
- Pass the audio via the SDK's transcription API with a File/Blob so it is encoded as multipart FormData under the 'file' field.
- Verify no middleware or wrapper replaces init.body with a string or object before the provider fetch runs.
- If calling fetch manually, construct FormData with fields 'file' (Blob) and 'model' and pass it as init.body.
- Ensure the input is actually audio (Blob/File), not a URL string or base64 string.
Example fix
// before
await provider.transcription('mimo-audio').do({ input: audioBase64 })
// after
const form = new FormData()
form.append('file', audioFile, 'audio.wav')
form.append('model', 'mimo-audio')
await fetch(url, { method: 'POST', body: form }) Defensive patterns
Strategy: validation
Validate before calling
if (!(audio instanceof Blob)) throw new TypeError('transcription requires a Blob audio file')
const form = new FormData()
form.append('file', audio, 'audio.wav') Type guard
const isBlob = (v: unknown): v is Blob => typeof Blob !== 'undefined' && v instanceof Blob
Try / catch
try { await transcribe(audio) } catch (e) { if (e.message.includes('No audio file provided')) { /* rebuild FormData with Blob under 'file' */ } else throw e } Prevention
- Always pass a real File/Blob, never a path or base64 string
- Use the SDK's transcription helper rather than manual fetch
- Keep field name 'file' in FormData
- Test middleware doesn't rewrite the request body
When it happens
Trigger: Calling provider.transcription(model) and issuing a request whose init.body is not a FormData instance — e.g. a string body, JSON body, undefined body, or a fetch call made directly against the baseURL without multipart encoding.
Common situations: Consumers bypass the SDK's transcription helper and call fetch manually with JSON; a custom HTTP client or middleware strips or replaces the FormData body; using a runtime where the xsAI SDK serializes the request differently than expected; passing audio incorrectly so the SDK sends a plain object.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- MiMo transcription failed: ${response.status} ${response.sta
- Invalid speech request body
- PCM16 input must contain complete 16-bit samples.
- No compatible input provided for streaming transcription.
- File input is required for transcription.
AI-assisted analysis of moeru-ai/airi@f679616c34 (2026-09-08).
Data as JSON: /api/errors/d20c6e494256c92e.
Report an issue: GitHub.