1,000menu
closeLoginsearchSearchSignup1,000

AI Video-Agent API

The Scrptly AI Video-Agent API allows you to create entire videos using natural language prompts. By leveraging advanced AI models, the Video-Agent can interpret your instructions and generate videos that match your vision without requiring manual editing.

Creating a Video with the AI Video-Agent

To create a video using the AI Video-Agent, use the Scrptly.generateAiVideo() method. Here's a basic example:

import Scrptly from 'scrptly';
Scrptly.setApiSettings({
  apiKey: 'YOUR_API_KEY_HERE', // ← Replace with your real key See: https://scrptly.com/accoutn
});

console.log(await Scrptly.generateAiVideo({
	// Natural language description of the desired video. Describe everything from the content, duration, visual style...
	prompt: 'Create a 20-second promotional video for a new eco-friendly water bottle.',

	// Array of up to 5 context images to guide the ai agent
	context: [
		{
			url: 'https://example.com/images/water-bottle.jpg',
			description: 'Image of the eco-friendly water bottle'
		}
	],

	// Optional but highly recommended: Maximum budget in tokens you are willing to approve for this video. Make sure to provision your account accordingly. default: 10,000 tokens
	approveUpTo: 5000,
});

Parameters