@blockrun/clawrouter 0.12.296 → 0.12.298
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 +155 -181
- package/dist/cli.js +124 -18
- package/dist/index.js +41 -18
- package/dist/router/index.js +27 -4
- package/docs/anthropic-cost-savings.md +1 -1
- package/docs/anthropic-third-party-harness-changes.md +2 -2
- package/docs/clawrouter-vs-openrouter-llm-routing-comparison.md +3 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -3
- package/skills/clawrouter/SKILL.md +40 -30
- package/skills/imagegen/SKILL.md +17 -15
- package/skills/surf/SKILL.md +0 -274
package/dist/cli.js
CHANGED
|
@@ -6758,7 +6758,7 @@ var init_api_key = __esm({
|
|
|
6758
6758
|
HINTS = {
|
|
6759
6759
|
401: `Check BLOCKRUN_API_KEY, or mint a new key at ${PORTAL_KEYS_URL}.`,
|
|
6760
6760
|
402: `Top up your BlockRun credit at ${PORTAL_CREDITS_URL}.`,
|
|
6761
|
-
404: `api.blockrun.ai does not serve this endpoint. Chat, Anthropic-shaped messages, images, speech, video and the partner APIs (
|
|
6761
|
+
404: `api.blockrun.ai does not serve this endpoint. Chat, Anthropic-shaped messages, images, speech, video and the partner APIs (Exa, prediction markets, phone lookup) all work on an API key. The wallet-only exceptions are the routes that bind a lease or a position to a payer address \u2014 buying/renewing/releasing phone numbers, and Polymarket trading \u2014 which need a wallet to own the thing being bought. For those, unset BLOCKRUN_API_KEY and run "clawrouter logout".`
|
|
6762
6762
|
};
|
|
6763
6763
|
}
|
|
6764
6764
|
});
|
|
@@ -7304,8 +7304,8 @@ var init_models = __esm({
|
|
|
7304
7304
|
"mistral-large": "free/mistral-large-3-675b",
|
|
7305
7305
|
"mistral-large-3-675b": "free/mistral-large-3-675b",
|
|
7306
7306
|
"qwen3.5-122b": "free/qwen3.5-122b-a10b",
|
|
7307
|
-
// Mistral Large 4 (blockrun 2026-10-07) — PAID, $
|
|
7308
|
-
//
|
|
7307
|
+
// Mistral Large 4 (blockrun 2026-10-07) — PAID, $1.36/$4.18 (Mistral's list
|
|
7308
|
+
// rate since its launch promo ended, 2026-10-20). Explicit pins only.
|
|
7309
7309
|
"mistral-large-4": "mistral/mistral-large-4",
|
|
7310
7310
|
"qwen3-122b": "free/qwen3.5-122b-a10b",
|
|
7311
7311
|
// Free model shorthand aliases. v4-flash EOL'd 2026-08-12 — no free DeepSeek
|
|
@@ -9287,15 +9287,16 @@ var init_models = __esm({
|
|
|
9287
9287
|
reasoning: true
|
|
9288
9288
|
},
|
|
9289
9289
|
{
|
|
9290
|
-
//
|
|
9291
|
-
//
|
|
9290
|
+
// $1.36/$4.18, Mistral's list rate. Listed 2026-10-07 at its $0.68/$2.09
|
|
9291
|
+
// launch promo; the promo ended and blockrun repriced 2026-10-20 (#857),
|
|
9292
|
+
// so this follows. Probed by blockrun
|
|
9292
9293
|
// through OpenRouter: text, stream, tools (clean tool_calls) and image input
|
|
9293
9294
|
// all served; reasoning is on by default.
|
|
9294
9295
|
id: "mistral/mistral-large-4",
|
|
9295
9296
|
name: "Mistral Large 4",
|
|
9296
9297
|
version: "large-4",
|
|
9297
|
-
inputPrice:
|
|
9298
|
-
outputPrice:
|
|
9298
|
+
inputPrice: 1.36,
|
|
9299
|
+
outputPrice: 4.18,
|
|
9299
9300
|
contextWindow: 524288,
|
|
9300
9301
|
maxOutput: 262144,
|
|
9301
9302
|
reasoning: true,
|
|
@@ -45961,10 +45962,9 @@ var init_dist = __esm({
|
|
|
45961
45962
|
supportsVision: false
|
|
45962
45963
|
},
|
|
45963
45964
|
"deepseek/deepseek-v4.1-flash": {
|
|
45964
|
-
// supportsTools: not probed — fails closed
|
|
45965
45965
|
contextWindow: 1048576,
|
|
45966
45966
|
maxOutputTokens: 65536,
|
|
45967
|
-
supportsTools:
|
|
45967
|
+
supportsTools: true,
|
|
45968
45968
|
supportsVision: false
|
|
45969
45969
|
},
|
|
45970
45970
|
"google/gemini-2.5-flash": {
|
|
@@ -46027,6 +46027,13 @@ var init_dist = __esm({
|
|
|
46027
46027
|
supportsTools: true,
|
|
46028
46028
|
supportsVision: true
|
|
46029
46029
|
},
|
|
46030
|
+
"google/gemini-4-argon": {
|
|
46031
|
+
// supportsTools: not probed — fails closed
|
|
46032
|
+
contextWindow: 1048576,
|
|
46033
|
+
maxOutputTokens: 65536,
|
|
46034
|
+
supportsTools: false,
|
|
46035
|
+
supportsVision: true
|
|
46036
|
+
},
|
|
46030
46037
|
"minimax/minimax-m2.7": {
|
|
46031
46038
|
contextWindow: 204800,
|
|
46032
46039
|
maxOutputTokens: 16384,
|
|
@@ -46248,10 +46255,9 @@ var init_dist = __esm({
|
|
|
46248
46255
|
supportsVision: true
|
|
46249
46256
|
},
|
|
46250
46257
|
"openai/gpt-6.1-sol": {
|
|
46251
|
-
// supportsTools: not probed — fails closed
|
|
46252
46258
|
contextWindow: 105e4,
|
|
46253
46259
|
maxOutputTokens: 128e3,
|
|
46254
|
-
supportsTools:
|
|
46260
|
+
supportsTools: true,
|
|
46255
46261
|
supportsVision: true
|
|
46256
46262
|
},
|
|
46257
46263
|
"openai/o1": {
|
|
@@ -46506,6 +46512,14 @@ var init_dist = __esm({
|
|
|
46506
46512
|
errorRate: 0,
|
|
46507
46513
|
samples: 3
|
|
46508
46514
|
},
|
|
46515
|
+
"deepseek/deepseek-v4.1-flash": {
|
|
46516
|
+
measuredAt: "2026-10-20T18:12:51Z",
|
|
46517
|
+
latencyMs: 2383.5,
|
|
46518
|
+
p95LatencyMs: 2547.8,
|
|
46519
|
+
outputTokensPerSecond: 216.53,
|
|
46520
|
+
errorRate: 0,
|
|
46521
|
+
samples: 3
|
|
46522
|
+
},
|
|
46509
46523
|
"google/gemini-2.5-flash": {
|
|
46510
46524
|
measuredAt: "2026-08-29T16:51:33Z",
|
|
46511
46525
|
latencyMs: 5416.4,
|
|
@@ -46794,6 +46808,14 @@ var init_dist = __esm({
|
|
|
46794
46808
|
errorRate: 0,
|
|
46795
46809
|
samples: 3
|
|
46796
46810
|
},
|
|
46811
|
+
"openai/gpt-6.1-sol": {
|
|
46812
|
+
measuredAt: "2026-10-20T18:12:51Z",
|
|
46813
|
+
latencyMs: 11324,
|
|
46814
|
+
p95LatencyMs: 12747.6,
|
|
46815
|
+
outputTokensPerSecond: 45.11,
|
|
46816
|
+
errorRate: 0,
|
|
46817
|
+
samples: 3
|
|
46818
|
+
},
|
|
46797
46819
|
"openai/o1": {
|
|
46798
46820
|
measuredAt: "2026-08-29T16:51:33Z",
|
|
46799
46821
|
latencyMs: 4324.9,
|
|
@@ -47018,11 +47040,13 @@ var init_dist = __esm({
|
|
|
47018
47040
|
"anthropic/claude-fable-5.1",
|
|
47019
47041
|
"anthropic/claude-opus-5.5",
|
|
47020
47042
|
"anthropic/claude-sonnet-5.5",
|
|
47043
|
+
"deepseek/deepseek-v4.1-flash",
|
|
47021
47044
|
"google/gemini-3.8-flash",
|
|
47022
47045
|
"openai/gpt-5.1",
|
|
47023
47046
|
"openai/gpt-6-astra",
|
|
47024
47047
|
"openai/gpt-6-luna",
|
|
47025
47048
|
"openai/gpt-6-sol",
|
|
47049
|
+
"openai/gpt-6.1-sol",
|
|
47026
47050
|
"xai/grok-4.6",
|
|
47027
47051
|
"xai/grok-4.7",
|
|
47028
47052
|
"xiaomi/mimo-v2.5"
|
|
@@ -137831,8 +137855,7 @@ async function proxyPaidApiRequest(req, res, apiBase, payFetch, getActualPayment
|
|
|
137831
137855
|
const isBlockrunExa = req.url?.startsWith("/v1/exa/") ?? false;
|
|
137832
137856
|
const isModalSandbox = req.url?.startsWith("/v1/modal/") ?? false;
|
|
137833
137857
|
const isPhone = (req.url?.startsWith("/v1/phone/") ?? false) || (req.url?.startsWith("/v1/voice/") ?? false);
|
|
137834
|
-
const
|
|
137835
|
-
const requestLabel = isBlockrunExa ? "BlockRun Exa" : isModalSandbox ? "Modal Sandbox" : isPhone ? "Phone/Voice" : isSurf ? "Surf" : "Partner";
|
|
137858
|
+
const requestLabel = isBlockrunExa ? "BlockRun Exa" : isModalSandbox ? "Modal Sandbox" : isPhone ? "Phone/Voice" : "Partner";
|
|
137836
137859
|
const bodyChunks = [];
|
|
137837
137860
|
for await (const chunk of req) {
|
|
137838
137861
|
bodyChunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
@@ -137903,14 +137926,14 @@ async function proxyPaidApiRequest(req, res, apiBase, payFetch, getActualPayment
|
|
|
137903
137926
|
logUsage({
|
|
137904
137927
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
137905
137928
|
...blockrunRequestId(upstream) ? { requestId: blockrunRequestId(upstream) } : {},
|
|
137906
|
-
model: isBlockrunExa ? "blockrun-exa" : isModalSandbox ? "modal-sandbox" : isPhone ? (req.url ?? "").replace(/^\/v1\//, "").split("?")[0] :
|
|
137907
|
-
tier: isPhone ? "PHONE" :
|
|
137929
|
+
model: isBlockrunExa ? "blockrun-exa" : isModalSandbox ? "modal-sandbox" : isPhone ? (req.url ?? "").replace(/^\/v1\//, "").split("?")[0] : "partner",
|
|
137930
|
+
tier: isPhone ? "PHONE" : "PARTNER",
|
|
137908
137931
|
cost: requestCost,
|
|
137909
137932
|
baselineCost: requestCost,
|
|
137910
137933
|
savings: 0,
|
|
137911
137934
|
latencyMs,
|
|
137912
137935
|
partnerId: (req.url?.split("?")[0] ?? "").replace(/^\/v1\//, "").replace(/\//g, "_") || "unknown",
|
|
137913
|
-
service: isBlockrunExa ? "web_search" : isModalSandbox ? "modal" : isPhone ? "phone" :
|
|
137936
|
+
service: isBlockrunExa ? "web_search" : isModalSandbox ? "modal" : isPhone ? "phone" : "partner"
|
|
137914
137937
|
}).catch(() => {
|
|
137915
137938
|
});
|
|
137916
137939
|
}
|
|
@@ -139185,7 +139208,7 @@ async function startProxy(options) {
|
|
|
139185
139208
|
}
|
|
139186
139209
|
const isVerbatimGatewayPath = req.url === "/v1/messages" || (req.url?.startsWith("/v1/messages?") ?? false) || req.url === "/v1/audio/speech" || (req.url?.startsWith("/v1/audio/speech?") ?? false);
|
|
139187
139210
|
if (isVerbatimGatewayPath || req.url?.match(
|
|
139188
|
-
/^\/v1\/(?:partner|pm|exa|modal|stocks|usstock|crypto|fx|commodity|phone|voice
|
|
139211
|
+
/^\/v1\/(?:partner|pm|exa|modal|stocks|usstock|crypto|fx|commodity|phone|voice)\//
|
|
139189
139212
|
)) {
|
|
139190
139213
|
try {
|
|
139191
139214
|
await proxyPaidApiRequest(
|
|
@@ -139250,7 +139273,7 @@ async function startProxy(options) {
|
|
|
139250
139273
|
res.end(
|
|
139251
139274
|
JSON.stringify({
|
|
139252
139275
|
error: {
|
|
139253
|
-
message: `ClawRouter does not proxy ${req.url}. It serves /v1/chat/completions, /v1/messages, /v1/models, /v1/images/generations, /v1/images/image2image, /v1/videos/generations, /v1/audio/generations, /v1/audio/speech, and the partner prefixes /v1/{partner,pm,exa,modal,stocks,usstock,crypto,fx,commodity,phone,voice
|
|
139276
|
+
message: `ClawRouter does not proxy ${req.url}. It serves /v1/chat/completions, /v1/messages, /v1/models, /v1/images/generations, /v1/images/image2image, /v1/videos/generations, /v1/audio/generations, /v1/audio/speech, and the partner prefixes /v1/{partner,pm,exa,modal,stocks,usstock,crypto,fx,commodity,phone,voice}/. If BlockRun serves this endpoint, call it directly against the gateway.`,
|
|
139254
139277
|
type: "invalid_request_error",
|
|
139255
139278
|
code: "unsupported_endpoint"
|
|
139256
139279
|
}
|
|
@@ -287746,6 +287769,7 @@ ClawRouter v${VERSION} - Smart LLM Router
|
|
|
287746
287769
|
|
|
287747
287770
|
Usage:
|
|
287748
287771
|
clawrouter [options]
|
|
287772
|
+
clawrouter update # Update ClawRouter in place
|
|
287749
287773
|
clawrouter login [brk_...] # Use a BlockRun API key (card-funded credit)
|
|
287750
287774
|
clawrouter logout # Forget the API key and go back to the wallet
|
|
287751
287775
|
clawrouter status # Live proxy status (wallet, balance, chain)
|
|
@@ -287788,6 +287812,8 @@ Query Commands (talk to running proxy on localhost:${getProxyPort()}):
|
|
|
287788
287812
|
cache Response cache stats (hit rate, size)
|
|
287789
287813
|
|
|
287790
287814
|
Management Commands:
|
|
287815
|
+
update Update the OpenClaw plugin and this global CLI in one step.
|
|
287816
|
+
Backs up wallet/config state and rolls back on failure.
|
|
287791
287817
|
setup Finish OpenClaw integration (run after npm install -g).
|
|
287792
287818
|
Registers ClawRouter as a plugin, syncs the model allowlist,
|
|
287793
287819
|
and writes the auth profile. Idempotent \u2014 safe to re-run.
|
|
@@ -288516,6 +288542,79 @@ async function cmdSetup() {
|
|
|
288516
288542
|
Then verify in your bot: /models \u2014 you should see ${VISIBLE_OPENCLAW_MODELS2.length} BlockRun models.`
|
|
288517
288543
|
);
|
|
288518
288544
|
}
|
|
288545
|
+
async function cmdUpdate() {
|
|
288546
|
+
const { execFileSync } = await import("child_process");
|
|
288547
|
+
const { copyFileSync: copyFileSync2, existsSync: existsSync9, mkdtempSync, realpathSync: realpathSync2, rmSync } = await import("fs");
|
|
288548
|
+
const { tmpdir } = await import("os");
|
|
288549
|
+
const { dirname: dirname6, join: join21, relative, isAbsolute } = await import("path");
|
|
288550
|
+
const { fileURLToPath: fileURLToPath2 } = await import("url");
|
|
288551
|
+
const isWindows = process.platform === "win32";
|
|
288552
|
+
const packageRoot = dirname6(dirname6(fileURLToPath2(import.meta.url)));
|
|
288553
|
+
const scriptName = isWindows ? "update.ps1" : "update.sh";
|
|
288554
|
+
const updateScript = join21(packageRoot, "scripts", scriptName);
|
|
288555
|
+
const exitStatus = (error) => typeof error === "object" && error !== null && "status" in error && typeof error.status === "number" ? error.status : 1;
|
|
288556
|
+
if (!existsSync9(updateScript)) {
|
|
288557
|
+
console.error("\u2717 The bundled updater is missing from this ClawRouter installation.");
|
|
288558
|
+
console.error(
|
|
288559
|
+
isWindows ? " Update manually: iwr -useb https://blockrun.ai/ClawRouter-update.ps1 | iex" : " Update manually: curl -fsSL https://blockrun.ai/ClawRouter-update | bash"
|
|
288560
|
+
);
|
|
288561
|
+
process.exitCode = 1;
|
|
288562
|
+
return;
|
|
288563
|
+
}
|
|
288564
|
+
console.log(`\u{1F99E} ClawRouter update (v${VERSION})
|
|
288565
|
+
`);
|
|
288566
|
+
const tempDir = mkdtempSync(join21(tmpdir(), "clawrouter-update-"));
|
|
288567
|
+
try {
|
|
288568
|
+
const script = join21(tempDir, scriptName);
|
|
288569
|
+
copyFileSync2(updateScript, script);
|
|
288570
|
+
if (isWindows) {
|
|
288571
|
+
execFileSync(
|
|
288572
|
+
"powershell.exe",
|
|
288573
|
+
["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", script],
|
|
288574
|
+
{ stdio: "inherit", env: process.env }
|
|
288575
|
+
);
|
|
288576
|
+
} else {
|
|
288577
|
+
execFileSync("bash", [script], { stdio: "inherit", env: process.env });
|
|
288578
|
+
}
|
|
288579
|
+
} catch (error) {
|
|
288580
|
+
process.exitCode = exitStatus(error);
|
|
288581
|
+
return;
|
|
288582
|
+
} finally {
|
|
288583
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
288584
|
+
}
|
|
288585
|
+
let globalRoot;
|
|
288586
|
+
try {
|
|
288587
|
+
globalRoot = execFileSync("npm", ["root", "-g"], {
|
|
288588
|
+
encoding: "utf8",
|
|
288589
|
+
shell: isWindows,
|
|
288590
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
288591
|
+
}).trim();
|
|
288592
|
+
} catch {
|
|
288593
|
+
return;
|
|
288594
|
+
}
|
|
288595
|
+
let fromGlobal;
|
|
288596
|
+
try {
|
|
288597
|
+
const rel = relative(realpathSync2(globalRoot), realpathSync2(packageRoot));
|
|
288598
|
+
fromGlobal = rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
|
|
288599
|
+
} catch {
|
|
288600
|
+
return;
|
|
288601
|
+
}
|
|
288602
|
+
if (!fromGlobal) return;
|
|
288603
|
+
const installSpec = process.env.BLOCKRUN_CLAWROUTER_INSTALL_SPEC || "@blockrun/clawrouter@latest";
|
|
288604
|
+
console.log(`
|
|
288605
|
+
\u2192 Updating global CLI (npm install -g ${installSpec})...`);
|
|
288606
|
+
try {
|
|
288607
|
+
execFileSync("npm", ["install", "-g", installSpec], {
|
|
288608
|
+
stdio: "inherit",
|
|
288609
|
+
shell: isWindows,
|
|
288610
|
+
env: process.env
|
|
288611
|
+
});
|
|
288612
|
+
console.log(" \u2713 Global CLI updated");
|
|
288613
|
+
} catch {
|
|
288614
|
+
console.warn(" \u26A0 Plugin updated, but the global CLI could not be refreshed.");
|
|
288615
|
+
console.warn(` Run manually: npm install -g ${installSpec}`);
|
|
288616
|
+
}
|
|
288617
|
+
}
|
|
288519
288618
|
function parseArgs(args) {
|
|
288520
288619
|
const result = {
|
|
288521
288620
|
version: false,
|
|
@@ -288541,6 +288640,7 @@ function parseArgs(args) {
|
|
|
288541
288640
|
reconcileDays: 7,
|
|
288542
288641
|
queryCache: false,
|
|
288543
288642
|
setup: false,
|
|
288643
|
+
update: false,
|
|
288544
288644
|
share: false,
|
|
288545
288645
|
shareTarget: void 0,
|
|
288546
288646
|
sharePreset: void 0,
|
|
@@ -288641,6 +288741,8 @@ function parseArgs(args) {
|
|
|
288641
288741
|
result.noReuse = true;
|
|
288642
288742
|
} else if (arg === "setup") {
|
|
288643
288743
|
result.setup = true;
|
|
288744
|
+
} else if (arg === "update" && i === 0) {
|
|
288745
|
+
result.update = true;
|
|
288644
288746
|
} else if (arg === "phone") {
|
|
288645
288747
|
result.phone = true;
|
|
288646
288748
|
const next = args[i + 1];
|
|
@@ -288778,6 +288880,10 @@ async function main() {
|
|
|
288778
288880
|
await cmdSetup();
|
|
288779
288881
|
process.exit(0);
|
|
288780
288882
|
}
|
|
288883
|
+
if (args.update) {
|
|
288884
|
+
await cmdUpdate();
|
|
288885
|
+
return;
|
|
288886
|
+
}
|
|
288781
288887
|
if (args.policy) {
|
|
288782
288888
|
const result = runPolicyCommand(args.policyArgs);
|
|
288783
288889
|
if (result.isError) {
|
package/dist/index.js
CHANGED
|
@@ -234385,8 +234385,8 @@ var MODEL_ALIASES = {
|
|
|
234385
234385
|
"mistral-large": "free/mistral-large-3-675b",
|
|
234386
234386
|
"mistral-large-3-675b": "free/mistral-large-3-675b",
|
|
234387
234387
|
"qwen3.5-122b": "free/qwen3.5-122b-a10b",
|
|
234388
|
-
// Mistral Large 4 (blockrun 2026-10-07) — PAID, $
|
|
234389
|
-
//
|
|
234388
|
+
// Mistral Large 4 (blockrun 2026-10-07) — PAID, $1.36/$4.18 (Mistral's list
|
|
234389
|
+
// rate since its launch promo ended, 2026-10-20). Explicit pins only.
|
|
234390
234390
|
"mistral-large-4": "mistral/mistral-large-4",
|
|
234391
234391
|
"qwen3-122b": "free/qwen3.5-122b-a10b",
|
|
234392
234392
|
// Free model shorthand aliases. v4-flash EOL'd 2026-08-12 — no free DeepSeek
|
|
@@ -236394,15 +236394,16 @@ var BLOCKRUN_MODELS = [
|
|
|
236394
236394
|
reasoning: true
|
|
236395
236395
|
},
|
|
236396
236396
|
{
|
|
236397
|
-
//
|
|
236398
|
-
//
|
|
236397
|
+
// $1.36/$4.18, Mistral's list rate. Listed 2026-10-07 at its $0.68/$2.09
|
|
236398
|
+
// launch promo; the promo ended and blockrun repriced 2026-10-20 (#857),
|
|
236399
|
+
// so this follows. Probed by blockrun
|
|
236399
236400
|
// through OpenRouter: text, stream, tools (clean tool_calls) and image input
|
|
236400
236401
|
// all served; reasoning is on by default.
|
|
236401
236402
|
id: "mistral/mistral-large-4",
|
|
236402
236403
|
name: "Mistral Large 4",
|
|
236403
236404
|
version: "large-4",
|
|
236404
|
-
inputPrice:
|
|
236405
|
-
outputPrice:
|
|
236405
|
+
inputPrice: 1.36,
|
|
236406
|
+
outputPrice: 4.18,
|
|
236406
236407
|
contextWindow: 524288,
|
|
236407
236408
|
maxOutput: 262144,
|
|
236408
236409
|
reasoning: true,
|
|
@@ -243214,7 +243215,7 @@ async function explainApiKeyFailure(response) {
|
|
|
243214
243215
|
var HINTS = {
|
|
243215
243216
|
401: `Check BLOCKRUN_API_KEY, or mint a new key at ${PORTAL_KEYS_URL}.`,
|
|
243216
243217
|
402: `Top up your BlockRun credit at ${PORTAL_CREDITS_URL}.`,
|
|
243217
|
-
404: `api.blockrun.ai does not serve this endpoint. Chat, Anthropic-shaped messages, images, speech, video and the partner APIs (
|
|
243218
|
+
404: `api.blockrun.ai does not serve this endpoint. Chat, Anthropic-shaped messages, images, speech, video and the partner APIs (Exa, prediction markets, phone lookup) all work on an API key. The wallet-only exceptions are the routes that bind a lease or a position to a payer address \u2014 buying/renewing/releasing phone numbers, and Polymarket trading \u2014 which need a wallet to own the thing being bought. For those, unset BLOCKRUN_API_KEY and run "clawrouter logout".`
|
|
243218
243219
|
};
|
|
243219
243220
|
|
|
243220
243221
|
// src/model-catalog.ts
|
|
@@ -257436,10 +257437,9 @@ var DEFAULT_MODEL_CAPABILITIES = Object.freeze({
|
|
|
257436
257437
|
supportsVision: false
|
|
257437
257438
|
},
|
|
257438
257439
|
"deepseek/deepseek-v4.1-flash": {
|
|
257439
|
-
// supportsTools: not probed — fails closed
|
|
257440
257440
|
contextWindow: 1048576,
|
|
257441
257441
|
maxOutputTokens: 65536,
|
|
257442
|
-
supportsTools:
|
|
257442
|
+
supportsTools: true,
|
|
257443
257443
|
supportsVision: false
|
|
257444
257444
|
},
|
|
257445
257445
|
"google/gemini-2.5-flash": {
|
|
@@ -257502,6 +257502,13 @@ var DEFAULT_MODEL_CAPABILITIES = Object.freeze({
|
|
|
257502
257502
|
supportsTools: true,
|
|
257503
257503
|
supportsVision: true
|
|
257504
257504
|
},
|
|
257505
|
+
"google/gemini-4-argon": {
|
|
257506
|
+
// supportsTools: not probed — fails closed
|
|
257507
|
+
contextWindow: 1048576,
|
|
257508
|
+
maxOutputTokens: 65536,
|
|
257509
|
+
supportsTools: false,
|
|
257510
|
+
supportsVision: true
|
|
257511
|
+
},
|
|
257505
257512
|
"minimax/minimax-m2.7": {
|
|
257506
257513
|
contextWindow: 204800,
|
|
257507
257514
|
maxOutputTokens: 16384,
|
|
@@ -257723,10 +257730,9 @@ var DEFAULT_MODEL_CAPABILITIES = Object.freeze({
|
|
|
257723
257730
|
supportsVision: true
|
|
257724
257731
|
},
|
|
257725
257732
|
"openai/gpt-6.1-sol": {
|
|
257726
|
-
// supportsTools: not probed — fails closed
|
|
257727
257733
|
contextWindow: 105e4,
|
|
257728
257734
|
maxOutputTokens: 128e3,
|
|
257729
|
-
supportsTools:
|
|
257735
|
+
supportsTools: true,
|
|
257730
257736
|
supportsVision: true
|
|
257731
257737
|
},
|
|
257732
257738
|
"openai/o1": {
|
|
@@ -257981,6 +257987,14 @@ var model_profiles_generated_default = {
|
|
|
257981
257987
|
errorRate: 0,
|
|
257982
257988
|
samples: 3
|
|
257983
257989
|
},
|
|
257990
|
+
"deepseek/deepseek-v4.1-flash": {
|
|
257991
|
+
measuredAt: "2026-10-20T18:12:51Z",
|
|
257992
|
+
latencyMs: 2383.5,
|
|
257993
|
+
p95LatencyMs: 2547.8,
|
|
257994
|
+
outputTokensPerSecond: 216.53,
|
|
257995
|
+
errorRate: 0,
|
|
257996
|
+
samples: 3
|
|
257997
|
+
},
|
|
257984
257998
|
"google/gemini-2.5-flash": {
|
|
257985
257999
|
measuredAt: "2026-08-29T16:51:33Z",
|
|
257986
258000
|
latencyMs: 5416.4,
|
|
@@ -258269,6 +258283,14 @@ var model_profiles_generated_default = {
|
|
|
258269
258283
|
errorRate: 0,
|
|
258270
258284
|
samples: 3
|
|
258271
258285
|
},
|
|
258286
|
+
"openai/gpt-6.1-sol": {
|
|
258287
|
+
measuredAt: "2026-10-20T18:12:51Z",
|
|
258288
|
+
latencyMs: 11324,
|
|
258289
|
+
p95LatencyMs: 12747.6,
|
|
258290
|
+
outputTokensPerSecond: 45.11,
|
|
258291
|
+
errorRate: 0,
|
|
258292
|
+
samples: 3
|
|
258293
|
+
},
|
|
258272
258294
|
"openai/o1": {
|
|
258273
258295
|
measuredAt: "2026-08-29T16:51:33Z",
|
|
258274
258296
|
latencyMs: 4324.9,
|
|
@@ -259084,11 +259106,13 @@ var VERIFIED_TOOL_FALLBACKS = [
|
|
|
259084
259106
|
"anthropic/claude-fable-5.1",
|
|
259085
259107
|
"anthropic/claude-opus-5.5",
|
|
259086
259108
|
"anthropic/claude-sonnet-5.5",
|
|
259109
|
+
"deepseek/deepseek-v4.1-flash",
|
|
259087
259110
|
"google/gemini-3.8-flash",
|
|
259088
259111
|
"openai/gpt-5.1",
|
|
259089
259112
|
"openai/gpt-6-astra",
|
|
259090
259113
|
"openai/gpt-6-luna",
|
|
259091
259114
|
"openai/gpt-6-sol",
|
|
259115
|
+
"openai/gpt-6.1-sol",
|
|
259092
259116
|
"xai/grok-4.6",
|
|
259093
259117
|
"xai/grok-4.7",
|
|
259094
259118
|
"xiaomi/mimo-v2.5"
|
|
@@ -265556,8 +265580,7 @@ async function proxyPaidApiRequest(req, res, apiBase, payFetch, getActualPayment
|
|
|
265556
265580
|
const isBlockrunExa = req.url?.startsWith("/v1/exa/") ?? false;
|
|
265557
265581
|
const isModalSandbox = req.url?.startsWith("/v1/modal/") ?? false;
|
|
265558
265582
|
const isPhone = (req.url?.startsWith("/v1/phone/") ?? false) || (req.url?.startsWith("/v1/voice/") ?? false);
|
|
265559
|
-
const
|
|
265560
|
-
const requestLabel = isBlockrunExa ? "BlockRun Exa" : isModalSandbox ? "Modal Sandbox" : isPhone ? "Phone/Voice" : isSurf ? "Surf" : "Partner";
|
|
265583
|
+
const requestLabel = isBlockrunExa ? "BlockRun Exa" : isModalSandbox ? "Modal Sandbox" : isPhone ? "Phone/Voice" : "Partner";
|
|
265561
265584
|
const bodyChunks = [];
|
|
265562
265585
|
for await (const chunk of req) {
|
|
265563
265586
|
bodyChunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
@@ -265628,14 +265651,14 @@ async function proxyPaidApiRequest(req, res, apiBase, payFetch, getActualPayment
|
|
|
265628
265651
|
logUsage({
|
|
265629
265652
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
265630
265653
|
...blockrunRequestId(upstream) ? { requestId: blockrunRequestId(upstream) } : {},
|
|
265631
|
-
model: isBlockrunExa ? "blockrun-exa" : isModalSandbox ? "modal-sandbox" : isPhone ? (req.url ?? "").replace(/^\/v1\//, "").split("?")[0] :
|
|
265632
|
-
tier: isPhone ? "PHONE" :
|
|
265654
|
+
model: isBlockrunExa ? "blockrun-exa" : isModalSandbox ? "modal-sandbox" : isPhone ? (req.url ?? "").replace(/^\/v1\//, "").split("?")[0] : "partner",
|
|
265655
|
+
tier: isPhone ? "PHONE" : "PARTNER",
|
|
265633
265656
|
cost: requestCost,
|
|
265634
265657
|
baselineCost: requestCost,
|
|
265635
265658
|
savings: 0,
|
|
265636
265659
|
latencyMs,
|
|
265637
265660
|
partnerId: (req.url?.split("?")[0] ?? "").replace(/^\/v1\//, "").replace(/\//g, "_") || "unknown",
|
|
265638
|
-
service: isBlockrunExa ? "web_search" : isModalSandbox ? "modal" : isPhone ? "phone" :
|
|
265661
|
+
service: isBlockrunExa ? "web_search" : isModalSandbox ? "modal" : isPhone ? "phone" : "partner"
|
|
265639
265662
|
}).catch(() => {
|
|
265640
265663
|
});
|
|
265641
265664
|
}
|
|
@@ -266910,7 +266933,7 @@ async function startProxy(options) {
|
|
|
266910
266933
|
}
|
|
266911
266934
|
const isVerbatimGatewayPath = req.url === "/v1/messages" || (req.url?.startsWith("/v1/messages?") ?? false) || req.url === "/v1/audio/speech" || (req.url?.startsWith("/v1/audio/speech?") ?? false);
|
|
266912
266935
|
if (isVerbatimGatewayPath || req.url?.match(
|
|
266913
|
-
/^\/v1\/(?:partner|pm|exa|modal|stocks|usstock|crypto|fx|commodity|phone|voice
|
|
266936
|
+
/^\/v1\/(?:partner|pm|exa|modal|stocks|usstock|crypto|fx|commodity|phone|voice)\//
|
|
266914
266937
|
)) {
|
|
266915
266938
|
try {
|
|
266916
266939
|
await proxyPaidApiRequest(
|
|
@@ -266975,7 +266998,7 @@ async function startProxy(options) {
|
|
|
266975
266998
|
res.end(
|
|
266976
266999
|
JSON.stringify({
|
|
266977
267000
|
error: {
|
|
266978
|
-
message: `ClawRouter does not proxy ${req.url}. It serves /v1/chat/completions, /v1/messages, /v1/models, /v1/images/generations, /v1/images/image2image, /v1/videos/generations, /v1/audio/generations, /v1/audio/speech, and the partner prefixes /v1/{partner,pm,exa,modal,stocks,usstock,crypto,fx,commodity,phone,voice
|
|
267001
|
+
message: `ClawRouter does not proxy ${req.url}. It serves /v1/chat/completions, /v1/messages, /v1/models, /v1/images/generations, /v1/images/image2image, /v1/videos/generations, /v1/audio/generations, /v1/audio/speech, and the partner prefixes /v1/{partner,pm,exa,modal,stocks,usstock,crypto,fx,commodity,phone,voice}/. If BlockRun serves this endpoint, call it directly against the gateway.`,
|
|
266979
267002
|
type: "invalid_request_error",
|
|
266980
267003
|
code: "unsupported_endpoint"
|
|
266981
267004
|
}
|
package/dist/router/index.js
CHANGED
|
@@ -671,10 +671,9 @@ var DEFAULT_MODEL_CAPABILITIES = Object.freeze({
|
|
|
671
671
|
supportsVision: false
|
|
672
672
|
},
|
|
673
673
|
"deepseek/deepseek-v4.1-flash": {
|
|
674
|
-
// supportsTools: not probed — fails closed
|
|
675
674
|
contextWindow: 1048576,
|
|
676
675
|
maxOutputTokens: 65536,
|
|
677
|
-
supportsTools:
|
|
676
|
+
supportsTools: true,
|
|
678
677
|
supportsVision: false
|
|
679
678
|
},
|
|
680
679
|
"google/gemini-2.5-flash": {
|
|
@@ -737,6 +736,13 @@ var DEFAULT_MODEL_CAPABILITIES = Object.freeze({
|
|
|
737
736
|
supportsTools: true,
|
|
738
737
|
supportsVision: true
|
|
739
738
|
},
|
|
739
|
+
"google/gemini-4-argon": {
|
|
740
|
+
// supportsTools: not probed — fails closed
|
|
741
|
+
contextWindow: 1048576,
|
|
742
|
+
maxOutputTokens: 65536,
|
|
743
|
+
supportsTools: false,
|
|
744
|
+
supportsVision: true
|
|
745
|
+
},
|
|
740
746
|
"minimax/minimax-m2.7": {
|
|
741
747
|
contextWindow: 204800,
|
|
742
748
|
maxOutputTokens: 16384,
|
|
@@ -958,10 +964,9 @@ var DEFAULT_MODEL_CAPABILITIES = Object.freeze({
|
|
|
958
964
|
supportsVision: true
|
|
959
965
|
},
|
|
960
966
|
"openai/gpt-6.1-sol": {
|
|
961
|
-
// supportsTools: not probed — fails closed
|
|
962
967
|
contextWindow: 105e4,
|
|
963
968
|
maxOutputTokens: 128e3,
|
|
964
|
-
supportsTools:
|
|
969
|
+
supportsTools: true,
|
|
965
970
|
supportsVision: true
|
|
966
971
|
},
|
|
967
972
|
"openai/o1": {
|
|
@@ -1216,6 +1221,14 @@ var model_profiles_generated_default = {
|
|
|
1216
1221
|
errorRate: 0,
|
|
1217
1222
|
samples: 3
|
|
1218
1223
|
},
|
|
1224
|
+
"deepseek/deepseek-v4.1-flash": {
|
|
1225
|
+
measuredAt: "2026-10-20T18:12:51Z",
|
|
1226
|
+
latencyMs: 2383.5,
|
|
1227
|
+
p95LatencyMs: 2547.8,
|
|
1228
|
+
outputTokensPerSecond: 216.53,
|
|
1229
|
+
errorRate: 0,
|
|
1230
|
+
samples: 3
|
|
1231
|
+
},
|
|
1219
1232
|
"google/gemini-2.5-flash": {
|
|
1220
1233
|
measuredAt: "2026-08-29T16:51:33Z",
|
|
1221
1234
|
latencyMs: 5416.4,
|
|
@@ -1504,6 +1517,14 @@ var model_profiles_generated_default = {
|
|
|
1504
1517
|
errorRate: 0,
|
|
1505
1518
|
samples: 3
|
|
1506
1519
|
},
|
|
1520
|
+
"openai/gpt-6.1-sol": {
|
|
1521
|
+
measuredAt: "2026-10-20T18:12:51Z",
|
|
1522
|
+
latencyMs: 11324,
|
|
1523
|
+
p95LatencyMs: 12747.6,
|
|
1524
|
+
outputTokensPerSecond: 45.11,
|
|
1525
|
+
errorRate: 0,
|
|
1526
|
+
samples: 3
|
|
1527
|
+
},
|
|
1507
1528
|
"openai/o1": {
|
|
1508
1529
|
measuredAt: "2026-08-29T16:51:33Z",
|
|
1509
1530
|
latencyMs: 4324.9,
|
|
@@ -2319,11 +2340,13 @@ var VERIFIED_TOOL_FALLBACKS = [
|
|
|
2319
2340
|
"anthropic/claude-fable-5.1",
|
|
2320
2341
|
"anthropic/claude-opus-5.5",
|
|
2321
2342
|
"anthropic/claude-sonnet-5.5",
|
|
2343
|
+
"deepseek/deepseek-v4.1-flash",
|
|
2322
2344
|
"google/gemini-3.8-flash",
|
|
2323
2345
|
"openai/gpt-5.1",
|
|
2324
2346
|
"openai/gpt-6-astra",
|
|
2325
2347
|
"openai/gpt-6-luna",
|
|
2326
2348
|
"openai/gpt-6-sol",
|
|
2349
|
+
"openai/gpt-6.1-sol",
|
|
2327
2350
|
"xai/grok-4.6",
|
|
2328
2351
|
"xai/grok-4.7",
|
|
2329
2352
|
"xiaomi/mimo-v2.5"
|
|
@@ -50,7 +50,7 @@ This is where you're paying for real value:
|
|
|
50
50
|
|
|
51
51
|
## The Solution: ClawRouter
|
|
52
52
|
|
|
53
|
-
[ClawRouter](https://github.com/BlockRunAI/ClawRouter) is an open-source local proxy that sits between your app and <!-- br:models.chatVisible -->
|
|
53
|
+
[ClawRouter](https://github.com/BlockRunAI/ClawRouter) is an open-source local proxy that sits between your app and <!-- br:models.chatVisible -->90<!-- /br:models.chatVisible --> AI models. It saves you money in three ways: **smart routing**, **token optimization**, and **response caching**.
|
|
54
54
|
|
|
55
55
|
```
|
|
56
56
|
┌─────────────┐ ┌──────────────────────────────┐ ┌──────────────────┐
|
|
@@ -31,7 +31,7 @@ This is exactly the problem [ClawRouter](https://github.com/BlockRunAI/ClawRoute
|
|
|
31
31
|
|
|
32
32
|
## ClawRouter: Smart Routing for Agents
|
|
33
33
|
|
|
34
|
-
ClawRouter is an open-source local proxy that sits between your agent and <!-- br:models.chatVisible -->
|
|
34
|
+
ClawRouter is an open-source local proxy that sits between your agent and <!-- br:models.chatVisible -->90<!-- /br:models.chatVisible --> LLM models across 9 providers. It analyzes every request across 15 dimensions and routes it to the cheapest model that can handle it — in under 1ms, entirely locally.
|
|
35
35
|
|
|
36
36
|
```
|
|
37
37
|
Your Agent → ClawRouter (localhost:8402) → Best model for the job
|
|
@@ -74,7 +74,7 @@ Then point your agent at `http://localhost:8402/v1/` with any OpenAI-compatible
|
|
|
74
74
|
|
|
75
75
|
- **No API keys to manage** — wallet-based cryptographic auth
|
|
76
76
|
- **No subscriptions** — pay per request in USDC (Base or Solana)
|
|
77
|
-
- **No vendor lock-in** — <!-- br:models.chatVisible -->
|
|
77
|
+
- **No vendor lock-in** — <!-- br:models.chatVisible -->90<!-- /br:models.chatVisible --> models, switch anytime
|
|
78
78
|
- **You control your wallet** — non-custodial, funds never held by a third party
|
|
79
79
|
- **Budget caps** — set a max spend per session, ClawRouter gracefully downgrades when budget runs low
|
|
80
80
|
- **Token compression** — 7-layer pipeline reduces token costs by 7–40% before they hit any provider
|
|
@@ -222,7 +222,7 @@ OpenRouter doesn't always pass through provider-specific features correctly. Ima
|
|
|
222
222
|
|
|
223
223
|
**Direct provider routing.** ClawRouter routes through BlockRun's API directly to providers — not through a second aggregator. One hop, not two. Provider-specific features work because there's no middleman translating them.
|
|
224
224
|
|
|
225
|
-

|
|
226
226
|
|
|
227
227
|
---
|
|
228
228
|
|
|
@@ -240,7 +240,7 @@ When new models launch, OpenRouter's catalog lags. Users configure a model that
|
|
|
240
240
|
|
|
241
241
|
### How ClawRouter Solves This
|
|
242
242
|
|
|
243
|
-
ClawRouter maintains a curated catalog of <!-- br:models.chatVisible -->
|
|
243
|
+
ClawRouter maintains a curated catalog of <!-- br:models.chatVisible -->90<!-- /br:models.chatVisible --> models across 9 providers (including <!-- br:models.free -->7<!-- /br:models.free --> free models), updated with each release. Delisted models have automatic redirect aliases:
|
|
244
244
|
|
|
245
245
|
```typescript
|
|
246
246
|
// Delisted models redirect automatically
|
|
@@ -268,7 +268,7 @@ No silent drops. No stale catalog. Models are benchmarked for speed, quality, an
|
|
|
268
268
|
| **Rate limits** | Per-key, shared | Per-wallet, independent |
|
|
269
269
|
| **Vision support** | Images sometimes dropped | Auto-detected, vision-only fallback |
|
|
270
270
|
| **Tool calling** | Silent failures with some models | Flag-based filtering, guaranteed support |
|
|
271
|
-
| **Model catalog** | Laggy, silent drops | Curated <!-- br:models.chatVisible -->
|
|
271
|
+
| **Model catalog** | Laggy, silent drops | Curated <!-- br:models.chatVisible -->90<!-- /br:models.chatVisible --> models, redirect aliases |
|
|
272
272
|
| **Budget control** | Monthly invoice | Per-session cap (`maxCostPerRun`) |
|
|
273
273
|
| **Setup** | Create account, paste key | Agent generates wallet, auto-configured |
|
|
274
274
|
| **Average cost** | $25/M tokens (Opus direct) | auto-routed = **<!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->% savings** |
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "blockrun-clawrouter",
|
|
3
3
|
"name": "BlockRun ClawRouter",
|
|
4
|
-
"description": "Smart LLM router \u2014
|
|
4
|
+
"description": "Smart LLM router \u2014 x402 micropayments, 84% cost savings. Phone lookup + AI voice calls (Twilio + Bland.ai).",
|
|
5
5
|
"skills": ["./skills"],
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/clawrouter",
|
|
3
|
-
"version": "0.12.
|
|
4
|
-
"description": "Smart LLM router — save 84% on inference costs.
|
|
3
|
+
"version": "0.12.298",
|
|
4
|
+
"description": "Smart LLM router — save 84% on inference costs. 90 models (7 free). Pay by credit card (API key) or USDC (x402 wallet).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@blockrun/model-catalog": "https://codeload.github.com/BlockRunAI/model-catalog/tar.gz/b95efe2f025c9968742e6479bc9ec71b6a40c0f4",
|
|
119
|
-
"@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/
|
|
119
|
+
"@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/8773a9954b091bd0090acdfec67c75a006c0e156",
|
|
120
120
|
"@eslint/js": "^10.0.1",
|
|
121
121
|
"eslint": "^10.2.0",
|
|
122
122
|
"openclaw": "^2026.7.2-beta.7",
|