MakeAIVideo

TypeScript SDK

@makeaivideo/sdk is a typed client for all 56 API operations. It handles polling, webhook signature verification and error classes, so the common path is three calls rather than a fetch loop.

shell
npm install @makeaivideo/sdk

Published on npm as @makeaivideo/sdk, source on GitHub. MIT licensed. Create a key under Developers first.

Brief in, MP4 out

The shortest useful path: list the tools, quote the cost, create, wait. Note the estimate step. It is free, and it turns an irreversible spend into one you can confirm.

typescript
import { MakeAIVideo } from "@makeaivideo/sdk"

const mav = new MakeAIVideo({ apiKey: process.env.MAKEAIVIDEO_API_KEY! })

// 1. See the video tools and the fields each one asks for
const tools = await mav.tools.list()

// 2. Quote the cost, then create
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",
})

// 3. Wait for the render and download it
const video = await mav.videos.waitForReady(video_id, {
  onProgress: (v) => console.log(v.status),
})
console.log(video.download) // MP4 URL

waitForReady polls for you and respects the poll_after_seconds hint the API returns, so it will not hammer the endpoint. If you would rather not hold a connection open, use webhooks instead.

Webhooks instead of polling

typescript
import { verifyWebhookSignature } from "@makeaivideo/sdk"

const hook = await mav.webhooks.create({
  url: "https://example.com/hooks/makeaivideo",
  events: ["video.ready", "video.failed"],
})

// store hook.secret, then in your handler (raw body!):
if (!verifyWebhookSignature(rawBody, req.headers["x-makeaivideo-signature"], secret)) {
  throw new Error("bad signature")
}

Verify against the raw body, before any JSON parsing, or the signature will not match. The webhooks guide covers the event list and the retry schedule.

What the client exposes

Every resource hangs off the client, plus mav.me() and mav.credits() for the account itself. Both are free to call.

ResourceCovers
mav.videosCreate, estimate, poll, export, download
mav.toolsThe brief-driven video tools and their fields
mav.templatesSaved render configurations
mav.charactersRecurring on-screen people
mav.voicesThe voice catalogue and previews
mav.musicBackground track generation
mav.ideasTopic and hook suggestions
mav.aiScript writing, prompt enhancement, article fetch
mav.uploadsYour own images and audio
mav.brandKitColours, logo and type
mav.webhooksDelivery endpoints and their health
mav.workspaceMembers and settings

Errors

Every failure is a MakeAIVideoError carrying status, code and requestId. Quote the request id in any support mail and we can find the exact call. The subclasses let you branch without string matching:

ClassStatusMeaning
AuthenticationError401Key missing, malformed or revoked
PermissionError403The key lacks the required scope
ValidationError400The request body did not validate
InsufficientCreditsError402Not enough credits for the job
NotFoundError404No such video, voice or character
RateLimitError429A rate-limit tier was exceeded
VideoFailedError-The render failed while waiting on it

The other packages

@makeaivideo/mcp runs the MCP server locally over stdio, for assistants that cannot reach the hosted endpoint. @makeaivideo/cli is the command-line client. All three are MIT licensed and open source under github.com/makeaivideo-ai, and all three are included on every plan with no separate rate card.

For the endpoints underneath, see the API reference, or start with the quickstart if you would rather use plain HTTP.

Get an API key

Every plan includes API and MCP access on the same credits as the app. Create a key under Settings, Advanced, API keys.

Plans from $9 a month, with the allowance topped back up each billing month.