Video Generation API
Add AI video generation to your app with Puter.js.
Access Sora, Veo, and more with a single API.
No API keys, no backend, no signup required.
Multiple AI Providers
Access OpenAI Sora, Google Veo, and more through a single API.
- Switch providers by changing one parameter
- Always access the latest video models
- No vendor lock-in
No API Keys Required
Skip the sign-ups, key management, and credential juggling. Just add Puter.js and start generating videos immediately.
User-Pays Model
Your users cover their own AI costs—so you can ship video generation features without worrying about billing or runaway API expenses.
No Backend Required
Generate videos directly from the browser with client-side JavaScript. No server code needed.
Works Everywhere
Use from any frontend with a simple script tag, or install via NPM for Node.js projects.
How It Works
1 Include Puter.js
Add Puter.js to your app:
<script src="https://js.puter.com/v2/"></script>
or with NPM:
npm install @heyputer/puter.js
2 Generate Videos
Use the simple JavaScript API to generate videos from text:
puter.ai.txt2vid("A sunset over mountains")
View the text-to-video documentation for a full list of available features.
✓That's it!
No need to set up servers or infrastructure. No API keys, configuration, or rate-limiting. Everything is handled by Puter.js!
Unified Video Generation API
Generate videos using different models from various providers.
The API handles all the complexity so you can focus on building your app.
// Generate a video with test mode (no credits used)
const video = await puter.ai.txt2vid(
"A sunrise drone shot flying over a calm ocean",
true // test mode
);
document.body.appendChild(video);
// Generate a clip with Sora
const sora = await puter.ai.txt2vid(
"A fox sprinting through a snow-covered forest at dusk", {
model: "sora-2",
}
);
// Use Google Veo
const veo = await puter.ai.txt2vid("A peaceful garden", {
model: "veo-3.0-fast"
});
Frequently Asked Questions
Use Puter.js Video Generation API to create AI-generated video clips directly from text prompts. Access models like OpenAI Sora and Google Veo through a simple JavaScript API without managing API keys or backend infrastructure.
Puter.js is a JavaScript library that provides access to AI, storage, and other cloud services directly from your frontend code. It handles authentication, infrastructure, and scaling so you can focus on building your app.
You can use the API for apps that need AI-generated videos: content creation platforms, social media tools, marketing automation, educational content, game trailers, and any application where users want to create short-form videos from text descriptions.
With the User-Pays model, users cover their own video generation costs through their Puter account. Each successful generation consumes the user's AI credits in accordance with the model, duration, and resolution requested.
Real renders can take a couple of minutes to complete. The returned promise resolves only when the video is ready, so keep your UI responsive (for example, by showing a spinner) while you wait. Use test mode during development to get instant sample videos.
Add AI Video Generation to Your App
Get started with Puter.js — add video generation with a few lines of code.
Get Started Now