x402-proxy 0.9.3 → 0.10.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.
@@ -1,18 +1,61 @@
1
1
  {
2
2
  "id": "x402-proxy",
3
- "name": "x402 Proxy",
4
- "description": "x402/MPP payments, Solana wallet, and inference proxying",
3
+ "name": "mpp/x402 Payments Proxy",
4
+ "description": "x402 and MPP payments, wallet tools, and paid inference proxying",
5
5
  "version": "1.0.0",
6
+ "providers": ["surf"],
7
+ "autoEnableWhenConfiguredProviders": ["surf"],
8
+ "skills": ["skills"],
9
+ "contracts": {
10
+ "tools": ["x_wallet", "x_balance", "x_request", "x_payment"]
11
+ },
6
12
  "configSchema": {
7
13
  "type": "object",
14
+ "additionalProperties": false,
8
15
  "properties": {
9
16
  "providers": {
10
17
  "type": "object",
11
- "description": "Provider catalog keyed by name, each with baseUrl and models array"
18
+ "description": "Provider catalog keyed by name. Defaults to the built-in surf provider when omitted.",
19
+ "additionalProperties": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "baseUrl": {
24
+ "type": "string",
25
+ "description": "Gateway base path for this provider, typically under /x402-proxy"
26
+ },
27
+ "upstreamUrl": {
28
+ "type": "string",
29
+ "description": "Upstream inference origin to proxy to"
30
+ },
31
+ "protocol": {
32
+ "type": "string",
33
+ "enum": ["x402", "mpp", "auto"],
34
+ "description": "Payment protocol for this provider. Defaults to mpp."
35
+ },
36
+ "mppSessionBudget": {
37
+ "type": "string",
38
+ "description": "Maximum USDC budget to lock for MPP sessions for this provider (default: 0.5)"
39
+ },
40
+ "models": {
41
+ "type": "array",
42
+ "description": "Static OpenClaw model catalog entries for this provider"
43
+ }
44
+ }
45
+ }
46
+ },
47
+ "protocol": {
48
+ "type": "string",
49
+ "enum": ["x402", "mpp", "auto"],
50
+ "description": "Default payment protocol fallback for providers that do not override it."
51
+ },
52
+ "mppSessionBudget": {
53
+ "type": "string",
54
+ "description": "Default maximum USDC budget to lock for MPP sessions (default: 0.5)"
12
55
  },
13
56
  "keypairPath": {
14
57
  "type": "string",
15
- "description": "Optional path to Solana keypair JSON file (overrides x402-proxy wallet resolution)"
58
+ "description": "Optional path to Solana keypair JSON file (overrides x402-proxy wallet resolution for Solana/x402 surfaces)"
16
59
  },
17
60
  "rpcUrl": {
18
61
  "type": "string",
@@ -24,5 +67,27 @@
24
67
  }
25
68
  },
26
69
  "required": []
70
+ },
71
+ "uiHints": {
72
+ "protocol": {
73
+ "label": "Default protocol",
74
+ "help": "Used only when a provider entry does not set its own protocol."
75
+ },
76
+ "mppSessionBudget": {
77
+ "label": "Default MPP budget",
78
+ "placeholder": "0.5"
79
+ },
80
+ "keypairPath": {
81
+ "label": "Solana keypair path",
82
+ "advanced": true
83
+ },
84
+ "rpcUrl": {
85
+ "label": "Solana RPC URL",
86
+ "advanced": true
87
+ },
88
+ "dashboardUrl": {
89
+ "label": "Dashboard URL",
90
+ "advanced": true
91
+ }
27
92
  }
28
93
  }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { d as saveWalletFile, i as getConfigDirShort, l as loadWalletFile, n as deriveSolanaKeypair, o as getWalletPath, r as generateMnemonic, s as isConfigured, t as deriveEvmKeypair, u as saveConfig } from "./derive-EDXzwKW2.js";
2
+ import { d as saveWalletFile, i as getConfigDirShort, l as loadWalletFile, n as deriveSolanaKeypair, o as getWalletPath, r as generateMnemonic, s as isConfigured, t as deriveEvmKeypair, u as saveConfig } from "./derive-CY0En_Y3.js";
3
3
  import { buildCommand } from "@stricli/core";
4
4
  import pc from "picocolors";
5
5
  import * as prompts from "@clack/prompts";
