vercel/ai · error · AISDKError

FAL_VIDEO_GENERATION_ERROR

FAL_VIDEO_GENERATION_ERROR

Error message

No response URL returned from queue endpoint

What it means

After submitting a video generation job to fal.ai's queue, the API response is expected to contain a `response_url` used to poll job status. When that field is missing or empty, the model throws an AISDKError named 'FAL_VIDEO_GENERATION_ERROR' because it cannot continue polling. This indicates an unexpected or malformed fal queue API response.

Source

Thrown at packages/fal/src/fal-video-model.ts:244

    const submitUrl = this.config.url({
      path: queuePath,
      modelId: this.modelId,
    });
    const { value: queueResponse } = await postJsonToApi({
      url: submitUrl,
      headers: combineHeaders(this.config.headers?.(), options.headers),
      body,
      failedResponseHandler: falFailedResponseHandler,
      successfulResponseHandler:
        createJsonResponseHandler(falJobResponseSchema),
      abortSignal: options.abortSignal,
      fetch: this.config.fetch,
    });

    const responseUrl = queueResponse.response_url;
    if (!responseUrl) {
      throw new AISDKError({
        name: 'FAL_VIDEO_GENERATION_ERROR',
        message: 'No response URL returned from queue endpoint',
      });
    }

    return { responseUrl, submitUrl };
  }

  private async fetchStatus({
    responseUrl,
    submitUrl,
    headers,
    abortSignal,
  }: {
    responseUrl: string;
    submitUrl: string;
    headers?: Record<string, string | undefined>;
    abortSignal?: AbortSignal;

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Upgrade @ai-sdk/fal to the latest version so the request/response handling matches the current fal API
  2. Log/inspect the raw queue endpoint response body to see what fal actually returned
  3. Retry the video generation request; if reproducible, report it to fal.ai support
  4. Bypass any proxy/mock that might be rewriting or truncating the response body

Example fix

// before
pnpm add @ai-sdk/fal@4.0.0
// after
pnpm add @ai-sdk/fal@latest
Defensive patterns

Strategy: retry

Validate before calling

// No client-side validation can predict a missing response_url; validate the response shape after submit
function hasResponseUrl(r: unknown): r is { response_url: string } {
  return typeof r === 'object' && r !== null && 'response_url' in r && typeof (r as any).response_url === 'string';
}

Type guard

function isFalVideoGenerationError(e: unknown): boolean {
  return AISDKError.isInstance(e) && e.name === 'FAL_VIDEO_GENERATION_ERROR';
}

Try / catch

try {
  return await generateVideo({ model: fal.video(modelId), prompt });
} catch (e) {
  if (AISDKError.isInstance(e) && e.name === 'FAL_VIDEO_GENERATION_ERROR') {
    return retry(() => generateVideo({ model: fal.video(modelId), prompt }));
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling `fal.video(...).doGenerate` (via generateVideo) where the POST to fal's queue endpoint returns 2xx but with no `response_url` field — e.g. fal API contract change, proxy stripping the body, or account/endpoint issues.

Common situations: Running behind a corporate proxy or mock server that alters the response; using an outdated provider version against a changed fal API; intermittent fal API misbehavior.

Related errors


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