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
- Use an official video model (e.g. from @ai-sdk/* provider packages) that fully implements the video model spec.
- If writing a custom model, implement either doGenerate or both doStart and doStatus.
- Update the provider package to a version compatible with the current video model specification.
- 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
- Satisfy the VideoModel type with `satisfies` so missing methods fail at compile time.
- Keep provider packages updated to the spec version the SDK expects.
- Never pass untyped `as VideoModel` casts in production code.
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
- Invalid argument for parameter model: model ${model.provider
- Unsupported output: ${_exhaustiveCheck}
- Invalid argument for parameter output: Invalid output type.
- Model could not be resolved
- Model tried to call unavailable tool '${toolName}'. No tools
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/dbb12d14c82b2ff1.
Report an issue: GitHub.