{"record":{"id":"0252b292ca5c90a0","repo":"moeru-ai/airi","slug":"mimo-transcription-failed-response-status-re-0252b2","errorCode":null,"errorMessage":"MiMo transcription failed: ${response.status} ${response.statusText}${errorBody ? ` — ${errorBody}` : ''}","messagePattern":"MiMo transcription failed: (.+?) (.+?)(.+?)` : ''\\}","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/provider-inference/src/providers/cloud/mimo-audio/index.ts","lineNumber":199,"sourceCode":"        const dataUri = await readBlobAsDataUri(file)\n        const base64Data = dataUri.split(',')[1]\n        const response = await fetch(new URL('chat/completions', baseUrl), {\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json', 'api-key': apiKey },\n          body: JSON.stringify({\n            model: modelName,\n            messages: [{\n              role: 'user',\n              content: [\n                { type: 'text', text: 'Transcribe the audio content.' },\n                { type: 'input_audio', input_audio: { data: base64Data, format: audioFormatFromDataUri(dataUri) } },\n              ],\n            }],\n          }),\n        })\n        if (!response.ok) {\n          const errorBody = await response.text().catch(() => '')\n          throw new Error(`MiMo transcription failed: ${response.status} ${response.statusText}${errorBody ? ` — ${errorBody}` : ''}`)\n        }\n\n        const data = await response.json() as { choices?: Array<{ message?: { content?: string } }> }\n        return new Response(JSON.stringify({ text: data.choices?.[0]?.message?.content || '' }), {\n          status: 200,\n          headers: { 'Content-Type': 'application/json' },\n        })\n      },\n    }),\n  }\n}\n\nexport const providerMimoAudioSpeech = defineProvider<MimoSpeechConfig, 'mimo-audio-speech'>({\n  id: 'mimo-audio-speech',\n  name: 'Xiaomi MiMo',\n  nameLocalize: ({ t }) => t('settings.pages.providers.provider.mimo.title'),\n  description: 'api.xiaomimimo.com',\n  descriptionLocalize: ({ t }) => t('settings.pages.providers.provider.mimo.description'),","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/moeru-ai/airi/blob/f679616c34f1cf6d282c8d64264242af944b3fed/packages/provider-inference/src/providers/cloud/mimo-audio/index.ts#L181-L217","documentation":"The MiMo adapter converts the audio to base64 and posts to MiMo's chat/completions endpoint. If that upstream HTTP response is not ok (non-2xx), it surfaces the status, statusText, and any response body as this error. It is an upstream API failure relayed to the caller.","triggerScenarios":"MiMo's chat/completions endpoint returns 401 (bad API key), 400 (invalid model name or malformed audio payload), 413 (audio too large), 429 (rate limit), or 5xx (service outage).","commonSituations":"Expired or wrong API key; unsupported or mistyped model passed to transcription(model); audio format MiMo cannot decode; network proxy returning errors; MiMo capacity issues producing 5xx.","solutions":["Read the error message body — it contains MiMo's own error JSON explaining the cause.","Verify the API key and that it has access to the transcription/audio model.","Confirm the model id passed to transcription() is valid for MiMo.","Check the audio size/encoding; re-encode to a supported format (e.g. wav/mp3) and retry.","Retry with backoff on 429/5xx."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (!apiKey) throw new Error('MiMo API key required before transcription')","typeGuard":null,"tryCatchPattern":"try { await transcribe(model, audio) } catch (e) {\n  if (/MiMo transcription failed: (429|5\\d\\d)/.test(e.message)) await backoffRetry()\n  else if (/401|403/.test(e.message)) notifyInvalidApiKey()\n  else throw e\n}","preventionTips":["Validate API key before calls","Keep audio within size limits and supported formats","Retry 429/5xx with exponential backoff","Surface the embedded upstream error body to logs"],"tags":["network","http","upstream-api","transcription"],"backgroundTag":"upstream-api-error","analyzedSha":"f679616c34f1cf6d282c8d64264242af944b3fed","analyzedAt":"2026-09-08T13:18:15.005Z","contentChangedAt":"2026-09-08T13:18:15.005Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}