@@ -143,7 +143,7 @@ async function runSetup(opts) {
143
143
  prompts.log.message(` Solana (USDC): Send USDC to ${pc.cyan(sol.address)}`);
144
144
  prompts.log.message(` Base (USDC): Send USDC to ${pc.cyan(evm.address)}`);
145
145
  prompts.log.step("Try your first request:");
146
- prompts.log.message(` ${pc.cyan("$ npx x402-proxy https://twitter.surf.cascade.fyi/users/cascade_fyi")}`);
146
+ prompts.log.message(` ${pc.cyan(`$ npx x402-proxy -X POST -d '{"ref":"CoinbaseDev"}' https://surf.cascade.fyi/api/v1/twitter/user`)}`);
147
147
  prompts.outro(pc.green("Setup complete!"));
148
148
  }
149
149
  const setupCommand = buildCommand({
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { t as runSetup } from "./setup-DtKrojW1.js";
3
+ export { runSetup };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { a as getHistoryPath, c as loadConfig, i as getConfigDirShort } from "./derive-EDXzwKW2.js";
3
- import { c as resolveWallet, f as formatAmount, g as dim, h as readHistory, m as formatUsdcValue, n as fetchAllBalances, p as formatTxLine, t as balanceLine, u as calcSpend } from "./wallet-CqUc-ZFn.js";
2
+ import { c as resolveWallet, f as formatAmount, g as dim, h as readHistory, m as formatUsdcValue, n as fetchAllBalances, p as formatTxLine, t as balanceLine, u as calcSpend } from "./wallet-DY0t1t16.js";
3
+ import { a as getHistoryPath, c as loadConfig, i as getConfigDirShort } from "./derive-CY0En_Y3.js";
4
4
  import { buildCommand } from "@stricli/core";
5
5
  import pc from "picocolors";
6
6
  //#region src/commands/status.ts
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { t as displayStatus } from "./status-Bp3X6QEg.js";
3
+ export { displayStatus };
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { n as fetchAllBalances } from "./wallet-DY0t1t16.js";
3
+ export { fetchAllBalances };
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { a as getHistoryPath, l as loadWalletFile, n as deriveSolanaKeypair, t as deriveEvmKeypair } from "./derive-EDXzwKW2.js";
2
+ import { a as getHistoryPath, l as loadWalletFile, n as deriveSolanaKeypair, t as deriveEvmKeypair } from "./derive-CY0En_Y3.js";
3
3
  import { dirname } from "node:path";
4
4
  import { buildCommand } from "@stricli/core";
5
5
  import pc from "picocolors";
6
- import { appendFileSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
7
6
  import { x402Client } from "@x402/fetch";
7
+ import { appendFileSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
8
8
  import { ed25519 } from "@noble/curves/ed25519.js";
9
9
  import { base58 } from "@scure/base";
10
10
  import { toClientEvmSigner } from "@x402/evm";
@@ -32,6 +32,9 @@ function error(msg) {
32
32
  function dim(msg) {
33
33
  process.stderr.write(`${isTTY() ? pc.dim(msg) : msg}\n`);
34
34
  }
35
+ function success(msg) {
36
+ process.stderr.write(`${isTTY() ? pc.green(`✓ ${msg}`) : `✓ ${msg}`}\n`);
37
+ }
35
38
  function appendHistory(historyPath, record) {
36
39
  try {
37
40
  mkdirSync(dirname(historyPath), { recursive: true });
@@ -544,4 +547,4 @@ const walletInfoCommand = buildCommand({
544
547
  }
545
548
  });
546
549
  //#endregion
547
- export { error as _, fetchTempoBalances as a, warn as b, resolveWallet as c, displayNetwork as d, formatAmount as f, dim as g, readHistory as h, fetchSolanaBalances as i, appendHistory as l, formatUsdcValue as m, fetchAllBalances as n, walletInfoCommand as o, formatTxLine as p, fetchEvmBalances as r, buildX402Client as s, balanceLine as t, calcSpend as u, info as v, isTTY as y };
550
+ export { error as _, fetchTempoBalances as a, success as b, resolveWallet as c, displayNetwork as d, formatAmount as f, dim as g, readHistory as h, fetchSolanaBalances as i, appendHistory as l, formatUsdcValue as m, fetchAllBalances as n, walletInfoCommand as o, formatTxLine as p, fetchEvmBalances as r, buildX402Client as s, balanceLine as t, calcSpend as u, info as v, warn as x, isTTY as y };
@@ -1,18 +1,61 @@
1
1
  {
2
2
  "id": "x402-proxy",
3
- "name": "x402 Proxy",
4
- "description": "x402/MPP payments, Solana wallet, and inference proxying",
3
+ "name": "mpp/x402 Payments Proxy",
4
+ "description": "x402 and MPP payments, wallet tools, and paid inference proxying",
5
5
  "version": "1.0.0",
6
+ "providers": ["surf"],
7
+ "autoEnableWhenConfiguredProviders": ["surf"],
8
+ "skills": ["skills"],
9
+ "contracts": {
10
+ "tools": ["x_wallet", "x_balance", "x_request", "x_payment"]
11
+ },
6
12
  "configSchema": {
7
13
  "type": "object",
14
+ "additionalProperties": false,
8
15
  "properties": {
9
16
  "providers": {
10
17
  "type": "object",
11
- "description": "Provider catalog keyed by name, each with baseUrl and models array"
18
+ "description": "Provider catalog keyed by name. Defaults to the built-in surf provider when omitted.",
19
+ "additionalProperties": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "baseUrl": {
24
+ "type": "string",
25
+ "description": "Gateway base path for this provider, typically under /x402-proxy"
26
+ },
27
+ "upstreamUrl": {
28
+ "type": "string",
29
+ "description": "Upstream inference origin to proxy to"
30
+ },
31
+ "protocol": {
32
+ "type": "string",
33
+ "enum": ["x402", "mpp", "auto"],
34
+ "description": "Payment protocol for this provider. Defaults to mpp."
35
+ },
36
+ "mppSessionBudget": {
37
+ "type": "string",
38
+ "description": "Maximum USDC budget to lock for MPP sessions for this provider (default: 0.5)"
39
+ },
40
+ "models": {
41
+ "type": "array",
42
+ "description": "Static OpenClaw model catalog entries for this provider"
43
+ }
44
+ }
45
+ }
46
+ },
47
+ "protocol": {
48
+ "type": "string",
49
+ "enum": ["x402", "mpp", "auto"],
50
+ "description": "Default payment protocol fallback for providers that do not override it."
51
+ },
52
+ "mppSessionBudget": {
53
+ "type": "string",
54
+ "description": "Default maximum USDC budget to lock for MPP sessions (default: 0.5)"
12
55
  },
13
56
  "keypairPath": {
14
57
  "type": "string",
15
- "description": "Optional path to Solana keypair JSON file (overrides x402-proxy wallet resolution)"
58
+ "description": "Optional path to Solana keypair JSON file (overrides x402-proxy wallet resolution for Solana/x402 surfaces)"
16
59
  },
17
60
  "rpcUrl": {
18
61
  "type": "string",
@@ -24,5 +67,27 @@
24
67
  }
25
68
  },
26
69
  "required": []
70
+ },
71
+ "uiHints": {
72
+ "protocol": {
73
+ "label": "Default protocol",
74
+ "help": "Used only when a provider entry does not set its own protocol."
75
+ },
76
+ "mppSessionBudget": {
77
+ "label": "Default MPP budget",
78
+ "placeholder": "0.5"
79
+ },
80
+ "keypairPath": {
81
+ "label": "Solana keypair path",
82
+ "advanced": true
83
+ },
84
+ "rpcUrl": {
85
+ "label": "Solana RPC URL",
86
+ "advanced": true
87
+ },
88
+ "dashboardUrl": {
89
+ "label": "Dashboard URL",
90
+ "advanced": true
91
+ }
27
92
  }
28
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x402-proxy",
3
- "version": "0.9.3",
3
+ "version": "0.10.0",
4
4
  "description": "curl for x402 paid APIs. Auto-pays any endpoint on Base, Solana, and Tempo. Also works as an OpenClaw plugin.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -20,7 +20,18 @@
20
20
  "openclaw": {
21
21
  "extensions": [
22
22
  "./dist/openclaw/plugin.js"
23
- ]
23
+ ],
24
+ "providers": [
25
+ "surf"
26
+ ],
27
+ "compat": {
28
+ "pluginApi": ">=2026.3.24",
29
+ "minGatewayVersion": "2026.3.24"
30
+ },
31
+ "build": {
32
+ "openclawVersion": "2026.3.24",
33
+ "pluginSdkVersion": "2026.3.24"
34
+ }
24
35
  },
25
36
  "bin": {
26
37
  "x402-proxy": "./dist/bin/cli.js"
package/skills/SKILL.md CHANGED
@@ -10,7 +10,7 @@ description: Use x402-proxy CLI for consuming and debugging x402 and MPP paid AP
10
10
  ## Quick start
11
11
 
12
12
  ```bash
13
- npx x402-proxy https://twitter.surf.cascade.fyi/users/cascade_fyi
13
+ npx x402-proxy -X POST -d '{"ref":"CoinbaseDev"}' https://surf.cascade.fyi/api/v1/twitter/user
14
14
  ```
15
15
 
16
16
  First run auto-creates a wallet. No setup needed.
@@ -41,6 +41,8 @@ npx x402-proxy https://api.example.com/data > response.json
41
41
 
42
42
  ```
43
43
  x402-proxy <url> # paid HTTP request (default)
44
+ x402-proxy serve # local paid inference proxy server
45
+ x402-proxy claude # run Claude Code through paid local proxy
44
46
  x402-proxy mcp <url> # MCP stdio proxy for AI agents
45
47
  x402-proxy mcp add <name> <url> # install MCP server into AI client
46
48
  x402-proxy setup # wallet onboarding wizard
@@ -165,14 +167,16 @@ stdout = response body, stderr = payment info. Pipes, redirects, and `jq` all wo
165
167
 
166
168
  ## OpenClaw Plugin
167
169
 
168
- x402-proxy ships as an [OpenClaw](https://openclaw.dev) plugin. Install it to give your OpenClaw gateway automatic x402 payment capabilities:
170
+ x402-proxy ships as an [OpenClaw](https://openclaw.dev) plugin for automatic x402 payments, wallet management, and pay-per-use inference proxying. For full installation, provider/model configuration, and troubleshooting, read `references/openclaw-plugin.md`.
169
171
 
170
- - `x_balance` tool - check wallet SOL/USDC balances
171
- - `x_payment` tool - call any x402-enabled endpoint with automatic payment
172
- - `/x_wallet` command - wallet status, send USDC, transaction history
173
- - HTTP route proxy (`/x402/*`) - proxies requests to upstream x402 endpoints with payment
172
+ Quick install:
174
173
 
175
- Configure in your OpenClaw plugin settings with `providers` (upstream x402 endpoints and models) and optionally `keypairPath` or use the standard `X402_PROXY_WALLET_MNEMONIC` env var.
174
+ ```bash
175
+ openclaw plugins install x402-proxy
176
+ npx x402-proxy setup # creates wallet if needed
177
+ ```
178
+
179
+ Registers: `x_wallet` tool, `x_request` tool (aliased as `x_balance`/`x_payment`), `/x_wallet` and `/x_send` commands, `/x402-proxy/*` HTTP route for inference proxying.
176
180
 
177
181
  ## Library API
178
182
 
@@ -0,0 +1,145 @@
1
+ # OpenClaw Plugin Setup
2
+
3
+ x402-proxy ships as an [OpenClaw](https://openclaw.dev) plugin. Gives your gateway automatic x402 and MPP payment, wallet management, and pay-per-use inference proxying via USDC on Solana, Base, and Tempo.
4
+
5
+ ## What it registers
6
+
7
+ - **`x_wallet` tool** (alias: `x_balance`) - check wallet readiness, balances, and spend history for x402 and MPP payments
8
+ - **`x_request` tool** (alias: `x_payment`) - call a paid HTTP endpoint with automatic x402 or MPP settlement (params: `url`, `method`, `params`, `headers`, `protocol`)
9
+ - **`/x_wallet` command** - wallet status dashboard, `history [page]`
10
+ - **`/x_send` command** - send USDC with confirmation step (`/x_send <amount|all> <address>`, then `/x_send confirm`)
11
+ - **HTTP route `/x402-proxy/*`** - proxies requests to upstream inference endpoints with payment, tracks token usage and cost
12
+
13
+ ## Step 1: Install the plugin
14
+
15
+ ```bash
16
+ openclaw plugins install x402-proxy
17
+ ```
18
+
19
+ This downloads from npm, validates `openclaw.plugin.json`, and installs to `~/.openclaw/extensions/x402-proxy/`.
20
+
21
+ ## Step 2: Configure wallet
22
+
23
+ The plugin resolves a Solana wallet using the same cascade as the CLI:
24
+
25
+ 1. `keypairPath` in plugin config (solana-keygen JSON file)
26
+ 2. `X402_PROXY_WALLET_SOLANA_KEY` env var (base58 or JSON array)
27
+ 3. `X402_PROXY_WALLET_MNEMONIC` env var (BIP-39, derives both Solana and EVM)
28
+ 4. `~/.config/x402-proxy/wallet.json` (auto-created by `npx x402-proxy setup`)
29
+
30
+ Easiest path - run setup first, then the plugin picks up the wallet automatically:
31
+
32
+ ```bash
33
+ npx x402-proxy setup
34
+ ```
35
+
36
+ Or set an explicit keypair in plugin config (step 3).
37
+
38
+ ## Step 3: Configure providers and models
39
+
40
+ If you do nothing, the plugin now defaults to:
41
+
42
+ - provider id: `surf`
43
+ - gateway base URL: `/x402-proxy/v1`
44
+ - upstream: `https://surf.cascade.fyi/api/v1/inference`
45
+ - protocol: `mpp`
46
+
47
+ You only need explicit config if you want to override the defaults or supply a custom model catalog.
48
+
49
+ Add the plugin config to your `openclaw.json` (or via `openclaw config edit`):
50
+
51
+ ```json
52
+ {
53
+ "plugins": {
54
+ "entries": {
55
+ "x402-proxy": {
56
+ "config": {
57
+ "providers": {
58
+ "surf-inference": {
59
+ "baseUrl": "/x402-proxy/v1",
60
+ "upstreamUrl": "https://surf.cascade.fyi/api/v1/inference",
61
+ "models": [
62
+ { "id": "anthropic/claude-opus-4.6", "name": "Claude Opus 4.6", "maxTokens": 200000, "reasoning": true, "input": ["text", "image"], "cost": { "input": 0.015, "output": 0.075, "cacheRead": 0.0015, "cacheWrite": 0.01875 }, "contextWindow": 200000 },
63
+ { "id": "anthropic/claude-sonnet-4.6", "name": "Claude Sonnet 4.6", "maxTokens": 200000, "reasoning": true, "input": ["text", "image"], "cost": { "input": 0.003, "output": 0.015, "cacheRead": 0.0003, "cacheWrite": 0.00375 }, "contextWindow": 200000 },
64
+ { "id": "anthropic/claude-opus-4.5", "name": "Claude Opus 4.5", "maxTokens": 200000, "reasoning": true, "input": ["text", "image"], "cost": { "input": 0.015, "output": 0.075, "cacheRead": 0.0015, "cacheWrite": 0.01875 }, "contextWindow": 200000 },
65
+ { "id": "anthropic/claude-sonnet-4.5", "name": "Claude Sonnet 4.5", "maxTokens": 200000, "reasoning": true, "input": ["text", "image"], "cost": { "input": 0.003, "output": 0.015, "cacheRead": 0.0003, "cacheWrite": 0.00375 }, "contextWindow": 200000 },
66
+ { "id": "x-ai/grok-4.20-beta", "name": "Grok 4.20 Beta", "maxTokens": 131072, "reasoning": true, "input": ["text"], "cost": { "input": 0.003, "output": 0.015, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072 },
67
+ { "id": "x-ai/grok-4.20-multi-agent-beta", "name": "Grok 4.20 Multi-Agent", "maxTokens": 131072, "reasoning": true, "input": ["text"], "cost": { "input": 0.003, "output": 0.015, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072 },
68
+ { "id": "x-ai/grok-4.1-fast", "name": "Grok 4.1 Fast", "maxTokens": 131072, "reasoning": false, "input": ["text"], "cost": { "input": 0.001, "output": 0.005, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072 },
69
+ { "id": "x-ai/grok-4.20-beta:online", "name": "Grok 4.20 Beta (Online)", "maxTokens": 131072, "reasoning": true, "input": ["text"], "cost": { "input": 0.005, "output": 0.025, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072 },
70
+ { "id": "x-ai/grok-4.20-multi-agent-beta:online", "name": "Grok 4.20 Multi-Agent (Online)", "maxTokens": 131072, "reasoning": true, "input": ["text"], "cost": { "input": 0.005, "output": 0.025, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072 },
71
+ { "id": "x-ai/grok-4.1-fast:online", "name": "Grok 4.1 Fast (Online)", "maxTokens": 131072, "reasoning": false, "input": ["text"], "cost": { "input": 0.003, "output": 0.015, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072 },
72
+ { "id": "minimax/minimax-m2.7", "name": "MiniMax M2.7", "maxTokens": 1000000, "reasoning": false, "input": ["text"], "cost": { "input": 0.001, "output": 0.005, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 1000000 },
73
+ { "id": "minimax/minimax-m2.5", "name": "MiniMax M2.5", "maxTokens": 1000000, "reasoning": false, "input": ["text"], "cost": { "input": 0.001, "output": 0.005, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 1000000 },
74
+ { "id": "moonshotai/kimi-k2.5", "name": "Kimi K2.5", "maxTokens": 131072, "reasoning": true, "input": ["text"], "cost": { "input": 0.002, "output": 0.008, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 131072 },
75
+ { "id": "z-ai/glm-5", "name": "GLM-5", "maxTokens": 128000, "reasoning": false, "input": ["text"], "cost": { "input": 0.001, "output": 0.005, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 128000 },
76
+ { "id": "qwen/qwen-2.5-7b-instruct", "name": "Qwen 2.5 7B Instruct", "maxTokens": 32768, "reasoning": false, "input": ["text"], "cost": { "input": 0.0003, "output": 0.001, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 32768 }
77
+ ]
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ ### Config fields
88
+
89
+ | Field | Description |
90
+ |-------|-------------|
91
+ | `providers.<name>.baseUrl` | Route path registered in OpenClaw (e.g., `/x402-proxy/v1`) |
92
+ | `providers.<name>.upstreamUrl` | Actual upstream endpoint (e.g., `https://surf.cascade.fyi/api/v1/inference`) |
93
+ | `providers.<name>.models[]` | Model catalog array |
94
+ | `keypairPath` | Optional path to solana-keygen JSON file (overrides wallet resolution) |
95
+ | `rpcUrl` | Solana RPC URL (defaults to mainnet public endpoints with failover) |
96
+ | `dashboardUrl` | URL linked from `/x_wallet` dashboard |
97
+
98
+ ### Model entry fields
99
+
100
+ | Field | Type | Description |
101
+ |-------|------|-------------|
102
+ | `id` | string | Model identifier (e.g., `anthropic/claude-opus-4.6`) |
103
+ | `name` | string | Display name |
104
+ | `maxTokens` | number | Max context length |
105
+ | `reasoning` | boolean | Supports extended thinking |
106
+ | `input` | string[] | Input modalities: `["text"]` or `["text", "image"]` |
107
+ | `cost.input` | number | USDC per 1K input tokens |
108
+ | `cost.output` | number | USDC per 1K output tokens |
109
+ | `cost.cacheRead` | number | USDC per 1K cached read tokens |
110
+ | `cost.cacheWrite` | number | USDC per 1K cache write tokens |
111
+ | `contextWindow` | number | Full context window size |
112
+
113
+ ## Step 4: Restart gateway and verify
114
+
115
+ ```bash
116
+ openclaw gateway restart
117
+ openclaw models # verify models appear
118
+ ```
119
+
120
+ ## How it works
121
+
122
+ 1. Plugin boots, loads wallet via the resolution cascade
123
+ 2. Registers each provider from config into OpenClaw's model catalog (API type: `openai-completions`, no auth required)
124
+ 3. HTTP route `/x402-proxy/*` intercepts inference requests, strips prefix, proxies to `upstreamUrl`
125
+ 4. On 402 response, auto-pays via MPP (Tempo/Base) or x402 (Solana) depending on provider config
126
+ 5. SSE streaming responses are parsed for token usage and logged to `~/.config/x402-proxy/history.jsonl`
127
+ 6. Tools and command are available to all agents on the gateway
128
+
129
+ ## Fetching latest models
130
+
131
+ The model list on `surf.cascade.fyi` changes over time. Fetch the current catalog:
132
+
133
+ ```bash
134
+ npx x402-proxy --protocol mpp --network solana \
135
+ https://surf.cascade.fyi/api/v1/inference/v1/models
136
+ ```
137
+
138
+ Then update the `models` array in your plugin config accordingly.
139
+
140
+ ## Troubleshooting
141
+
142
+ - **Models don't appear in `openclaw models`** - the plugin uses a `catalog` hook (not `models` field). Make sure you're on x402-proxy >= 0.8.5.
143
+ - **"no wallet found" in logs** - run `npx x402-proxy setup` or set `X402_PROXY_WALLET_MNEMONIC` env var before starting the gateway.
144
+ - **402 errors on inference** - check wallet has USDC balance: use `x_wallet` tool or `npx x402-proxy wallet`.
145
+ - **Gateway cold start slow** - normal on small VMs (~72s). The `x402-wallet` service eagerly loads the wallet during boot.
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { t as runSetup } from "./setup-QtTFsCFs.js";
3
- export { runSetup };
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { t as displayStatus } from "./status-BZTToWE_.js";
3
- export { displayStatus };
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { n as fetchAllBalances } from "./wallet-CqUc-ZFn.js";
3
- export { fetchAllBalances };
File without changes