aivideowatch 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -2
- package/cli.mjs +100 -0
- package/index.mjs +63 -0
- package/package.json +45 -4
package/README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# aivideowatch
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://aivideowatch.com/models/seedance-2-5)
|
|
4
|
+
[](https://aivideowatch.com/models/kling-4-0)
|
|
5
|
+
[](https://aivideowatch.com/models/wan-3-0)
|
|
6
|
+
[](https://aivideowatch.com/models/magi-2)
|
|
7
|
+
|
|
8
|
+
Zero-dependency Node.js SDK, CLI, and **Official MCP Server (`com.aivideowatch/pricing-mcp`)** for live AI video generation pricing, retry-adjusted cost-per-usable-clip budgets, and cross-platform model arbitrage across **53 platforms** and **31 canonical models** from **[AIVideoWatch.com](https://aivideowatch.com)** (`CC BY 4.0`, no API key required).
|
|
9
|
+
|
|
10
|
+
[](https://aivideowatch.com/api-pricing)
|
|
11
|
+
|
|
12
|
+
## Quick Start (CLI)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# List flagship model floors & arbitrage spreads
|
|
16
|
+
npx aivideowatch
|
|
17
|
+
|
|
18
|
+
# Find the cheapest verified host for any model
|
|
19
|
+
npx aivideowatch cheapest seedance-2-5
|
|
20
|
+
npx aivideowatch cheapest kling-4-0
|
|
21
|
+
|
|
22
|
+
# Compute raw (1x) and usable (2.5x / 3x retries) clip costs
|
|
23
|
+
npx aivideowatch clip seedance-2-5 --sec 30 --tries 3
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Official MCP Server (Claude Desktop, Cursor, VS Code)
|
|
27
|
+
|
|
28
|
+
**Option 1 — Hosted Streamable HTTP (recommended, zero local install):**
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"aivideowatch": {
|
|
33
|
+
"url": "https://aivideowatch.com/api/mcp"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Option 2 — Local stdio bridge via `npx`:**
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"aivideowatch": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["-y", "aivideowatch", "mcp"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Programmatic Usage
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import { cheapestModel, calculateClipCost, getModels } from "aivideowatch";
|
|
55
|
+
|
|
56
|
+
const best = await cheapestModel("seedance-2-5");
|
|
57
|
+
const budget = await calculateClipCost("kling-4-0", { durationSec: 10, tries: 2.5 });
|
|
58
|
+
console.log(best, budget);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Links, Open Data & Peer-Citable Technical Report
|
|
62
|
+
- **Interactive Cost-Per-Clip Calculator:** https://aivideowatch.com/cost-per-clip-calculator
|
|
63
|
+
- **Direct API Pricing Index (299 rates):** https://aivideowatch.com/api-pricing
|
|
64
|
+
- **Cheapest AI Video APIs (2026 Ranked):** https://aivideowatch.com/best/cheapest-ai-video-api
|
|
65
|
+
- **How Much Does a 1-Minute AI Video Cost (2026):** https://aivideowatch.com/guides/how-much-does-a-1-minute-ai-video-cost
|
|
66
|
+
- **Open Datasets, Live SVG Charts & OpenAPI 3.1:** https://aivideowatch.com/datasets
|
|
67
|
+
- **Official MCP Registry:** https://registry.modelcontextprotocol.io/v0.1/servers/com.aivideowatch%2Fpricing-mcp/versions/latest
|
|
68
|
+
- **6-Page Technical Report (CERN Zenodo DOI):** https://doi.org/10.5281/zenodo.24724427
|
|
69
|
+
- **Preprint PDF Mirror (Figshare DOI):** https://doi.org/10.6084/m9.figshare.35173666
|
|
70
|
+
- **Open Dataset DOIs:** Zenodo https://doi.org/10.5281/zenodo.24715193 · Figshare https://doi.org/10.6084/m9.figshare.35171947
|
package/cli.mjs
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import readline from "node:readline";
|
|
3
|
+
import { calculateClipCost, cheapestModel, getCostPerClip } from "./index.mjs";
|
|
4
|
+
|
|
5
|
+
const [, , cmd = "top", arg1, ...rest] = process.argv;
|
|
6
|
+
|
|
7
|
+
function flagNum(name, fallback) {
|
|
8
|
+
const idx = rest.indexOf(name);
|
|
9
|
+
if (idx !== -1 && rest[idx + 1]) {
|
|
10
|
+
const n = Number(rest[idx + 1]);
|
|
11
|
+
if (Number.isFinite(n) && n > 0) return n;
|
|
12
|
+
}
|
|
13
|
+
return fallback;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function runMcpStdioBridge() {
|
|
17
|
+
const endpoint = "https://aivideowatch.com/api/mcp";
|
|
18
|
+
const rl = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
19
|
+
for await (const rawLine of rl) {
|
|
20
|
+
const line = rawLine.trim();
|
|
21
|
+
if (!line) continue;
|
|
22
|
+
try {
|
|
23
|
+
const res = await fetch(endpoint, {
|
|
24
|
+
method: "POST",
|
|
25
|
+
headers: {
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
Accept: "application/json",
|
|
28
|
+
"User-Agent": "aivideowatch-npm-mcp-bridge/1.0.1",
|
|
29
|
+
},
|
|
30
|
+
body: line,
|
|
31
|
+
});
|
|
32
|
+
if (res.status === 202 || res.status === 204) continue;
|
|
33
|
+
const text = await res.text();
|
|
34
|
+
if (text.trim()) {
|
|
35
|
+
process.stdout.write(text.replace(/\r?\n/g, " ").trim() + "\n");
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
let id = null;
|
|
39
|
+
try {
|
|
40
|
+
id = JSON.parse(line).id ?? null;
|
|
41
|
+
} catch {}
|
|
42
|
+
if (id !== null) {
|
|
43
|
+
process.stdout.write(
|
|
44
|
+
JSON.stringify({
|
|
45
|
+
jsonrpc: "2.0",
|
|
46
|
+
id,
|
|
47
|
+
error: { code: -32000, message: `AIVideoWatch MCP bridge error: ${err.message}` },
|
|
48
|
+
}) + "\n"
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
if (cmd === "mcp") {
|
|
57
|
+
await runMcpStdioBridge();
|
|
58
|
+
} else if (cmd === "cheapest" && arg1) {
|
|
59
|
+
const m = await cheapestModel(arg1);
|
|
60
|
+
if (!m) {
|
|
61
|
+
console.error(`Model '${arg1}' not found. Run 'aivideowatch top' to list flagship models.`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
console.log(`${m.name} (${m.hosts} verified hosts, ${m.spreadMultiple ?? "—"}x spread)`);
|
|
65
|
+
if (m.cheapestSubscription) {
|
|
66
|
+
console.log(` Cheapest Sub: ${m.cheapestSubscription.toolName} — $${m.cheapestSubscription.usdPerSec.toFixed(3)}/s`);
|
|
67
|
+
}
|
|
68
|
+
if (m.cheapestApi) {
|
|
69
|
+
console.log(` Cheapest API: ${m.cheapestApi.toolName} — $${m.cheapestApi.usdPerSec.toFixed(3)}/s`);
|
|
70
|
+
}
|
|
71
|
+
console.log(` Full table: ${m.url}`);
|
|
72
|
+
} else if (cmd === "clip" && arg1) {
|
|
73
|
+
const sec = flagNum("--sec", 10);
|
|
74
|
+
const tries = flagNum("--tries", 3);
|
|
75
|
+
const res = await calculateClipCost(arg1, { durationSec: sec, tries });
|
|
76
|
+
if (!res) {
|
|
77
|
+
console.error(`Model '${arg1}' not found.`);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
console.log(`${res.name} — ${sec}s clip (${tries}x tries):`);
|
|
81
|
+
console.log(` Raw (1x): $${res.rawUsd?.toFixed(2) ?? "—"}`);
|
|
82
|
+
console.log(` Usable 2.5x: $${res.usable2_5xUsd?.toFixed(2) ?? "—"}`);
|
|
83
|
+
console.log(` Usable ${tries}x: $${res.usableCustomUsd?.toFixed(2) ?? "—"}`);
|
|
84
|
+
console.log(` Calculator: https://aivideowatch.com/cost-per-clip-calculator`);
|
|
85
|
+
} else {
|
|
86
|
+
const data = await getCostPerClip();
|
|
87
|
+
const flagships = ["seedance-2-5", "kling-4-0", "wan-3-0", "veo-3-1", "magi-2", "runway-gen-4-5"];
|
|
88
|
+
console.log(`AIVideoWatch Live AI Video Pricing (${data.meta?.verifiedAt?.slice(0, 10)}) — https://aivideowatch.com\n`);
|
|
89
|
+
for (const slug of flagships) {
|
|
90
|
+
const m = data.models.find((x) => x.slug === slug);
|
|
91
|
+
if (!m) continue;
|
|
92
|
+
const sub = m.cheapestRetail ? `${m.cheapestRetail.toolName} ($${m.cheapestRetail.usdPerSec.toFixed(3)}/s)` : "—";
|
|
93
|
+
const api = m.cheapestApi ? `${m.cheapestApi.toolName} ($${m.cheapestApi.usdPerSec.toFixed(3)}/s)` : "—";
|
|
94
|
+
console.log(`${m.name.padEnd(16)} | Sub: ${sub.padEnd(28)} | API: ${api.padEnd(28)} | Spread: ${m.arbitrageSpreadMultiple ?? "—"}x`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
} catch (err) {
|
|
98
|
+
console.error(err.message);
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
package/index.mjs
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const BASE_URL = "https://aivideowatch.com/api/v1";
|
|
2
|
+
|
|
3
|
+
async function fetchJson(endpoint) {
|
|
4
|
+
const res = await fetch(`${BASE_URL}/${endpoint}`, {
|
|
5
|
+
headers: { "User-Agent": "aivideowatch-npm/1.0.0 (+https://aivideowatch.com)" },
|
|
6
|
+
});
|
|
7
|
+
if (!res.ok) {
|
|
8
|
+
throw new Error(`AIVideoWatch API ${endpoint} failed with HTTP ${res.status}`);
|
|
9
|
+
}
|
|
10
|
+
return res.json();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function getPricing() {
|
|
14
|
+
return fetchJson("pricing.json");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function getModels() {
|
|
18
|
+
return fetchJson("models.json");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function getCostPerClip() {
|
|
22
|
+
return fetchJson("cost-per-clip.json");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function cheapestModel(query) {
|
|
26
|
+
const data = await getCostPerClip();
|
|
27
|
+
const q = String(query || "").trim().toLowerCase();
|
|
28
|
+
const norm = q.replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
29
|
+
const match =
|
|
30
|
+
data.models.find((m) => m.slug === q || m.slug === norm) ||
|
|
31
|
+
data.models.find((m) => m.name.toLowerCase() === q) ||
|
|
32
|
+
data.models.find((m) => m.slug.includes(norm) || m.name.toLowerCase().includes(q));
|
|
33
|
+
if (!match) return null;
|
|
34
|
+
return {
|
|
35
|
+
verifiedAt: data.meta?.verifiedAt,
|
|
36
|
+
slug: match.slug,
|
|
37
|
+
name: match.name,
|
|
38
|
+
url: `https://aivideowatch.com/models/${match.slug}`,
|
|
39
|
+
hosts: match.platformCount ?? match.hostCount ?? null,
|
|
40
|
+
spreadMultiple: match.arbitrageSpreadMultiple,
|
|
41
|
+
cheapestSubscription: match.cheapestRetail,
|
|
42
|
+
cheapestApi: match.cheapestApi,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function calculateClipCost(modelQuery, { durationSec = 10, tries = 3 } = {}) {
|
|
47
|
+
const info = await cheapestModel(modelQuery);
|
|
48
|
+
if (!info) return null;
|
|
49
|
+
const subPps = info.cheapestSubscription?.usdPerSec ?? null;
|
|
50
|
+
const apiPps = info.cheapestApi?.usdPerSec ?? null;
|
|
51
|
+
const bestPps =
|
|
52
|
+
subPps !== null && apiPps !== null ? Math.min(subPps, apiPps) : (subPps ?? apiPps);
|
|
53
|
+
const round = (v) => (v === null ? null : Math.round(v * 100) / 100);
|
|
54
|
+
return {
|
|
55
|
+
...info,
|
|
56
|
+
durationSec,
|
|
57
|
+
tries,
|
|
58
|
+
rawUsd: bestPps !== null ? round(bestPps * durationSec) : null,
|
|
59
|
+
usable2_5xUsd: bestPps !== null ? round(bestPps * durationSec * 2.5) : null,
|
|
60
|
+
usable3xUsd: bestPps !== null ? round(bestPps * durationSec * 3) : null,
|
|
61
|
+
usableCustomUsd: bestPps !== null ? round(bestPps * durationSec * tries) : null,
|
|
62
|
+
};
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aivideowatch",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"mcpName": "com.aivideowatch/pricing-mcp",
|
|
5
|
+
"description": "Zero-dependency Node.js SDK & CLI for live AI video generation pricing, cost-per-usable-clip budgets, and cross-platform model arbitrage (Seedance 2.5, Kling 4.0, Wan 3.0, Veo 3.1, Magi-2) from AIVideoWatch.com (CC BY 4.0).",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./index.mjs",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.mjs"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"aivideowatch": "cli.mjs"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"index.mjs",
|
|
16
|
+
"cli.mjs",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18.0.0"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"ai-video",
|
|
24
|
+
"pricing",
|
|
25
|
+
"seedance",
|
|
26
|
+
"kling",
|
|
27
|
+
"wan",
|
|
28
|
+
"veo",
|
|
29
|
+
"magi-2",
|
|
30
|
+
"runway",
|
|
31
|
+
"cost-per-clip",
|
|
32
|
+
"api-pricing",
|
|
33
|
+
"benchmark",
|
|
34
|
+
"mcp"
|
|
35
|
+
],
|
|
36
|
+
"author": "AIVideoWatch Research <https://aivideowatch.com>",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"homepage": "https://aivideowatch.com",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/watchingyourback1/ai-video-pricing-index.git",
|
|
42
|
+
"directory": "packages/npm"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/watchingyourback1/ai-video-pricing-index/issues"
|
|
46
|
+
}
|
|
47
|
+
}
|