vercel/ai · error · AISDKError
MINIMAX_VIDEO_GENERATION_EXPIRED
MINIMAX_VIDEO_GENERATION_EXPIRED
Error message
MiniMax video generation request expired. Task ID: ${taskId} What it means
While polling, MiniMax reported the video generation task status as 'expired': the task lived past its TTL without completing. The SDK throws MINIMAX_VIDEO_GENERATION_EXPIRED because the task ID is now dead and polling further is pointless.
Source
Thrown at packages/minimax/src/minimax-video-model.ts:676
case 'failed': {
throw new AISDKError({
name: 'MINIMAX_VIDEO_GENERATION_FAILED',
message: `MiniMax video generation failed${
task.error?.message ? `: ${task.error.message}` : ''
}${task.error?.code != null ? ` (${task.error.code})` : ''}. Task ID: ${taskId}`,
});
}
case 'cancelled': {
throw new AISDKError({
name: 'MINIMAX_VIDEO_GENERATION_CANCELLED',
message: `MiniMax video generation was cancelled. Task ID: ${taskId}`,
});
}
case 'expired': {
throw new AISDKError({
name: 'MINIMAX_VIDEO_GENERATION_EXPIRED',
message: `MiniMax video generation request expired. Task ID: ${taskId}`,
});
}
// 'queued' | 'running' | unknown → keep polling.
default:
break;
}
}
}
}
const minimaxCreateVideoResponseSchema = z.object({
task_id: z.string().nullish(),
});
const minimaxVideoStatusResponseSchema = z.object({View on GitHub (pinned to 69428b1f8b)
Solutions
- Retry with a fresh generateVideo call — the expired task cannot be resumed.
- Add retry/backoff around generation so expired tasks are automatically resubmitted.
- Avoid storing task IDs for later polling long after submission; poll promptly.
- If frequent, consider shorter/simpler prompts or off-peak submission to reduce queue time.
Example fix
// before: assuming an old taskId is still valid
const result = await generateVideo({ model, prompt, taskId: oldTaskId });
// after: on expiry, resubmit
try {
await generateVideo({ model, prompt });
} catch (e) {
if (e.name === 'MINIMAX_VIDEO_GENERATION_EXPIRED') {
await generateVideo({ model, prompt });
}
} Defensive patterns
Strategy: retry
Try / catch
try {
return await generateVideo({ model, prompt });
} catch (error) {
if (
typeof error === 'object' && error !== null &&
(error as { name?: string }).name === 'MINIMAX_VIDEO_GENERATION_EXPIRED'
) {
return generateVideo({ model, prompt }); // resubmit with backoff
}
throw error;
} Prevention
- Poll submitted tasks promptly instead of storing IDs for later.
- Add automatic resubmission with exponential backoff for terminal statuses.
- Monitor MiniMax queue load; submit during off-peak when queues are long.
When it happens
Trigger: doGenerate polls a MiniMax video task whose status returns 'expired' — the task was queued too long (very long queue) or MiniMax purged it before it started running.
Common situations: Heavy MiniMax load causing long queues; a task left unpolled for a long time and re-polled later; jobs submitted with a prompt/config that MiniMax deferred until they aged out.
Related errors
- MINIMAX_VIDEO_GENERATION_CANCELLED
- MINIMAX_VIDEO_GENERATION_ERROR
- MINIMAX_VIDEO_GENERATION_TIMEOUT
- MINIMAX_VIDEO_GENERATION_FAILED
- ALIBABA_VIDEO_GENERATION_ERROR
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/fe1aee24f8970870.
Report an issue: GitHub.