Skip to main content
The complete client below uses only the built-in fetch — no extra packages, no build step. Save it as vidgen.js and run it with Node 18 or newer.
vidgen.js

Usage

Handling errors

The diagnostic fields (requiredCredits, maxConcurrent, dailyVideosUsed) are on err.body, not in the message. Do not parse the error string for logic.

Type Safety

A short set of response types that is enough for most integrations:
types.ts
The client above calls Vidgen from the server. From a browser the request is blocked by CORS — keep the key and these calls on your backend.