Video models primer
Meridian routes video generation requests across Sora, Veo, Runway, and Pika behind a single API. This primer walks through model selection, prompt structure, and cost controls so your first generation lands in under five minutes.
1.Choose the right model
Sora is best for cinematic narrative shots up to 20 seconds. Veo excels at photoreal product spots and motion-stable hand-offs. Runway Gen-4 is the fastest pick for short loops under 4 seconds, and Pika handles stylized animation with the lowest per-second cost. The router will auto-select if you passmeridian/video-autoas the model id.
2.Structure the prompt
Lead with subject, then camera motion, then lighting, then style tags. Avoid mixing contradictory motion verbs in the same clause. Pass a seed when you need shot-to-shot continuity across a multi clip storyboard, and add a negative prompt to strip artifacts like text overlays or watermarks the upstream model sometimes invents.
3.Generate and stream the result
Calls return a signed CDN URL once render completes. Long jobs stream progress events over server-sent events so you can show a real percentage bar to the user instead of a static spinner.
// Meridian SDK: video generation
import { Meridian } from '@meridian/sdk';
const client = new Meridian({
apiKey: process.env.MERIDIAN_API_KEY,
});
const result = await client.video.generate({
model: 'azure/sora-1',
prompt: 'A violet nebula collapsing into a star',
duration: 8,
resolution: '1080p',
fps: 24,
});
console.log(result.url);
// => https://cdn.meridian.ai/v/abc123.mp4