Node.js / TypeScript SDK

Generate videos from text, images, and URLs using the VCursor SDK for JavaScript and TypeScript.

Installation

bash
npm install vcursor-sdk

Quick Start

Initialize the client and submit your first video generation task.

index.ts
import { VCursor } from "vcursor-sdk";
const client = new VCursor({ apiKey: "your_api_key" });
// Submit a video generation task
const resp = await client.submit("a cat playing piano in a jazz club");
// Wait for completion with progress callback
const result = await client.waitForCompletion(resp.task_id!, {
onProgress: (p) => console.log(`${p.data.progress}%`),
});
console.log(result.data.products.url);

Agent Mode

For more complex requirements, use Agent Mode to let VCursor plan and execute multi-step video creation.

agent.ts
const agent = await client.submitAgent(
"create a 30s commercial for a coffee brand",
{ duration: "30s", aspect_ratio: "16:9" },
);
const result = await client.waitForAgentCompletion(agent.task_id, {
onProgress: (p) => console.log(`${p.progress}% - ${p.current_stage}`),
});
console.log(result.video_url);

Concurrency Limiting

Manage efficient usage of your API quota.

typescript
// Check current rate limit status
const status = await client.checkConcurrency("standard");
console.log(`Used: ${status.used}/${status.limit}`);
// Client-side limit (capped at server limit)
const limited = new VCursor({ apiKey: "...", maxConcurrency: 10 });