Generate AI video
from your own backend
One POST turns a prompt, or a still image, into a generated clip. Veo, Kling, Sora and Seedance behind a single endpoint, billed per generation and delivered by webhook.
POSThttps://autostud.ai/api/v1/actions/videos_ai.generateThree calls, start to finish
Pick the engine once, then generate as often as you like.
- 1
Choose a video agent
An agent is a saved model configuration - engine, resolution, aspect ratio, defaults. List the ones your workspace has and keep the id.
export AUTOSTUD_API_KEY="sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # A video agent is a saved model configuration, not a model name. curl "https://autostud.ai/api/v1/agents?agent_type=video&limit=10" \ -H "Authorization: Bearer $AUTOSTUD_API_KEY" - 2
Send the prompt
Text alone, or a still image to animate. The response comes back with a generation id and the credits it spent.
curl -X POST https://autostud.ai/api/v1/actions/videos_ai.generate \ -H "Authorization: Bearer $AUTOSTUD_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: lighthouse-shot-01" \ -d '{ "agent_id": "b21f7d90-3c44-4e1a-9f77-0c2ad5e6b118", "prompt": "A lighthouse at dusk, slow push-in, waves breaking under it", "duration": 8 }' - 3
Collect the clip
Take the generation.completed webhook, or read the generation back when you prefer polling. The hosted URL is on the record.
# Register once. Every generation reports itself from then on. curl -X POST https://autostud.ai/api/v1/webhooks \ -H "Authorization: Bearer $AUTOSTUD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.com/hooks/autostud", "events": ["generation.completed", "generation.failed"], "description": "AI video" }' # The signing secret comes back once, in this response. Store it.
What you can pass
Four fields. Everything else lives on the agent, so your calls stay short.
agent_idThe video agent to run. Its engine and defaults decide what the clip looks like.
promptWhat should happen in the shot. The engine reads it as a director would.
image_urlOptional. A still to animate instead of generating from text alone.
durationSeconds of footage to produce, within the range the engine supports.
Engines behind the endpoint
Each engine is exposed as an agent, so switching model is a different id, not a different integration. New engines appear as new agents.
Stop polling
Register one webhook and every generation reports itself. Payloads are signed, retried, and carry the credits spent even when the generation failed.
generation.completedgeneration.failedQuestions developers ask first
How long does a generation take?
It depends on the engine and the length: seconds of footage take minutes of compute. The call returns immediately with a generation id, so nothing in your app has to wait on it.
What does it cost?
Generations are billed in credits, priced per engine. Every response reports the credits it spent, and the full history is readable at /api/v1/generations.
Can I animate an image I already have?
Yes. Pass image_url with any publicly reachable still and the engine animates it instead of generating from the prompt alone.
Can I make the clip longer afterwards?
Call videos_ai.extend with the generation id and a prompt for the next segment. The extension is a generation of its own, billed the same way.
Ready to create?
Start generating viral videos in minutes. No credit card required for the free trial.