{"record":{"id":"5c7a7e5fdfff28ae","repo":"vercel/ai","slug":"minimax-video-generation-error","errorCode":"MINIMAX_VIDEO_GENERATION_ERROR","errorMessage":"No task_id returned from the MiniMax API. Response: ${JSON.stringify(createResponse)}","messagePattern":"No task_id returned from the MiniMax API\\. Response: (.+?)","errorType":"exception","errorClass":"AISDKError","httpStatus":null,"severity":"error","filePath":"packages/minimax/src/minimax-video-model.ts","lineNumber":566,"sourceCode":"\n    const { value: createResponse } = await postJsonToApi({\n      url: `${baseURL}/v2/video_generation`,\n      headers: combineHeaders(\n        await resolve(this.config.headers),\n        options.headers,\n      ),\n      body,\n      failedResponseHandler: minimaxVideoFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        minimaxCreateVideoResponseSchema,\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch,\n    });\n\n    const taskId = createResponse.task_id;\n    if (!taskId) {\n      throw new AISDKError({\n        name: 'MINIMAX_VIDEO_GENERATION_ERROR',\n        message: `No task_id returned from the MiniMax API. Response: ${JSON.stringify(createResponse)}`,\n      });\n    }\n\n    const pollIntervalMs =\n      minimaxOptions?.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;\n    const pollTimeoutMs =\n      minimaxOptions?.pollTimeoutMs ?? DEFAULT_POLL_TIMEOUT_MS;\n    const startTime = Date.now();\n    let responseHeaders: Record<string, string> | undefined;\n\n    while (true) {\n      await delay(pollIntervalMs, { abortSignal: options.abortSignal });\n\n      if (Date.now() - startTime > pollTimeoutMs) {\n        throw new AISDKError({\n          name: 'MINIMAX_VIDEO_GENERATION_TIMEOUT',","sourceCodeStart":548,"sourceCodeEnd":584,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/minimax/src/minimax-video-model.ts#L548-L584","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\ncreateMiniMax({ apiKey: process.env.MINIMAX_API_KEY }) // video model id: 'abab-video'\n// after\ncreateMiniMax({ apiKey: process.env.MINIMAX_API_KEY })\n  .videoModel('MiniMax-Hailuo-02'), // valid video model id + correct regional baseURL","handlingStrategy":"try-catch","validationCode":"if (!process.env.MINIMAX_API_KEY) throw new Error('MINIMAX_API_KEY is not set');\nif (!validMiniMaxVideoModelIds.includes(modelId)) throw new Error(`Unknown MiniMax video model: ${modelId}`);","typeGuard":null,"tryCatchPattern":"try {\n  await minimax.videoModel(modelId).doGenerate({ prompt, ...options });\n} catch (e) {\n  if (AISDKError.isInstance(e) && e.name === 'MINIMAX_VIDEO_GENERATION_ERROR' && e.message.includes('No task_id')) {\n    // parse e.message JSON to surface the underlying API error (auth/model/params)\n  }\n  throw e;\n}","preventionTips":["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"],"tags":["minimax","video-generation","api-response","task-creation"],"backgroundTag":"video-generation-task-error","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}