MakeAIVideo

MakeAIVideo CLI and device login

Getting a key onto a machine that has no browser, without copying and pasting a secret around.

Install

npm install -g @makeaivideo/cli

Published on npm as @makeaivideo/cli with source on GitHub. Everything on this page also works with plain curl if you would rather not install anything, and the device-code endpoints below are the same ones the CLI calls.

Device-code flow

Standard RFC 8628. The machine asks for a code, a human approves it in a browser somewhere else, and the machine collects the key. These two endpoints are the only unauthenticated ones in the API.

1. Start a login

curl
curl -X POST https://app.makeaivideo.ai/api/v1/auth/device \
  -H "Content-Type: application/json" \
  -d '{ "client_name": "my-laptop" }'
200 — field shape
{
  "data": {
    "device_code": "...",
    "user_code": "....-....",
    "verification_uri": "https://app.makeaivideo.ai/device",
    "verification_uri_complete": "https://app.makeaivideo.ai/device?code=...",
    "expires_in": <seconds>,
    "interval": <seconds between polls>
  },
  "error": null,
  "meta": { ... }
}

Show the user user_code and send them to verification_uri. If they are on the same machine, verification_uri_complete skips the typing.

2. Poll for approval

Poll every interval seconds until the code expires.

curl
curl -X POST https://app.makeaivideo.ai/api/v1/auth/device/token \
  -H "Content-Type: application/json" \
  -d '{ "device_code": "..." }'
statusWhat to do
pendingNobody has approved it yet. Keep polling at the given interval.
slow_downYou are polling too fast. Back off, then continue.
authorizedApproved. api_key is present, once. Store it now.
deniedThe user rejected the request. Stop.
expiredThe code timed out. Start a new device login.

3. Store the key

authorized — field shape
{
  "data": {
    "status": "authorized",
    "api_key": "mav_...",
    "api_key_id": <integer>
  },
  "error": null,
  "meta": { ... }
}

api_key is returned once and never again. Write it to your config or keychain on receipt. From there it is an ordinary bearer key, as described in Authentication.

CLI questions

Is there a MakeAIVideo CLI?
Yes. Install it with npm install -g @makeaivideo/cli. It signs in with the device-code flow, so no secret is ever pasted into a terminal, and everything it does is also possible with plain curl.
How do I log in from a server or a terminal?
Use the device-code flow. Request a code, approve it in a browser on any device, and your client polls until it receives the API key. Nobody has to paste a secret into the terminal.
Can I get the API key back if I lose it?
No. It is returned once on the authorized response and never again, so write it to your config or keychain immediately and issue a new key if it is lost.

Get an API key

The API and MCP server use the same credits and the same balance as the app, with no separate API plan. Create a key under Settings, Advanced, API keys.

7-day free trial with 350 credits, then plans from $9/mo. Cancel anytime before the trial ends.