agent402-openclaw 0.5.5 → 0.5.6
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 +5 -3
- package/cli.js +1 -1
- package/package.json +2 -2
- package/proxy.js +2 -2
package/README.md
CHANGED
|
@@ -5,8 +5,10 @@ Part of [Agent402](https://agent402.tools), the open-source paid door for AI age
|
|
|
5
5
|
Agent402 as an [OpenClaw](https://openclaw.ai) model provider: the auto-routed
|
|
6
6
|
tier at a **flat per-call price** and explicit frontier models **priced per
|
|
7
7
|
request** from the body, paid in **USDC over x402** from a wallet or with a
|
|
8
|
-
prepaid credits key
|
|
9
|
-
and gateway reach Agent402's 500+ pay-per-call tools
|
|
8
|
+
prepaid credits key (agent402.tools/credits says whether packs are on sale). The
|
|
9
|
+
same key and gateway reach Agent402's 500+ pay-per-call tools; credits pay
|
|
10
|
+
Agent402's own services, so the routes that buy from an outside seller
|
|
11
|
+
(the route-execute tiers, `seller-payability`, `decide-execute` and the flight routes) need a wallet.
|
|
10
12
|
|
|
11
13
|
Guide: https://agent402.tools/guides/openclaw-model-provider
|
|
12
14
|
|
|
@@ -22,7 +24,7 @@ With no credits key and no `AGENT402_WALLET_KEY`, `setup` generates an EVM
|
|
|
22
24
|
wallet into `~/.openclaw/agent402/wallet.key` (0600, the only copy, never
|
|
23
25
|
printed) and prints its address: send it USDC on Base and every call is paid
|
|
24
26
|
from it over x402. `agent402-openclaw wallet` shows the address and balance;
|
|
25
|
-
`--no-wallet` skips the generation. Holding a credits key
|
|
27
|
+
`--no-wallet` skips the generation. Holding a credits key? Run
|
|
26
28
|
`AGENT402_CREDITS_KEY=a402_... npx agent402-openclaw setup --write` (key by env,
|
|
27
29
|
or `--credits-key -` on stdin).
|
|
28
30
|
|
package/cli.js
CHANGED
|
@@ -100,7 +100,7 @@ async function main() {
|
|
|
100
100
|
out(` key: ${WALLET_KEY_FILE()} (0600; back it up, it is the only copy)`);
|
|
101
101
|
out(`fund it with USDC on Base (any amount; a call costs from $0.001), then every call is paid from it over x402.`);
|
|
102
102
|
out(`optional: \`agent402-openclaw permit2-approve\` once (needs a little ETH on Base for gas) to pay actual usage instead of the per-request quote.`);
|
|
103
|
-
out(`holding a credits key
|
|
103
|
+
out(`holding a credits key? rerun with --credits-key a402_... instead`);
|
|
104
104
|
} else {
|
|
105
105
|
out(`no payment method yet: install viem + @x402/fetch + @x402/evm and rerun to generate a wallet, set AGENT402_WALLET_KEY, or rerun with --credits-key a402_... if you hold a credits key`);
|
|
106
106
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent402-openclaw",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "OpenClaw model provider for Agent402: an auto-routed tier at a flat per-call price and explicit LLM models priced per request, paid in USDC over x402, or with a prepaid credits key
|
|
3
|
+
"version": "0.5.6",
|
|
4
|
+
"description": "OpenClaw model provider for Agent402: an auto-routed tier at a flat per-call price and explicit LLM models priced per request, paid in USDC over x402, or with a prepaid credits key, through a local proxy. Zero dependencies; x402 wallet payment is an optional peer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"exports": {
|
package/proxy.js
CHANGED
|
@@ -243,7 +243,7 @@ export async function startProxy({ upstream = DEFAULT_UPSTREAM, creditsKey = nul
|
|
|
243
243
|
return json(res, 400, { error: { message: `Unknown model "${requested}". Use "auto" or an id from GET /v1/models (${table.size} available).`, type: "invalid_request_error", code: "model_not_found" } });
|
|
244
244
|
}
|
|
245
245
|
if (!paid) {
|
|
246
|
-
return json(res, 402, { error: { message: "No payment method configured. Run `agent402-openclaw setup` to generate an x402 wallet, set AGENT402_WALLET_KEY, or set AGENT402_CREDITS_KEY to a credits key
|
|
246
|
+
return json(res, 402, { error: { message: "No payment method configured. Run `agent402-openclaw setup` to generate an x402 wallet, set AGENT402_WALLET_KEY, or set AGENT402_CREDITS_KEY to a prepaid credits key.", type: "payment_required", code: "agent402_unconfigured" }, topup: `${upstream}/credits`, priceUsd: route.priceUsd });
|
|
247
247
|
}
|
|
248
248
|
const outbound = { ...body };
|
|
249
249
|
if (requested === AUTO_ID) delete outbound.model; else outbound.model = route.id;
|
|
@@ -257,7 +257,7 @@ export async function startProxy({ upstream = DEFAULT_UPSTREAM, creditsKey = nul
|
|
|
257
257
|
return json(res, 400, { type: "error", error: { type: "invalid_request_error", message: "\"model\" is required (any id from GET /v1/models, or a Claude id such as claude-sonnet-5)" } });
|
|
258
258
|
}
|
|
259
259
|
if (!paid) {
|
|
260
|
-
return json(res, 402, { type: "error", error: { type: "payment_required", message: "No payment method configured. Set AGENT402_WALLET_KEY to an EVM key holding USDC on Base (or run `agent402-openclaw setup`), or set AGENT402_CREDITS_KEY to a credits key
|
|
260
|
+
return json(res, 402, { type: "error", error: { type: "payment_required", message: "No payment method configured. Set AGENT402_WALLET_KEY to an EVM key holding USDC on Base (or run `agent402-openclaw setup`), or set AGENT402_CREDITS_KEY to a prepaid credits key." } });
|
|
261
261
|
}
|
|
262
262
|
const outbound = { ...body, model: body.model.trim().replace(/^agent402\//, "") };
|
|
263
263
|
const extra = {};
|