avideoai API

Turn a product photo into a short video ad from your own code or an AI agent. Videos are paid from the same prepaid credits as the dashboard. There is no subscription and no free API tier. Credits are refunded automatically when a video fails.

Machine-readable spec: /v1/openapi.json

Quick start

  1. Buy credits.
  2. Create a key on your account page. It is shown once — store it as a secret.
  3. POST a photo URL and a prompt, then poll until the video is ready.
export AVIDEOAI_API_KEY=avk_live_...

curl -X POST https://www.avideoai.com/v1/videos \
  -H "Authorization: Bearer $AVIDEOAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "image_url": "https://cdn.example.com/products/bottle.jpg",
    "prompt": "Slow orbit around the bottle on a marble counter, soft morning light",
    "model": "hailuo"
  }'

Pricing

Each video costs a fixed number of credits, charged when it is queued and refunded if it fails. Credits cost $2.08–$3.17 each depending on pack size.

modelEngineCreditsClipApprox. price
hailuoHailuo 2.326s$4.15–$6.33
veoVeo 3.148s$8.30–$12.67

Typical render time is 1–3 minutes.

Authentication

Send your key as a Bearer token on every request. Keys look like avk_live_ followed by 32 characters. Revoke a leaked key on the account page — it stops working immediately. Never put a key in browser code: anyone who can read it can spend your credits.

Authorization: Bearer avk_live_...

POST /v1/videos

Downloads image_url, charges credits, and queues the render. Returns immediately with status: "queued".

FieldType
image_urlstring, requiredPublic https URL of a JPEG or PNG, max 10MB.
promptstring, requiredThe motion and scene you want. Max 1000 characters.
modelstring"hailuo" or "veo". Default "hailuo".
durationintegerOptional. Each model renders one fixed length (hailuo: 6, veo: 8); any other value is a 400.

Idempotency. Send an Idempotency-Key header (any unique string) and retry freely: a repeat returns the original video with 200 and Idempotent-Replayed: true instead of charging again.

HTTP/1.1 201 Created
{ "id": "6f1c0b8e-2a4d-4c55-9a51-0f3b2d7e9c11", "status": "queued", "credits_charged": 2 }

GET /v1/videos/:id

Poll every 5–10 seconds. Status moves queued → processing → completed or failed. video_url is a signed MP4 link valid for one hour; fetch the video again for a fresh link. Finished videos are kept for 90 days, after which status becomes expired.

curl https://www.avideoai.com/v1/videos/6f1c0b8e-2a4d-4c55-9a51-0f3b2d7e9c11 \
  -H "Authorization: Bearer $AVIDEOAI_API_KEY"

{
  "id": "6f1c0b8e-2a4d-4c55-9a51-0f3b2d7e9c11",
  "status": "completed",
  "model": "hailuo",
  "credits_charged": 2,
  "created_at": "2026-10-31T17:02:11.000Z",
  "video_url": "https://…/videos/…mp4?token=…",
  "video_url_expires_at": "2026-10-31T18:04:40.000Z"
}

A failed video has error and refunded (whether the credits are back on your balance).

GET /v1/credits

curl https://www.avideoai.com/v1/credits -H "Authorization: Bearer $AVIDEOAI_API_KEY"

{ "balance": 14 }

Limits

  • 30 requests per minute per key, across all endpoints.
  • 3 videos queued or processing at once per key.

Errors

Every error has the same shape:

{ "error": { "code": "insufficient_credits", "message": "…" } }
HTTPcodeMeaning
401unauthorizedMissing, malformed, unknown or revoked API key.
400invalid_requestThe body or parameters failed validation.
402insufficient_creditsYour balance is below the cost of this video. Nothing was charged.
404not_foundNo such video on your account.
422image_unreachableimage_url could not be downloaded, or is not a JPEG/PNG under 10MB.
429rate_limitedMore than 30 requests in a minute on this key. See the Retry-After header.
429concurrency_limitThis key already has 3 videos queued or processing. Wait for one to finish.
500internal_errorSomething failed on our side. Safe to retry with the same Idempotency-Key.

MCP server (Claude and other agents)

The avideoai MCP server gives an agent three tools — create_product_video, get_video_status and check_credits — backed by this API and your key. It is published on npm as avideoai-mcp and listed in the official MCP registry as io.github.jacklee1000/avideoai-mcp.

You need an API key (avk_live_...): create one on your account page. Requires Node.js 20 or later.

Claude Code:

claude mcp add avideoai --env AVIDEOAI_API_KEY=avk_live_... -- npx -y avideoai-mcp

Claude Desktop: add this to claude_desktop_config.json (Settings → Developer → Edit Config), then restart Claude Desktop:

{
  "mcpServers": {
    "avideoai": {
      "command": "npx",
      "args": ["-y", "avideoai-mcp"],
      "env": { "AVIDEOAI_API_KEY": "avk_live_..." }
    }
  }
}

Cursor: add the same block to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json in a project:

{
  "mcpServers": {
    "avideoai": {
      "command": "npx",
      "args": ["-y", "avideoai-mcp"],
      "env": { "AVIDEOAI_API_KEY": "avk_live_..." }
    }
  }
}

Remote (streamable HTTP): point your client at https://<your-mcp-host>/mcp and send your key as Authorization: Bearer avk_live_.... Each caller uses their own key.