vercel/ai · error

Video model ${model.modelId} does not implement doGenerate o

Error message

Video model ${model.modelId} does not implement doGenerate or doStart/doStatus.

What it means

experimental_generateVideo requires the model to either implement doGenerate (one-shot generation) or the doStart/doStatus pair (async start-then-poll flow). If a VideoModelV* instance implements neither, the SDK throws a plain Error before calling the provider, because it has no protocol to execute the request with.

Source

Thrown at packages/ai/src/generate-video/generate-video.ts:314

    prompt,
    resolvedImage,
    normalizedFrameImages,
    effectiveInputReferences,
    warnings,
  } = normalizeVideoCallInputs({ promptArg, frameImages, inputReferences });

  const maxVideosPerCallWithDefault =
    maxVideosPerCall ?? (await invokeModelMaxVideosPerCall(model)) ?? 1;

  // Determine whether to use the start/status flow:
  const hasStartStatus = model.doStart != null && model.doStatus != null;
  const useStartStatus =
    hasStartStatus &&
    (poll != null || webhook != null || model.doGenerate == null);

  // Validate model capabilities
  if (model.doGenerate == null && !hasStartStatus) {
    throw new Error(
      `Video model ${model.modelId} does not implement doGenerate or doStart/doStatus.`,
    );
  }

  // Warn if poll/webhook provided but model doesn't support start/status
  if ((poll != null || webhook != null) && !hasStartStatus) {
    logWarnings({
      warnings: [
        {
          type: 'other',
          message:
            'poll/webhook options were provided but the model does not support doStart/doStatus. Falling back to doGenerate.',
        },
      ],
      provider: model.provider,
      model: model.modelId,
    });
  }

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Use an official video model (e.g. from @ai-sdk/* provider packages) that fully implements the video model spec.
  2. If writing a custom model, implement either doGenerate or both doStart and doStatus.
  3. Update the provider package to a version compatible with the current video model specification.
  4. Check that you are passing the right model object type to experimental_generateVideo.

Example fix

// before
const model = { provider: 'custom', modelId: 'vid-1' } as VideoModel; // no methods
await experimental_generateVideo({ model, prompt });

// after
const model = {
  provider: 'custom',
  modelId: 'vid-1',
  doGenerate: async (options) => { /* ... */ },
} satisfies VideoModel;
await experimental_generateVideo({ model, prompt });
Defensive patterns

Strategy: validation

Validate before calling

function isUsableVideoModel(model: VideoModel): boolean {
  return typeof model.doGenerate === 'function' ||
    (typeof (model as any).doStart === 'function' && typeof (model as any).doStatus === 'function');
}
if (!isUsableVideoModel(model)) throw new Error('video model missing doGenerate or doStart/doStatus');

Type guard

function hasVideoCapability(model: unknown): model is VideoModel {
  const m = model as VideoModel;
  return typeof model === 'object' && model !== null &&
    (typeof m.doGenerate === 'function' ||
     (typeof (m as any).doStart === 'function' && typeof (m as any).doStatus === 'function'));
}

Try / catch

try {
  await experimental_generateVideo({ model, prompt });
} catch (error) {
  if (error instanceof Error && /does not implement doGenerate or doStart\/doStatus/.test(error.message)) {
    // swap in a compliant model or report a setup error
  } else throw error;
}

Prevention

When it happens

Trigger: Calling experimental_generateVideo with a custom or mock video model object that only partially implements the model interface — e.g. implements doStart but neither doGenerate nor doStatus, or is an empty/wrongly typed object cast to a video model.

Common situations: Hand-rolled mock models in tests missing methods; a custom provider adapter written against an older spec version; passing an image or language model by mistake; dependency version mismatch where the installed provider package predates the doStart/doStatus API.

Related errors


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