{"record":{"id":"f02f12238c91fbd8","repo":"vercel/ai","slug":"black-forest-labs-video-generation-timeout","errorCode":"BLACK_FOREST_LABS_VIDEO_GENERATION_TIMEOUT","errorMessage":"Black Forest Labs video generation timed out after ${pollTimeoutMillis}ms. Request id: ${operation.requestId}","messagePattern":"Black Forest Labs video generation timed out after (.+?)ms\\. Request id: (.+?)","errorType":"exception","errorClass":"AISDKError","httpStatus":null,"severity":"error","filePath":"packages/black-forest-labs/src/black-forest-labs-video-model.ts","lineNumber":714,"sourceCode":"    return { status: 'pending', response };\n  }\n\n  async doGenerate(\n    options: BlackForestLabsVideoDoGenerateOptions,\n  ): Promise<VideoModelV4Result> {\n    const startResult = await this.doStart(options);\n    const operation = startResult.operation as BlackForestLabsVideoOperation;\n    const pollIntervalMillis =\n      this.config.pollIntervalMillis ?? DEFAULT_POLL_INTERVAL_MILLIS;\n    const pollTimeoutMillis =\n      this.config.pollTimeoutMillis ?? DEFAULT_POLL_TIMEOUT_MILLIS;\n    const startTime = Date.now();\n\n    while (true) {\n      await delay(pollIntervalMillis, { abortSignal: options.abortSignal });\n\n      if (Date.now() - startTime > pollTimeoutMillis) {\n        throw new AISDKError({\n          name: 'BLACK_FOREST_LABS_VIDEO_GENERATION_TIMEOUT',\n          message:\n            `Black Forest Labs video generation timed out after ${pollTimeoutMillis}ms. ` +\n            `Request id: ${operation.requestId}`,\n        });\n      }\n\n      const statusResult = await this.doStatus({\n        operation,\n        headers: options.headers,\n        abortSignal: options.abortSignal,\n      });\n\n      if (statusResult.status === 'pending') {\n        continue;\n      }\n\n      if (statusResult.status === 'error') {","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/black-forest-labs/src/black-forest-labs-video-model.ts#L696-L732","documentation":"Thrown in doGenerate when the polling loop has waited longer than pollTimeoutMillis (Date.now() - startTime > pollTimeoutMillis) without the BFL video operation reaching a terminal state. AISDKError named BLACK_FOREST_LABS_VIDEO_GENERATION_TIMEOUT includes the configured timeout and the provider request id. Video generation can take minutes, so the default timeout may simply be too short for high resolutions/long durations.","triggerScenarios":"Calling generateVideo on a BFL video model where the operation stays pending past pollTimeoutMillis of the polling loop (delay + status checks).","commonSituations":"Generating long (up to 20s) or high-resolution videos that exceed the default timeout; BFL API congestion or incidents leaving jobs queued; using doStart + doStatus yourself with a short custom timeout.","solutions":["Increase the poll timeout option (pollTimeoutMillis / provider timeout setting) for long or high-resolution generations.","Retry the request; if it persists, check BFL status/queue conditions and the request id.","Use the start-then-poll API (doStart + doStatus) so your own scheduler controls the wait instead of the SDK's fixed timeout.","Verify the abortSignal is not cutting the polling loop short in a way that leaves it pending."],"exampleFix":"// before\nawait generateVideo({ model: bfl.video('flux-3'), prompt });\n// after\nawait generateVideo({ model: bfl.video('flux-3'), prompt, pollTimeoutMillis: 600000 });","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const video = await generateVideo({ model, prompt, pollTimeoutMillis: 600000 });\n} catch (e) {\n  if (AISDKError.isInstance(e) && e.name === 'BLACK_FOREST_LABS_VIDEO_GENERATION_TIMEOUT') {\n    // retry with a longer timeout or fall back to doStart + manual doStatus polling\n  }\n  throw e;\n}","preventionTips":["Set pollTimeoutMillis generously (10+ minutes) for long/high-resolution videos.","Use doStart + doStatus for your own long-running job handling instead of a single blocking call.","Check BFL service status before large batch generations."],"tags":["video-generation","timeout","polling","network"],"backgroundTag":"provider-polling-timeout","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}