agent402-openclaw 0.4.4 → 0.4.5

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 CHANGED
@@ -2,10 +2,11 @@
2
2
 
3
3
  Part of [Agent402](https://agent402.tools), the open-source paid door for AI agents.
4
4
 
5
- Agent402 as an [OpenClaw](https://openclaw.ai) model provider: auto-routed and
6
- explicit frontier models at a **flat per-call price**, paid **by card** (a prepaid
7
- credits key, no wallet) or in **USDC over x402** from a wallet. The same key and
8
- gateway reach Agent402's 500+ pay-per-call tools.
5
+ Agent402 as an [OpenClaw](https://openclaw.ai) model provider: the auto-routed
6
+ tier at a **flat per-call price** and explicit frontier models **priced per
7
+ request** from the body, paid in **USDC over x402** from a wallet or with a
8
+ prepaid credits key already issued (new credits are not on sale). The same key
9
+ and gateway reach Agent402's 500+ pay-per-call tools.
9
10
 
10
11
  Guide: https://agent402.tools/guides/openclaw-model-provider
11
12
 
@@ -21,8 +22,7 @@ With no credits key and no `AGENT402_WALLET_KEY`, `setup` generates an EVM
21
22
  wallet into `~/.openclaw/agent402/wallet.key` (0600, the only copy, never
22
23
  printed) and prints its address: send it USDC on Base and every call is paid
23
24
  from it over x402. `agent402-openclaw wallet` shows the address and balance;
24
- `--no-wallet` skips the generation. Prefer a card? Buy a pack at
25
- https://agent402.tools/credits and run
25
+ `--no-wallet` skips the generation. Holding a credits key already issued? Run
26
26
  `AGENT402_CREDITS_KEY=a402_... npx agent402-openclaw setup --write` (key by env,
27
27
  or `--credits-key -` on stdin).
28
28
 
@@ -64,7 +64,7 @@ Two ways the wallet can pay a metered call:
64
64
  what the call actually used, so a short answer costs a fraction of the
65
65
  quote. `agent402-openclaw doctor` says which mode the wallet is in.
66
66
 
67
- Card / credits buyers already pay actual usage on metered calls.
67
+ Credits-key buyers already pay actual usage on metered calls.
68
68
 
69
69
  ## Models and pricing
70
70
 
@@ -79,8 +79,9 @@ Either way OpenClaw's per-token cost fields stay zero; the price is per call. A
79
79
  tier's route is priced at its home tier: the 402 quotes that tier's price, and the paid call is served under
80
80
  that tier's caps (the answer says so in `agent402_tier`). The router, grounded and stealth tiers still answer a
81
81
  400 naming the right route; nothing is charged. A client-supplied `Idempotency-Key`
82
- is passed through (an x402 retry with the same key replays the paid answer);
83
- without one, each call is its own payment.
82
+ is passed through: on a credits key, a retry with the same key replays the paid
83
+ answer; on a wallet, each forwarded call signs a fresh payment, which the server
84
+ treats as a new purchase. Without a key, each call is its own payment.
84
85
 
85
86
  The proxy answers native clients on loopback only: requests carrying a browser
86
87
  `Origin` header or a non-loopback `Host` are refused, so a web page cannot spend
@@ -88,7 +89,7 @@ the key.
88
89
 
89
90
  ## Commands
90
91
 
91
- - `agent402-openclaw setup [--credits-key K | --credits-key - (stdin) | AGENT402_CREDITS_KEY env] [--write] [--port N] [--flat]`
92
+ - `agent402-openclaw setup [--credits-key K | --credits-key - (stdin) | AGENT402_CREDITS_KEY env] [--no-wallet] [--write] [--port N] [--flat]`
92
93
  - `agent402-openclaw proxy [--port N] [--upstream URL]`
93
94
  - `agent402-openclaw doctor`
94
95
  - `agent402-openclaw wallet [--rpc URL]` (address + USDC balance of the wallet the proxy pays from)
@@ -102,11 +103,12 @@ Anthropic Messages wires, embeddings, rerank, images, video, speech,
102
103
  transcription, grounded answers with citations, 500+ tools over
103
104
  MCP or HTTP, wallet-keyed memory, finished reports (dossiers, insider flow, 13F,
104
105
  domain audits, token risk, deep research) and monitors, plus routing that buys
105
- from proven external sellers on the agent's behalf.
106
+ from external sellers on the agent's behalf.
106
107
 
107
108
  Why pay here, with every claim linked to its proof: https://agent402.tools/why.
108
109
  Usage is priced under a ceiling quoted before you pay, a failed call is not
109
- charged and the receipt proves it, a keyed retry never pays twice, and uptime and transactions are
110
- published from outside production.
110
+ charged and the receipt proves it, a keyed retry on a credits key is not
111
+ debited twice, and uptime and transactions are published from outside
112
+ production.
111
113
 
112
114
  Zero dependencies. MIT. Maintained by Havok Holdings LLC.
package/cli.js CHANGED
@@ -90,7 +90,7 @@ async function main() {
90
90
  // per-token router that prints a wallet at install; the card path
91
91
  // (credits key) stays available. --no-wallet keeps the old behaviour.
92
92
  if (has("--no-wallet")) {
93
- out(`no payment method yet: buy a pack by card at ${upstream}/credits and rerun with --credits-key a402_..., or set AGENT402_WALLET_KEY`);
93
+ out(`no payment method yet: set AGENT402_WALLET_KEY, rerun without --no-wallet to generate a wallet, or rerun with --credits-key a402_... if you hold a credits key`);
94
94
  } else {
95
95
  const w = await generateWallet();
96
96
  if (w) {
@@ -99,9 +99,9 @@ async function main() {
99
99
  out(` key: ${WALLET_KEY_FILE()} (0600; back it up, it is the only copy)`);
100
100
  out(`fund it with USDC on Base (any amount; a call costs from $0.001), then every call is paid from it over x402.`);
101
101
  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.`);
102
- out(`prefer a card? buy a pack at ${upstream}/credits and rerun with --credits-key a402_...`);
102
+ out(`holding a credits key already issued? rerun with --credits-key a402_... instead`);
103
103
  } else {
104
- out(`no payment method yet: buy a pack by card at ${upstream}/credits and rerun with --credits-key a402_..., or install viem + @x402/fetch + @x402/evm and rerun to generate a wallet`);
104
+ 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`);
105
105
  }
106
106
  }
107
107
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "agent402",
3
3
  "name": "Agent402",
4
- "description": "Agent402 model provider: auto-routed and explicit frontier models at a flat per-call price, paid by card (prepaid credits key) or in USDC over x402. Same key reaches 500+ pay-per-call tools.",
4
+ "description": "Agent402 model provider: an auto-routed tier at a flat per-call price and explicit frontier models priced per request, paid in USDC over x402 or with a prepaid credits key. Same key reaches 500+ pay-per-call tools.",
5
5
  "activation": {
6
6
  "onStartup": true
7
7
  },
@@ -49,7 +49,7 @@
49
49
  "uiHints": {
50
50
  "creditsKey": {
51
51
  "label": "Credits key",
52
- "help": "Buy by card at https://agent402.tools/credits",
52
+ "help": "Issued at https://agent402.tools/credits; that page says whether new keys are on sale",
53
53
  "sensitive": true
54
54
  },
55
55
  "walletKey": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent402-openclaw",
3
- "version": "0.4.4",
4
- "description": "OpenClaw model provider for Agent402: auto-routed and explicit LLM models at a flat per-call price, paid by card (prepaid credits key) or in USDC over x402 through a local proxy. Zero dependencies; x402 wallet payment is an optional peer.",
3
+ "version": "0.4.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 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
@@ -132,7 +132,7 @@ export async function startProxy({ upstream = DEFAULT_UPSTREAM, creditsKey = nul
132
132
  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" } });
133
133
  }
134
134
  if (!paid) {
135
- return json(res, 402, { error: { message: "No payment method configured. Set AGENT402_CREDITS_KEY (buy a pack by card at agent402.tools/credits) or configure an x402 wallet (agent402-openclaw setup --wallet).", type: "payment_required", code: "agent402_unconfigured" }, topup: `${upstream}/credits`, priceUsd: route.priceUsd });
135
+ 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 already issued.", type: "payment_required", code: "agent402_unconfigured" }, topup: `${upstream}/credits`, priceUsd: route.priceUsd });
136
136
  }
137
137
  const outbound = { ...body };
138
138
  if (requested === AUTO_ID) delete outbound.model; else outbound.model = route.id;