The HeyGen provider for the AI SDK supports text-to-video, image-to-video, and reference-to-video generation with heygen-video-1.
Setup
npm i ai @ai-sdk/heygen
Usage
import { heygen } from '@ai-sdk/heygen';
import { experimental_generateVideo as generateVideo } from 'ai';
const { videos } = await generateVideo({
model: heygen.video('heygen-video-1'),
prompt:
'A paper boat floats down a quiet stream, with the sound of flowing water.',
duration: 5,
aspectRatio: '16:9',
});