You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/x402/api-catalog/get-started.md
+35-33Lines changed: 35 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,22 @@
1
1
---
2
2
title: Get Started
3
3
sidebar_label: Get Started
4
-
description: Plug your Agent into the API Catalog in 3 minutes — install the Agent Wallet, then one MCP install to discover and call every service in the catalog.
4
+
description: Plug your Agent into the API Catalog in 3 minutes — install the Agent Wallet, then install the x402 CLI to discover and call every service in the catalog.
5
5
---
6
6
7
-
import Tabs from '@theme/Tabs';
8
-
import TabItem from '@theme/TabItem';
9
-
10
7
# Get Started
11
8
12
-
Two steps and under 3 minutes to plug your Agent into the whole catalog: install the wallet, then do one MCP install. After that, your Agent can discover and call any service in the catalog by name, paying per call on-chain.
9
+
Two steps and under 3 minutes to plug your Agent into the whole catalog: install the wallet, then install the x402 CLI. After that, your Agent can discover and call any service in the catalog, paying per call on-chain.
**Prerequisite**: Node.js (for the wallet) and Python with `pip` (for the CLI).
15
12
16
13
## Step 1: Install the Agent Wallet
17
14
18
15
Run the command below to install a local wallet that manages stablecoins on TRON & BNB Chain. Every paid call your Agent makes from now on is signed locally by this wallet.
19
16
20
17
```bash
21
18
npm i @bankofai/agent-wallet
19
+
agent-wallet --help
22
20
```
23
21
24
22
:::tip No wallet yet?
@@ -29,54 +27,58 @@ Follow the [Agent Wallet Quick Start](../../Agent-Wallet/QuickStart.md) to creat
29
27
Keep only a small amount of stablecoins in the wallet for per-call payments. Never store your main assets in an Agent wallet.
30
28
:::
31
29
32
-
## Step 2: Connect the Catalog to your Agent
33
-
34
-
One MCP install and your Agent immediately sees every service in the catalog and can call them by name — no accounts, no API keys to manage.
30
+
## Step 2: Install the x402 CLI
35
31
36
-
<Tabs>
37
-
<TabItemvalue="claude"label="Claude Code"default>
32
+
One install connects your Agent to the catalog — it discovers and calls every service over x402, paying per call. No accounts, no API keys to manage.
38
33
39
34
```bash
40
-
claude mcp add bankofai -s user -- npx @bankofai/mcp-catalog
35
+
pip install bankofai-x402-cli
36
+
x402-cli --version
41
37
```
42
38
43
-
</TabItem>
44
-
<TabItemvalue="other"label="Other MCP Agents">
45
-
46
-
Also works with OpenAI Codex, Cursor, Continue, and any MCP-compatible Agent: add a server named `bankofai` to its MCP configuration, with the startup command:
39
+
Once installed, your Agent can discover and call services through the CLI. Search by name or keyword to see what's in the catalog:
Once installed, just tell your Agent what you want in plain language — for example, "find a weather API and look up the current weather in Shanghai." The Agent finds the service in the catalog, gets a quote, pays on-chain with the wallet, and brings back the result — discovery, payment, and the call all happen automatically.
56
-
57
-
## Calling from the command line (optional)
58
-
59
-
If you prefer the terminal, `x402-cli` offers the same capabilities: search, inspect, and make paid calls directly.
60
-
61
-
Search by name or keyword to see what's in the catalog:
45
+
Inspect a service's details and available endpoints:
Inspect a service's details and available endpoints:
52
+
Then make a paid call against the target endpoint — quote, payment, and result retrieval in one step. A simple GET endpoint needs nothing more than the URL:
68
53
69
54
```bash
70
-
x402-cli catalog show acme-weather --catalog https://catalog.bankofai.io/api/catalog.json --json
|`--network`| CAIP-2 payment chain, e.g. `tron:mainnet`, `eip155:56`|
75
+
|`--token`| Settlement token, e.g. `USDT`|
76
+
|`--scheme`| Payment scheme — `exact_gasfree` (TRON) or `exact_permit` (EVM) |
77
+
|`--max-amount`| Spend ceiling in USD; the call aborts if the quote exceeds it |
78
+
|`--header` / `--body`| Request headers and body for the upstream call |
79
+
80
+
A service that settles on multiple chains exposes one route per network (`x402Routes`); pick the route — and the matching `--network` / `--scheme` — for the chain you want to pay on.
81
+
80
82
:::tip
81
83
`--catalog` can point to the hosted URL above or to a locally built `dist/catalog.json` for offline debugging.
Copy file name to clipboardExpand all lines: docs/x402/api-catalog/index.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,20 +41,22 @@ Three consumers share the same data:
41
41
42
42
## What's in the catalog
43
43
44
-
The catalog spans AI models, data, compute, web tools, messaging, DeFi, and more. Typical live services:
45
-
46
-
| Service | Category | What it does | Billing |
47
-
|---|---|---|---|
48
-
| LLM Aggregator | AI | OpenAI-compatible API across frontier models from Anthropic, OpenAI, Google, DeepSeek, and more | per token |
49
-
| SunPump · Create Token | DeFi | Launch a Meme token on SunPump — name, symbol, description, image | per launch (stay tuned) |
50
-
| SUN Swap | DeFi | Swap, liquidity, and farming on TRON via the SUN protocol | per call |
51
-
| Wolfram\|Alpha | Compute | Computational engine for math, science, and factual queries | per call |
52
-
| ScreenshotOne | Web Tools | Capture any webpage as a high-quality image | per shot |
53
-
| Textbelt SMS | Messaging | Send SMS to any phone number, no A2P registration | per message |
54
-
| 2Captcha | Web Tools | Solve image, reCAPTCHA, and hCaptcha challenges programmatically | per solve |
44
+
The first live services cover token creation plus DeFi market data and on-chain security — all settling across TRON and BNB Chain, with more being added over time:
45
+
46
+
| Service | What it does | Billing |
47
+
|---|---|---|
48
+
| SunPump Agent Token Launch | Pay with x402, then submit token-launch metadata (name, symbol, description, image) to SunPump — the gateway forwards your request after settlement | From $0.001 / call |
49
+
| DefiLlama Token Price | Current and historical USD price for one or many tokens, price charts, and percent change | Free |
50
+
| DefiLlama DeFi Data | Protocol TVL, fees/revenue, and stablecoin metrics for research and risk screening | Free |
51
+
| DefiLlama Yields / APY | List and compare DeFi pool yields (APY/TVL), plus a pool's historical series | Free |
52
+
| DexScreener DEX Data | Token DEX pairs, price and liquidity; token search; latest new-listing profiles | Free |
53
+
| DIA Token Price | Real-time, multi-source aggregated USD price by symbol or by chain + contract address | Free |
All of the above are in the **Finance** category and available on both TRON and BNB Chain.
55
57
56
58
:::note
57
-
The live service list and statistics (service count, chain count, etc.) are **generated dynamically** from catalog data — treat `/api/catalog.json` as the source of truth; this page hard-codes no numbers.
59
+
The live service list and statistics (service count, chain count, etc.) are **generated dynamically** from catalog data — treat `/api/catalog.json` as the source of truth; this page hard-codes no numbers, and the catalog grows as new services are listed.
Copy file name to clipboardExpand all lines: docs/x402/api-catalog/list-your-service.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,9 +147,10 @@ CI enforces the following rules — go through them before submitting:
147
147
-`version` must be `1`.
148
148
-`fqn` is lowercase letters/digits/hyphens and must match the directory name.
149
149
-`category` must be one of the allowed values (see [reference](./reference.md#allowed-categories)).
150
-
-`chains` needs at least one entry, using CAIP-2 style chain IDs (e.g. `tron:mainnet`, `eip155:56`).
150
+
-`chains` needs at least one entry, using CAIP-2 style chain IDs — mainnets or testnets (e.g. `tron:mainnet`, `tron:nile`, `eip155:56`, `eip155:97`).
151
151
-`isFirstParty`, `isFeatured` (booleans) and `featuredTags` (string array, may be empty `[]`) are **required** — missing any of them fails validation.
152
152
- For every endpoint: `method` must be uppercase, `path` must start with `/`, and `maxPriceUsd` must not be less than `minPriceUsd`.
153
+
-_(Optional)_ An endpoint that settles across multiple chains can add `x402Routes` — one entry per network (`network`, `provider`, `scheme`, `url`). See the [reference](./reference.md#x402routes--multi-network-routing).
153
154
- The service and every endpoint must provide `i18n.zh-CN` translations for `title`, `subtitle`, `description`, and `useCase`.
154
155
-`pay.md` must be submitted together with `catalog.json`; both files are scanned for sensitive data.
155
156
- No keys, private keys, or private network addresses anywhere.
Copy file name to clipboardExpand all lines: docs/x402/api-catalog/reference.md
+56-7Lines changed: 56 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,35 @@ Each service is described in `providers/<fqn>/catalog.json`. Top-level fields:
50
50
|`metered`| boolean | Yes | Metered billing or not |
51
51
|`minPriceUsd`| number | Yes | Minimum price (USD) |
52
52
|`maxPriceUsd`| number | Yes | Maximum price (USD), must not be less than `minPriceUsd`|
53
+
|`x402Routes`| object[]| No | Per-network payment routes (see below) |
54
+
55
+
### x402Routes — multi-network routing
56
+
57
+
An endpoint may serve the same capability across several chains, each settling through its own gateway provider and payment scheme. List those alternatives in `x402Routes`; each route describes one network:
58
+
59
+
| Field | Type | Description |
60
+
|---|---|---|
61
+
|`network`| string | CAIP-2 chain ID this route settles on (e.g. `tron:mainnet`, `eip155:56`) |
62
+
|`provider`| string | The gateway provider `fqn` that handles this network |
|`url`| string | Full gateway URL for this network's route |
65
+
66
+
The build passes this through to outputs as `x402_routes`. When present, callers/agents pick the route matching their intended payment chain; the top-level `url` remains the default route.
67
+
68
+
For example, a token-launch endpoint might expose four routes — TRON Nile, TRON Mainnet, BSC Testnet, BSC Mainnet — each with its own `provider` and `scheme`. To call one, point `x402-cli pay` at the chosen route's `url` and pass the matching `--network` / `--scheme`:
The other routes reuse the same request body, swapping only the route `url`, `--network`, and `--scheme` (TRON routes use `exact_gasfree`; EVM routes use `exact_permit`).
`chains` uses CAIP-2 style chain identifiers. Mainnets and testnets are both recognized:
80
109
81
110
| Chain | ID |
82
111
|---|---|
83
112
| TRON mainnet |`tron:mainnet`|
113
+
| TRON Nile testnet |`tron:nile`|
114
+
| TRON Shasta testnet |`tron:shasta`|
84
115
| BNB Chain (BSC) |`eip155:56`|
116
+
| BNB Smart Chain testnet |`eip155:97`|
117
+
118
+
The build resolves each chain ID into display metadata (`kind` / `label` / `label_zh`) so the frontend doesn't have to parse CAIP-2 itself — see [Frontend display fields](#frontend-display-fields).
85
119
86
120
## Validation and secret scanning
87
121
@@ -120,10 +154,10 @@ Besides the `providers` array, the list endpoint carries dynamic stats — front
120
154
|`chain_count`| Chains covered |
121
155
|`generated_at`| Build time (UTC) |
122
156
|`frontend.featured_fqns`|`fqn` list of featured services |
123
-
|`frontend.categories`| Categories and counts|
124
-
|`frontend.chains`| Chains and counts|
157
+
|`frontend.categories`| Categories in use — each `{ id, label, label_zh, count }`|
158
+
|`frontend.chains`| Chains in use — each `{ id, kind, label, label_zh, count }`|
125
159
126
-
The `providers` array is pre-sorted at build time by **featured first → category → fqn**; frontends can render it as-is.
160
+
The `providers` array is pre-sorted at build time by **featured first → category → fqn**; frontends can render it as-is. Use `frontend.categories` / `frontend.chains` to drive filter UIs — including their `label` / `label_zh` display names — rather than hard-coding category or chain lists.
127
161
128
162
### Derived fields
129
163
@@ -137,11 +171,26 @@ Build outputs add derived fields on top of the raw data and convert everything t
137
171
|`min_price_usd` / `max_price_usd`| The service's price range across all endpoints |
138
172
|`sha`| Content hash of `catalog.json` + `pay.md`, for change detection |
139
173
174
+
### Frontend display fields
175
+
176
+
To save the frontend from parsing raw IDs and picking translations, the build also emits ready-to-render fields on each provider summary and detail:
177
+
178
+
| Field | Description |
179
+
|---|---|
180
+
|`title_zh`| Chinese service name (falls back to `title`) — usable directly as the first header line |
181
+
|`main_title`| Primary title (equals `title`) — second header line |
182
+
|`sub_title`| Subtitle — third header line |
183
+
|`category_meta`|`{ id, label, label_zh }` for the category |
184
+
|`chain_kinds`| De-duplicated friendly chain kinds, e.g. `["tron"]`, `["bnb"]`|
185
+
|`chains_meta`| Per-chain `{ id, kind, label, label_zh }`, so the frontend never parses CAIP-2 |
186
+
187
+
These are additive — the raw `title`, `subtitle`, `category`, `chains`, and `i18n.zh-CN` are still present. A separate frontend-facing contract (`API.md` in the catalog repo) documents the full response shapes and rendering guidance.
188
+
140
189
### Other output structures
141
190
142
-
-**`/api/pay/<fqn>.json`**: payment summary for Agents / CLI. Top level: `version`, `fqn`, `title`, `subtitle`, `description`, `use_case`, `i18n`, `service_url`, `chains`, `sha`; `endpoints[]` keeps only call-relevant fields:`method`, `path`, `url`, `description`, `metered`, `min_price_usd`, `max_price_usd`.
143
-
-**`/api/search-index.json`**: `{ version, generated_at, documents[] }`, each document being a service summary plus each endpoint's `method` / `path` / `title` / `description`.
144
-
-**`/api/categories.json`**: array of categories in use, each `{ id, count }`.
191
+
-**`/api/pay/<fqn>.json`**: payment summary for Agents / CLI. Top level includes `version`, `fqn`, `title`, `title_zh`, `main_title`, `sub_title`, `subtitle`, `description`, `use_case`, `i18n`, `service_url`, `chains`, `chain_kinds`, `chains_meta`, `sha`; `endpoints[]` keeps the call-relevant fields `method`, `path`, `url`, `description`, `metered`, `min_price_usd`, `max_price_usd`, plus `x402_routes` when the endpoint defines multi-network routes.
192
+
-**`/api/search-index.json`**: `{ version, generated_at, documents[] }`, each document being a service summary (with `category_meta` / `chain_kinds` / `chains_meta`) plus each endpoint's `method` / `path` / `title` / `description` (and `x402_routes` when present).
193
+
-**`/api/categories.json`**: array of categories in use, each `{ id, label, label_zh, count }` — a direct export of `frontend.categories`.
145
194
-**`/api/status.json`**: `{ version, generated_at, provider_count, status }`; `status` of `ok` means the build is healthy.
0 commit comments