vercel/ai · error · AISDKError

BLACK_FOREST_LABS_VIDEO_GENERATION_FAILED

BLACK_FOREST_LABS_VIDEO_GENERATION_FAILED

Error message

${statusResult.error}

What it means

Thrown in doGenerate when the polled BFL status result reports status 'error'; the SDK surfaces the provider's own error text (statusResult.error) as the message of an AISDKError named BLACK_FOREST_LABS_VIDEO_GENERATION_FAILED. This is the BFL API explicitly failing the job (e.g. content policy rejection or invalid input), not an SDK-side bug.

Source

Thrown at packages/black-forest-labs/src/black-forest-labs-video-model.ts:733

          name: 'BLACK_FOREST_LABS_VIDEO_GENERATION_TIMEOUT',
          message:
            `Black Forest Labs video generation timed out after ${pollTimeoutMillis}ms. ` +
            `Request id: ${operation.requestId}`,
        });
      }

      const statusResult = await this.doStatus({
        operation,
        headers: options.headers,
        abortSignal: options.abortSignal,
      });

      if (statusResult.status === 'pending') {
        continue;
      }

      if (statusResult.status === 'error') {
        throw new AISDKError({
          name: 'BLACK_FOREST_LABS_VIDEO_GENERATION_FAILED',
          message: statusResult.error,
        });
      }

      return {
        videos: statusResult.videos,
        warnings: [...startResult.warnings, ...statusResult.warnings],
        providerMetadata: statusResult.providerMetadata,
        response: statusResult.response,
      };
    }
  }
}

const bflVideoSubmitSchema = z.object({
  id: z.string(),
  polling_url: z.url(),

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Read the message (the provider's error text) and fix the underlying request issue it describes.
  2. If it is a safety/policy rejection, adjust the prompt or keyframe images, or lower safetyTolerance within allowed limits.
  3. Retry with a new generation request; if the same input always fails, contact BFL support with the request id.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const video = await generateVideo({ model, prompt });
} catch (e) {
  if (AISDKError.isInstance(e) && e.name === 'BLACK_FOREST_LABS_VIDEO_GENERATION_FAILED') {
    console.error('BFL rejected the job:', e.message); // provider error text
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Polling a BFL video operation whose status comes back 'error' during doGenerate's loop; the provider-supplied error string becomes the exception message.

Common situations: Prompt or keyframe images rejected by BFL safety filters; unsupported aspect ratio/duration/resolution combination reaching the API; expired or invalid operation id polled after a previous failure; BFL service-side processing failure.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/59777f0244da527d. Report an issue: GitHub.