vercel/ai · error · AISDKError
MINIMAX_VIDEO_GENERATION_ERROR
MINIMAX_VIDEO_GENERATION_ERROR
Error message
No task_id returned from the MiniMax API. Response: ${JSON.stringify(createResponse)} What it means
After submitting a video generation job, MiniMaxVideoModel.doGenerate expects the create response to contain a task_id used for polling. If the API response has no task_id, the model cannot track the job and throws AISDKError named MINIMAX_VIDEO_GENERATION_ERROR, embedding the raw response for debugging.
Source
Thrown at packages/minimax/src/minimax-video-model.ts:566
const { value: createResponse } = await postJsonToApi({
url: `${baseURL}/v2/video_generation`,
headers: combineHeaders(
await resolve(this.config.headers),
options.headers,
),
body,
failedResponseHandler: minimaxVideoFailedResponseHandler,
successfulResponseHandler: createJsonResponseHandler(
minimaxCreateVideoResponseSchema,
),
abortSignal: options.abortSignal,
fetch: this.config.fetch,
});
const taskId = createResponse.task_id;
if (!taskId) {
throw new AISDKError({
name: 'MINIMAX_VIDEO_GENERATION_ERROR',
message: `No task_id returned from the MiniMax API. Response: ${JSON.stringify(createResponse)}`,
});
}
const pollIntervalMs =
minimaxOptions?.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
const pollTimeoutMs =
minimaxOptions?.pollTimeoutMs ?? DEFAULT_POLL_TIMEOUT_MS;
const startTime = Date.now();
let responseHeaders: Record<string, string> | undefined;
while (true) {
await delay(pollIntervalMs, { abortSignal: options.abortSignal });
if (Date.now() - startTime > pollTimeoutMs) {
throw new AISDKError({
name: 'MINIMAX_VIDEO_GENERATION_TIMEOUT',View on GitHub (pinned to 69428b1f8b)
Solutions
- Inspect the JSON response in the error message — it usually contains the real error (auth failure, invalid model, bad parameters) — and fix that cause.
- Verify MINIMAX_API_KEY is valid, has video-generation access, and matches the baseURL region (MiniMax API host differs per region).
- Confirm you are using a valid MiniMaxVideoModelId (e.g. a video model from the provider's model list) and that the videoBaseURL points at the video API endpoint.
- Upgrade @ai-sdk/minimax in case of a response-schema change handled in a newer version.
Example fix
// before
createMiniMax({ apiKey: process.env.MINIMAX_API_KEY }) // video model id: 'abab-video'
// after
createMiniMax({ apiKey: process.env.MINIMAX_API_KEY })
.videoModel('MiniMax-Hailuo-02'), // valid video model id + correct regional baseURL Defensive patterns
Strategy: try-catch
Validate before calling
if (!process.env.MINIMAX_API_KEY) throw new Error('MINIMAX_API_KEY is not set');
if (!validMiniMaxVideoModelIds.includes(modelId)) throw new Error(`Unknown MiniMax video model: ${modelId}`); Try / catch
try {
await minimax.videoModel(modelId).doGenerate({ prompt, ...options });
} catch (e) {
if (AISDKError.isInstance(e) && e.name === 'MINIMAX_VIDEO_GENERATION_ERROR' && e.message.includes('No task_id')) {
// parse e.message JSON to surface the underlying API error (auth/model/params)
}
throw e;
} Prevention
- Validate MINIMAX_API_KEY and regional baseURL before generating
- Only pass model IDs from the MiniMax video model list
- Log the embedded response JSON in the error to diagnose provider-side rejections
- Keep @ai-sdk/minimax up to date for response-schema changes
When it happens
Trigger: The POST to the MiniMax video creation endpoint returns 2xx without a task_id — typically an API error payload shaped differently than expected, invalid/unsupported model ID or parameters accepted-but-rejected, wrong baseURL region (e.g. hitting the wrong MiniMax endpoint), or auth quirks returning an error body with a 200 status.
Common situations: Expired or wrong-scoped MINIMAX_API_KEY, using a chat-model id with the video model, MiniMax changing/region-specific response schema, proxy returning an HTML/JSON error page with 200.
Related errors
- ALIBABA_VIDEO_GENERATION_ERROR
- BYTEDANCE_VIDEO_GENERATION_ERROR
- FAL_VIDEO_GENERATION_ERROR
- GOOGLE_VIDEO_GENERATION_ERROR
- MINIMAX_VIDEO_GENERATION_TIMEOUT
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/5c7a7e5fdfff28ae.
Report an issue: GitHub.