aivideowatch 0.0.0-stage → 1.0.0

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.
Files changed (4) hide show
  1. package/README.md +39 -2
  2. package/cli.mjs +58 -0
  3. package/index.mjs +63 -0
  4. package/package.json +44 -4
package/README.md CHANGED
@@ -1,3 +1,40 @@
1
- # Temporary Holding Version
1
+ # aivideowatch
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Seedance 2.5 Pricing](https://aivideowatch.com/api/v1/badge/model/seedance-2-5.svg)](https://aivideowatch.com/models/seedance-2-5)
4
+ [![Kling 4.0 Pricing](https://aivideowatch.com/api/v1/badge/model/kling-4-0.svg)](https://aivideowatch.com/models/kling-4-0)
5
+ [![Wan 3.0 Pricing](https://aivideowatch.com/api/v1/badge/model/wan-3-0.svg)](https://aivideowatch.com/models/wan-3-0)
6
+ [![Magi-2 Pricing](https://aivideowatch.com/api/v1/badge/model/magi-2.svg)](https://aivideowatch.com/models/magi-2)
7
+
8
+ Zero-dependency Node.js SDK & CLI 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
+ ## Quick Start (CLI)
11
+
12
+ ```bash
13
+ # List flagship model floors & arbitrage spreads
14
+ npx aivideowatch
15
+
16
+ # Find the cheapest verified host for any model
17
+ npx aivideowatch cheapest seedance-2-5
18
+ npx aivideowatch cheapest kling-4-0
19
+
20
+ # Compute raw (1x) and usable (2.5x / 3x retries) clip costs
21
+ npx aivideowatch clip seedance-2-5 --sec 30 --tries 3
22
+ ```
23
+
24
+ ## Programmatic Usage
25
+
26
+ ```js
27
+ import { cheapestModel, calculateClipCost, getModels } from "aivideowatch";
28
+
29
+ const best = await cheapestModel("seedance-2-5");
30
+ const budget = await calculateClipCost("kling-4-0", { durationSec: 10, tries: 2.5 });
31
+ console.log(best, budget);
32
+ ```
33
+
34
+ ## Links & Open Data
35
+ - **Interactive Cost-Per-Clip Calculator:** https://aivideowatch.com/cost-per-clip-calculator
36
+ - **Direct API Pricing Index:** https://aivideowatch.com/api-pricing
37
+ - **Open Datasets & OpenAPI 3.1:** https://aivideowatch.com/datasets
38
+ - **Remote MCP Server:** https://aivideowatch.com/api/mcp
39
+ - **CERN Zenodo DOI:** https://doi.org/10.5281/zenodo.24715193
40
+ - **Figshare DOI:** https://doi.org/10.6084/m9.figshare.35171947
package/cli.mjs ADDED
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ import { calculateClipCost, cheapestModel, getCostPerClip } from "./index.mjs";
3
+
4
+ const [, , cmd = "top", arg1, ...rest] = process.argv;
5
+
6
+ function flagNum(name, fallback) {
7
+ const idx = rest.indexOf(name);
8
+ if (idx !== -1 && rest[idx + 1]) {
9
+ const n = Number(rest[idx + 1]);
10
+ if (Number.isFinite(n) && n > 0) return n;
11
+ }
12
+ return fallback;
13
+ }
14
+
15
+ try {
16
+ if (cmd === "cheapest" && arg1) {
17
+ const m = await cheapestModel(arg1);
18
+ if (!m) {
19
+ console.error(`Model '${arg1}' not found. Run 'aivideowatch top' to list flagship models.`);
20
+ process.exit(1);
21
+ }
22
+ console.log(`${m.name} (${m.hosts} verified hosts, ${m.spreadMultiple ?? "—"}x spread)`);
23
+ if (m.cheapestSubscription) {
24
+ console.log(` Cheapest Sub: ${m.cheapestSubscription.toolName} — $${m.cheapestSubscription.usdPerSec.toFixed(3)}/s`);
25
+ }
26
+ if (m.cheapestApi) {
27
+ console.log(` Cheapest API: ${m.cheapestApi.toolName} — $${m.cheapestApi.usdPerSec.toFixed(3)}/s`);
28
+ }
29
+ console.log(` Full table: ${m.url}`);
30
+ } else if (cmd === "clip" && arg1) {
31
+ const sec = flagNum("--sec", 10);
32
+ const tries = flagNum("--tries", 3);
33
+ const res = await calculateClipCost(arg1, { durationSec: sec, tries });
34
+ if (!res) {
35
+ console.error(`Model '${arg1}' not found.`);
36
+ process.exit(1);
37
+ }
38
+ console.log(`${res.name} — ${sec}s clip (${tries}x tries):`);
39
+ console.log(` Raw (1x): $${res.rawUsd?.toFixed(2) ?? "—"}`);
40
+ console.log(` Usable 2.5x: $${res.usable2_5xUsd?.toFixed(2) ?? "—"}`);
41
+ console.log(` Usable ${tries}x: $${res.usableCustomUsd?.toFixed(2) ?? "—"}`);
42
+ console.log(` Calculator: https://aivideowatch.com/cost-per-clip-calculator`);
43
+ } else {
44
+ const data = await getCostPerClip();
45
+ const flagships = ["seedance-2-5", "kling-4-0", "wan-3-0", "veo-3-1", "magi-2", "runway-gen-4-5"];
46
+ console.log(`AIVideoWatch Live AI Video Pricing (${data.meta?.verifiedAt?.slice(0, 10)}) — https://aivideowatch.com\n`);
47
+ for (const slug of flagships) {
48
+ const m = data.models.find((x) => x.slug === slug);
49
+ if (!m) continue;
50
+ const sub = m.cheapestRetail ? `${m.cheapestRetail.toolName} ($${m.cheapestRetail.usdPerSec.toFixed(3)}/s)` : "—";
51
+ const api = m.cheapestApi ? `${m.cheapestApi.toolName} ($${m.cheapestApi.usdPerSec.toFixed(3)}/s)` : "—";
52
+ console.log(`${m.name.padEnd(16)} | Sub: ${sub.padEnd(28)} | API: ${api.padEnd(28)} | Spread: ${m.arbitrageSpreadMultiple ?? "—"}x`);
53
+ }
54
+ }
55
+ } catch (err) {
56
+ console.error(err.message);
57
+ process.exit(1);
58
+ }
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,46 @@
1
1
  {
2
2
  "name": "aivideowatch",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "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).",
5
+ "type": "module",
6
+ "main": "./index.mjs",
7
+ "exports": {
8
+ ".": "./index.mjs"
9
+ },
10
+ "bin": {
11
+ "aivideowatch": "cli.mjs"
12
+ },
13
+ "files": [
14
+ "index.mjs",
15
+ "cli.mjs",
16
+ "README.md"
17
+ ],
18
+ "engines": {
19
+ "node": ">=18.0.0"
20
+ },
21
+ "keywords": [
22
+ "ai-video",
23
+ "pricing",
24
+ "seedance",
25
+ "kling",
26
+ "wan",
27
+ "veo",
28
+ "magi-2",
29
+ "runway",
30
+ "cost-per-clip",
31
+ "api-pricing",
32
+ "benchmark",
33
+ "mcp"
34
+ ],
35
+ "author": "AIVideoWatch Research <https://aivideowatch.com>",
36
+ "license": "MIT",
37
+ "homepage": "https://aivideowatch.com",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/watchingyourback1/ai-video-pricing-index.git",
41
+ "directory": "packages/npm"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/watchingyourback1/ai-video-pricing-index/issues"
45
+ }
46
+ }