{"record":{"id":"def2f6880189639f","repo":"vercel/ai","slug":"minimax-video-generation-failed","errorCode":"MINIMAX_VIDEO_GENERATION_FAILED","errorMessage":"MiniMax video generation failed${task.error?.message ? `: ${task.error.message}` : ''}${task.error?.code != null ? ` (${task.error.code})` : ''}. Task ID: ${taskId}","messagePattern":"MiniMax video generation failed(.+?)` : ''\\}(.+?)\\)` : ''\\}\\. Task ID: (.+?)","errorType":"exception","errorClass":"AISDKError","httpStatus":null,"severity":"error","filePath":"packages/minimax/src/minimax-video-model.ts","lineNumber":660,"sourceCode":"                ...(task.resolution != null\n                  ? { resolution: task.resolution }\n                  : {}),\n                ...(task.usage != null\n                  ? {\n                      usage: {\n                        totalSeconds: task.usage.total_seconds,\n                        inputSeconds: task.usage.input_seconds,\n                        outputSeconds: task.usage.output_seconds,\n                      },\n                    }\n                  : {}),\n              },\n            },\n          };\n        }\n\n        case 'failed': {\n          throw new AISDKError({\n            name: 'MINIMAX_VIDEO_GENERATION_FAILED',\n            message: `MiniMax video generation failed${\n              task.error?.message ? `: ${task.error.message}` : ''\n            }${task.error?.code != null ? ` (${task.error.code})` : ''}. Task ID: ${taskId}`,\n          });\n        }\n\n        case 'cancelled': {\n          throw new AISDKError({\n            name: 'MINIMAX_VIDEO_GENERATION_CANCELLED',\n            message: `MiniMax video generation was cancelled. Task ID: ${taskId}`,\n          });\n        }\n\n        case 'expired': {\n          throw new AISDKError({\n            name: 'MINIMAX_VIDEO_GENERATION_EXPIRED',\n            message: `MiniMax video generation request expired. Task ID: ${taskId}`,","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/minimax/src/minimax-video-model.ts#L642-L678","documentation":"The polled task reached status 'failed' on MiniMax's side; the model surfaces the provider-supplied task.error.message and task.error.code (when present) in an AISDKError named MINIMAX_VIDEO_GENERATION_FAILED, along with the task ID. This is a definitive server-side job failure, not a client timeout.","triggerScenarios":"doGenerate polls a task whose statusResponse.task.status === 'failed'. Causes originate at MiniMax: content-policy rejection of the prompt, invalid parameter combinations, internal rendering failure, or quota/entitlement problems on the account.","commonSituations":"Prompts violating MiniMax content policies; unsupported resolutions/durations for the chosen model; free-tier limits; transient MiniMax internal errors during peak load.","solutions":["Read the embedded task.error message/code in the thrown error — it states the provider-side cause (content policy, invalid params, internal error) and fix accordingly.","Rephrase the prompt if the failure is content-policy related, or adjust model parameters (resolution, duration) to supported combinations.","Retry the generation, ideally with backoff, if the error code indicates a transient internal failure.","Verify account quota/plan entitlements for the selected video model with MiniMax support using the task ID."],"exampleFix":"// before\nawait minimax.videoModel('MiniMax-Hailuo-02').doGenerate({ prompt: flaggedPrompt });\n// after\nawait minimax.videoModel('MiniMax-Hailuo-02').doGenerate({ prompt: revisedPrompt }); // e.g. remove policy-violating content","handlingStrategy":"try-catch","validationCode":"const disallowed = /policy-pattern/i; // screen prompts against known content-policy triggers before submission\nif (disallowed.test(prompt)) throw new Error('Prompt likely rejected by MiniMax content policy');","typeGuard":null,"tryCatchPattern":"try {\n  await minimax.videoModel(modelId).doGenerate({ prompt });\n} catch (e) {\n  if (AISDKError.isInstance(e) && e.name === 'MINIMAX_VIDEO_GENERATION_FAILED') {\n    // e.message contains task.error.code/message: branch on transient vs permanent causes\n    if (isTransient(e.message)) return retryWithBackoff();\n  }\n  throw e;\n}","preventionTips":["Screen prompts against content policies before submission","Validate model parameters (resolution, duration) against the model's supported values","Retry only error codes indicating transient internal failures","Monitor MiniMax quotas and entitlements for the selected video model"],"tags":["minimax","video-generation","provider-error","task-failed"],"backgroundTag":"video-generation-task-error","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}