MakeAIVideo SDK for TypeScript and JavaScript

The official SDK for the MakeAIVideo API (SDK guide). Generate finished, captioned AI videos from code: send a brief or your own script and get back an MP4 with script, AI voiceover, scenes, captions and music, sized for TikTok, Instagram Reels and YouTube Shorts.
- Typed client for every endpoint: videos, scripts, tools, characters, voices, music, ideas, templates, webhooks
waitForReady() polling helper that respects the API's poll_after_seconds
- Automatic retries on rate limits and server errors, typed errors, idempotent creates
- Webhook signature verification
- Zero runtime dependencies, ESM and CommonJS, Node 18+
Install
npm install @makeaivideo/sdk
Get an API key (it starts with mav_) in the developer settings. New to the API? Read the quickstart and authentication guide.
Quickstart: brief in, MP4 out
import { MakeAIVideo } from "@makeaivideo/sdk"
const mav = new MakeAIVideo({ apiKey: process.env.MAKEAIVIDEO_API_KEY! })
const tools = await mav.tools.list()
const quote = await mav.videos.estimate({ tool: "explainer", duration_seconds: 30 })
const { video_id } = await mav.videos.create({
tool: "explainer",
fields: { topic: "Why octopuses have three hearts" },
duration_seconds: 30,
aspect_ratio: "9:16",
})
const video = await mav.videos.waitForReady(video_id, {
onProgress: (v) => console.log(v.status),
})
console.log(video.download)
Bring your own script
const script = await mav.videos.script({ topic: "3 facts about the deep sea", target_duration: 30 })
await mav.videos.create({ script: script.script, mode: "stock-narrated" })
Webhooks instead of polling
import { verifyWebhookSignature } from "@makeaivideo/sdk"
const hook = await mav.webhooks.create({ url: "https://example.com/hooks/makeaivideo", events: ["video.ready", "video.failed"] })
if (!verifyWebhookSignature(rawBody, req.headers["x-makeaivideo-signature"], secret)) throw new Error("bad signature")
See the webhooks guide for events and retries.
Errors
Every failure is a MakeAIVideoError with status, code and requestId. Subclasses: AuthenticationError (401), PermissionError (403, missing key scope), ValidationError (400), InsufficientCreditsError (402), NotFoundError (404), RateLimitError (429), VideoFailedError (render failed while waiting).
API coverage
| Account | me(), credits(), workspace.get/update |
| Videos | videos.list/create/get/update/delete/generate/cancel/download/estimate/waitForReady, videos.renders.*, videos.regenerateScene, videos.voice.get/set, videos.captions, videos.shareLink |
| Scripts | videos.script, videos.scriptify, videos.fetchUrl, ai.enhancePrompt, ideas.generate |
| Assets | tools.list, templates.list, characters.*, voices.list/preview, music.list/generate, uploads.referenceFromUrl, brandKit.get/update |
| Webhooks | webhooks.list/create/get/update/delete/test/deliveries |
Full endpoint reference: makeaivideo.ai/docs/api.
FAQ
What is MakeAIVideo? An AI video generator that turns a brief or script into a finished short-form video with voiceover, scenes and captions. Learn more.
Can I use it from Claude, ChatGPT or Cursor instead of code? Yes: connect the MakeAIVideo MCP server at https://mcp.makeaivideo.ai, or install @makeaivideo/mcp.
How long does a video take? Minutes. Create returns at once with a video_id; poll with waitForReady() or subscribe to the video.ready webhook.
How is it priced? Videos use credits from your plan. videos.estimate() quotes the cost before you create. See pricing.
About MakeAIVideo
MakeAIVideo is an AI video generator that turns a brief, a prompt or your own script into a finished, captioned short-form video: script, AI voiceover, AI-generated or stock scenes, captions and music, exported as an MP4 ready for TikTok, Instagram Reels and YouTube Shorts.
- Make videos in the app: prompt to video, script to video, image to video, talking avatar, AI ad maker, blog to video
- By format: TikTok video generator, Instagram Reels generator, AI Shorts generator, faceless YouTube channel, AI UGC video, AI explainer video, AI spokesperson video
- For developers: developer hub, API reference, SDK guide, quickstart, authentication, webhooks, MCP server, AI agents, CLI
- Compare: MakeAIVideo vs HeyGen, MakeAIVideo vs Synthesia
- Pricing · Free creator tools · Blog · Help · Contact
Related packages
License
MIT © MakeAIVideo