Skip to content
Documentation

Quickstart

Go from install to your first hosted video in four lines of code. One key works across the Vidom model and Kling, Sora, Veo and Grok.

The fastest path: install the SDK, set VIDOM_KEY, and call generate. The response hands you a CDN URL you can play or share immediately — no storage to wire up.

quickstart
1import Vidom from "vidom";2 3const vidom = new Vidom({ apiKey: process.env.VIDOM_KEY });4 5const video = await vidom.generate({6 model: "kling-2.1",7 prompt: "A neon koi gliding through liquid glass, slow motion",8});9 10console.log(video.url); // hosted URL, live for 60 days

Step 1

Install

The SDK ships for JavaScript/TypeScript and Python.

install
1npm install vidom

Step 2

Authenticate

Create a key in the dashboard and expose it as an environment variable. A single key authenticates every provider.

.env
1VIDOM_KEY=vk_live_•••••••••••••••••••

Step 3

Generate a video

Pass a prompt and, optionally, a model. The call resolves once the video is ready.

generate
1import Vidom from "vidom";2 3const vidom = new Vidom({ apiKey: process.env.VIDOM_KEY });4 5const video = await vidom.generate({6 model: "kling-2.1",7 prompt: "A neon koi gliding through liquid glass, slow motion",8});9 10console.log(video.url); // hosted URL, live for 60 days

Step 4

Read the hosted URL

Every successful response contains a url and an expires_at. The link is live for 60 days — storage is on us.

200 OK
1{2 "id": "gen_8fae21c0",3 "model": "kling-2.1",4 "status": "succeeded",5 "url": "https://cdn.vidom.ai/v/8fae21c0.mp4",6 "expires_at": "2026-08-03T12:00:00Z",7 "duration": 5,8 "resolution": "1080p",9 "cost": 0.4210}

Choosing a model

Set the model field to any of vidom-1, kling-2.1, sora-2, veo-3 or grok-video-1. Switching providers is a one-string change — nothing else in your code moves.

Auto-routing

Omit model and pass a route budget instead. Vidom selects the cheapest model that satisfies your constraints and retries across providers on failure.

auto-route.ts
1// No model? Vidom routes to the cheapest one that fits.2const video = await vidom.generate({3 prompt: "Aerial shot over a misty pine forest at dawn",4 route: { maxCost: 0.4, minResolution: "1080p", maxDuration: 8 },5});6 7console.log(video.model); // e.g. "vidom-1"picked for you8console.log(video.cost); // 0.31

Storage & links

Outputs are stored and served from our CDN automatically. The returned url stays live for 60 days; pin or download anything you need to keep longer. No buckets, no signing, no egress surprises.