Generate Video

Overview

You can generate a video using the AI/ML API. In the basic setup, you need a prompt and an image URL.

Example: Create video based on first frame and prompt

Ensure you replace "my_key" with your actual API key before running the code.

const main = async () => {
  const response = await fetch('https://api.aimlapi.com/v2/generate/video/minimax/generation', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer <YOUR_API_KEY>',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      model: 'video-01',
      prompt: 'Mona Lisa puts on glasses with her hands.',
      first_frame_image: 'https://s2-111386.kwimgs.com/bs2/mmu-aiplatform-temp/kling/20240620/1.jpeg',
    }),
  }).then((res) => res.json());

  console.log('Generation:', response);
};

main()

Last updated