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.
npm install @makeaivideo/sdkPublished 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.
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 URLwaitForReady 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
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.
| Resource | Covers |
|---|---|
| mav.videos | Create, estimate, poll, export, download |
| mav.tools | The brief-driven video tools and their fields |
| mav.templates | Saved render configurations |
| mav.characters | Recurring on-screen people |
| mav.voices | The voice catalogue and previews |
| mav.music | Background track generation |
| mav.ideas | Topic and hook suggestions |
| mav.ai | Script writing, prompt enhancement, article fetch |
| mav.uploads | Your own images and audio |
| mav.brandKit | Colours, logo and type |
| mav.webhooks | Delivery endpoints and their health |
| mav.workspace | Members 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:
| Class | Status | Meaning |
|---|---|---|
| AuthenticationError | 401 | Key missing, malformed or revoked |
| PermissionError | 403 | The key lacks the required scope |
| ValidationError | 400 | The request body did not validate |
| InsufficientCreditsError | 402 | Not enough credits for the job |
| NotFoundError | 404 | No such video, voice or character |
| RateLimitError | 429 | A 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.