Skip to content

Commit 1b54592

Browse files
committed
update content and form
1 parent ae797e7 commit 1b54592

7 files changed

Lines changed: 155 additions & 68 deletions

File tree

docs/ai-agents/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Base gives your AI agent the tools to operate as an independent economic actor:
1212

1313
### High-level flow
1414

15+
Here's how the agent you can build from these guides operates end-to-end — from wallet setup and identity registration to making authenticated, paid API requests using the x402 protocol.
16+
1517
```mermaid
1618
sequenceDiagram
1719
participant Agent

docs/ai-agents/payments/pay-for-services-with-x402.mdx

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,40 @@ Any agent with a funded wallet can pay for any x402-enabled API — no pre-exist
3838

3939
### CDP Agentic Wallet
4040

41-
With the CDP Agentic Wallet skills installed, your agent handles x402 payments automatically:
41+
With the [CDP Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/) skills installed, your agent handles x402 payments automatically:
4242

4343
```bash Terminal
4444
npx skills add coinbase/agentic-wallet-skills
4545
```
4646

47-
Then ask your agent to discover and call a paid service:
47+
**Discover available services** using the [`search-for-service`](https://docs.cdp.coinbase.com/agentic-wallet/skills/search-for-service) skill:
48+
49+
```bash Terminal
50+
npx awal@latest x402 bazaar search "weather forecast"
51+
```
52+
53+
**Call a paid service** using the [`pay-for-service`](https://docs.cdp.coinbase.com/agentic-wallet/skills/pay-for-service) skill:
54+
55+
```bash Terminal
56+
npx awal@latest x402 pay https://example.com/api/weather \
57+
-X POST \
58+
-d '{"query": "New York"}'
59+
```
60+
61+
Or prompt your agent directly:
4862

4963
```text
5064
Find APIs for sentiment analysis
5165
Call that weather API and get the forecast for New York
5266
```
5367

54-
The `search-for-service` and `pay-for-service` skills handle discovery, payment, and retries.
68+
The [`search-for-service`](https://docs.cdp.coinbase.com/agentic-wallet/skills/search-for-service) and [`pay-for-service`](https://docs.cdp.coinbase.com/agentic-wallet/skills/pay-for-service) skills handle discovery, payment, and retries.
5569

5670
[CDP Agentic Wallet skills →](https://docs.cdp.coinbase.com/agentic-wallet/skills)
5771

5872
### Sponge Wallet
5973

60-
Sponge Wallet has a built-in x402 proxy that discovers services and handles payment automatically:
74+
[Sponge Wallet](https://www.paysponge.com) has a built-in x402 proxy that discovers services and handles payment automatically:
6175

6276
**Step 1 — Discover a service:**
6377

@@ -92,19 +106,10 @@ curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
92106
}'
93107
```
94108

95-
Sponge detects the `402`, pays in USDC from your wallet, and returns the API response.
109+
[Sponge Wallet](https://www.paysponge.com) detects the `402`, pays in USDC from your wallet, and returns the API response.
96110

97111
[Sponge Wallet docs →](https://wallet.paysponge.com/skill.md)
98112

99-
## Supported networks and tokens
100-
101-
| Network | Token | Notes |
102-
|---------|-------|-------|
103-
| Base | USDC | Default — lowest fees |
104-
| Base Sepolia | USDC | Testnet |
105-
| Solana | USDC | Via CDP facilitator |
106-
| Polygon | USDC | Via CDP facilitator |
107-
108113
## Error handling and retries
109114

110115
| Status | Meaning | What to do |
@@ -114,8 +119,21 @@ Sponge detects the `402`, pays in USDC from your wallet, and returns the API res
114119
| `408` | Payment timeout | Retry with same or higher payment |
115120
| `429` | Rate limit | Back off and retry after the indicated delay |
116121

117-
The CDP Agentic Wallet `pay-for-service` skill and Sponge Wallet's x402 proxy handle retries automatically. If you're building a custom client, parse the `PAYMENT-REQUIRED` header, construct the signed payload, and retry with the `PAYMENT-SIGNATURE` header.
122+
The [CDP Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/) [`pay-for-service`](https://docs.cdp.coinbase.com/agentic-wallet/skills/pay-for-service) skill and [Sponge Wallet's](https://www.paysponge.com) x402 proxy handle retries automatically. If you're building a custom client, parse the `PAYMENT-REQUIRED` header, construct the signed payload, and retry with the `PAYMENT-SIGNATURE` header.
123+
124+
<Note>
125+
If you're using [Bankr](https://bankr.bot), no setup is required. Just prompt it directly:
126+
127+
```text
128+
Get the current ETH price from a paid data source
129+
Find a weather API and get the forecast for New York
130+
Get the token balances for 0xYourAddress on Base
131+
```
132+
133+
Bankr handles service discovery, payment, and data extraction automatically.
134+
</Note>
118135

136+
## Video Tutorial
119137
<iframe
120138
className="w-full aspect-video rounded-xl"
121139
src="https://www.youtube.com/embed/b5Wx2NAeY2E?si=r1FumIsbGt6nAt29"

docs/ai-agents/quickstart/payments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Then authenticate:
7272
Sign in to my wallet with your@email.com
7373
```
7474

75-
Or use a Sponge Wallet with native x402 support — see [wallet setup](/ai-agents/setup/wallet-setup) for all options.
75+
Or use a [Sponge Wallet](https://www.paysponge.com) with native x402 support — see [wallet setup](/ai-agents/setup/wallet-setup) for all options.
7676

7777
## Make your first x402 payment
7878

docs/ai-agents/quickstart/trading.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ install the bankr skill from https://github.com/BankrBot/skills
6464

6565
Create a dedicated account at [bankr.bot](https://bankr.bot) and generate an API key at [bankr.bot/api](https://bankr.bot/api).
6666

67-
For CDP Agentic Wallet or Sponge Wallet, see [wallet setup](/ai-agents/setup/wallet-setup).
67+
For [CDP Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/) or [Sponge Wallet](https://www.paysponge.com), see [wallet setup](/ai-agents/setup/wallet-setup).
6868

6969
## Execute a swap
7070

docs/ai-agents/setup/agent-registration.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ When your agent calls a service, how does that service know it's really your age
1010

1111
<AgentRegistrationDemo />
1212

13-
<iframe
14-
className="w-full aspect-video rounded-xl"
15-
src="https://www.youtube.com/embed/l387PXGnrgU?si=EM4IKT14ajFoYkNP"
16-
title="Agent identity, verification, and auth"
17-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
18-
allowFullScreen
19-
></iframe>
20-
2113
## Why register?
2214

2315
- **Discoverability** — other agents and services can find your agent by querying the public registry
@@ -171,6 +163,16 @@ if (result.success) {
171163

172164
SIWA ships drop-in middleware for Express, Next.js, Hono, and Fastify. See the [SIWA documentation](https://siwa.id/docs) for framework-specific examples, replay protection, and x402 payment integration.
173165

166+
## Video Tutorial
167+
168+
<iframe
169+
className="w-full aspect-video rounded-xl"
170+
src="https://www.youtube.com/embed/l387PXGnrgU?si=EM4IKT14ajFoYkNP"
171+
title="Agent identity, verification, and auth"
172+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
173+
allowFullScreen
174+
></iframe>
175+
174176
## Related
175177

176178
<CardGroup cols={2}>

docs/ai-agents/trading/data-fetching.mdx

Lines changed: 104 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,138 @@ x402 is well-suited for trading data: your agent pays per call in USDC, with no
1414

1515
- **No API key management** — your agent pays on demand; no credentials to rotate or store securely
1616
- **Pay only for what you use** — no monthly subscription for data you might not always need
17-
- **Works across any wallet** — Sponge Wallet's x402 proxy, CDP Agentic Wallet skills, and `x402-axios` all handle payment automatically
17+
- **Works across any wallet**[Sponge Wallet's](https://www.paysponge.com) x402 proxy, [CDP Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/) skills, and `x402-axios` all handle payment automatically
1818
- **Composable** — your agent can call multiple data providers in the same session, paying each separately
1919

2020
## Discovering x402-compatible endpoints
2121

2222
x402-compatible services publish a discovery document at `/.well-known/x402.json`. You can also browse the Bazaar catalog for a curated list of x402 data providers.
2323

24-
To discover a service with Sponge Wallet:
24+
<Tabs>
25+
<Tab title="CDP Agentic Wallet">
26+
Use the [`search-for-service`](https://docs.cdp.coinbase.com/agentic-wallet/skills/search-for-service) skill to search the x402 Bazaar:
2527

26-
```bash Terminal
27-
curl "https://api.wallet.paysponge.com/api/discover?query=price+feed" \
28-
-H "Authorization: Bearer $SPONGE_API_KEY" \
29-
-H "Sponge-Version: 0.2.1"
30-
```
28+
```bash Terminal
29+
npx awal@latest x402 bazaar search "price feed"
30+
```
31+
32+
To browse all available resources:
33+
34+
```bash Terminal
35+
npx awal@latest x402 bazaar list --network base
36+
```
37+
</Tab>
38+
<Tab title="Sponge Wallet">
39+
```bash Terminal
40+
curl "https://api.wallet.paysponge.com/api/discover?query=price+feed" \
41+
-H "Authorization: Bearer $SPONGE_API_KEY" \
42+
-H "Sponge-Version: 0.2.1"
43+
```
44+
</Tab>
45+
</Tabs>
3146

32-
## Curated x402 data sources
47+
## Example x402 data sources
3348

3449
### CoinGecko — price feeds
3550

3651
CoinGecko provides cryptocurrency price feeds, market cap data, and historical OHLCV via x402-enabled endpoints.
3752

3853
Fetch the current ETH price:
3954

40-
```bash Terminal
41-
curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
42-
-H "Authorization: Bearer $SPONGE_API_KEY" \
43-
-H "Sponge-Version: 0.2.1" \
44-
-H "Content-Type: application/json" \
45-
-d '{
46-
"url": "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd",
47-
"method": "GET",
48-
"preferred_chain": "base"
49-
}'
50-
```
55+
<Tabs>
56+
<Tab title="CDP Agentic Wallet">
57+
Use the [`pay-for-service`](https://docs.cdp.coinbase.com/agentic-wallet/skills/pay-for-service) skill:
58+
59+
```bash Terminal
60+
npx awal@latest x402 pay "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd"
61+
```
62+
</Tab>
63+
<Tab title="Sponge Wallet">
64+
```bash Terminal
65+
curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
66+
-H "Authorization: Bearer $SPONGE_API_KEY" \
67+
-H "Sponge-Version: 0.2.1" \
68+
-H "Content-Type: application/json" \
69+
-d '{
70+
"url": "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd",
71+
"method": "GET",
72+
"preferred_chain": "base"
73+
}'
74+
```
75+
</Tab>
76+
</Tabs>
5177

52-
Or use the CDP Agentic Wallet `pay-for-service` skill:
78+
### Alchemy — onchain data
5379

54-
```text
55-
Get the current ETH price from CoinGecko
56-
```
80+
Alchemy exposes enhanced APIs for onchain data — token balances, NFT metadata, mempool visibility, and decoded transaction history — via their [Agentic Gateway](https://github.com/alchemyplatform/skills/tree/main/skills/agentic-gateway) at `https://x402.alchemy.com`.
5781

58-
### Alchemy — onchain data
82+
<Note>
83+
Alchemy's x402 gateway uses SIWE wallet authentication via their own [`@alchemy/x402`](https://github.com/alchemyplatform/skills/tree/main/skills/agentic-gateway) CLI — not a generic x402 bazaar endpoint. Follow the setup steps below before making requests.
84+
</Note>
5985

60-
Alchemy exposes enhanced APIs for onchain data — token balances, NFT metadata, mempool visibility, and decoded transaction history — via x402-gated endpoints.
86+
**Step 1 — Install and set up a wallet:**
87+
88+
```bash Terminal
89+
npx @alchemy/x402 wallet generate
90+
```
6191

62-
Fetch token balances for a wallet:
92+
**Step 2 — Generate a SIWE auth token:**
6393

6494
```bash Terminal
65-
curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
66-
-H "Authorization: Bearer $SPONGE_API_KEY" \
67-
-H "Sponge-Version: 0.2.1" \
68-
-H "Content-Type: application/json" \
69-
-d '{
70-
"url": "https://base-mainnet.g.alchemy.com/v2/getTokenBalances",
71-
"method": "POST",
72-
"body": { "address": "0xYourAddress" },
73-
"preferred_chain": "base"
74-
}'
95+
npx @alchemy/x402 sign --private-key ./wallet-key.txt > siwe-token.txt
7596
```
7697

77-
### Nansen — wallet analytics
98+
**Step 3 — Fetch token balances on Base:**
99+
100+
<Tabs>
101+
<Tab title="Token balances (JSON-RPC)">
102+
```bash Terminal
103+
TOKEN=$(cat siwe-token.txt)
104+
105+
curl -s -X POST "https://x402.alchemy.com/base-mainnet/v2" \
106+
-H "Content-Type: application/json" \
107+
-H "Authorization: SIWE $TOKEN" \
108+
-d '{
109+
"jsonrpc": "2.0",
110+
"id": 1,
111+
"method": "alchemy_getTokenBalances",
112+
"params": ["0xYourAddress"]
113+
}'
114+
```
115+
</Tab>
116+
<Tab title="Portfolio (multi-chain)">
117+
```bash Terminal
118+
TOKEN=$(cat siwe-token.txt)
119+
120+
curl -s -X POST "https://x402.alchemy.com/data/v1/assets/tokens/by-address" \
121+
-H "Content-Type: application/json" \
122+
-H "Authorization: SIWE $TOKEN" \
123+
-d '{"addresses": ["0xYourAddress"], "withMetadata": true}'
124+
```
125+
</Tab>
126+
<Tab title="Token prices">
127+
```bash Terminal
128+
TOKEN=$(cat siwe-token.txt)
129+
130+
curl -s -G "https://x402.alchemy.com/prices/v1/tokens/by-symbol" \
131+
--data-urlencode "symbols=ETH" \
132+
--data-urlencode "symbols=USDC" \
133+
-H "Authorization: SIWE $TOKEN"
134+
```
135+
</Tab>
136+
</Tabs>
137+
138+
If the gateway returns `402`, handle payment with the CLI and retry:
139+
140+
```bash Terminal
141+
PAYMENT_SIG=$(npx @alchemy/x402 pay --private-key ./wallet-key.txt --payment-required "$PAYMENT_REQUIRED")
142+
```
78143

79-
Nansen provides wallet labeling, smart money flow analysis, and on-chain fund tracking. x402 endpoint availability is expanding — check [nansen.ai](https://nansen.ai) for current endpoint status.
144+
See the full [Alchemy Agentic Gateway skill](https://github.com/alchemyplatform/skills/tree/main/skills/agentic-gateway) for wallet bootstrap, payment handling, and SDK integration.
80145

81146
## Making data calls inside an OpenClaw agent
82147

83-
Install the Sponge Wallet skill or CDP Agentic Wallet skills, then prompt your agent directly:
148+
Install the [Sponge Wallet](https://www.paysponge.com) skill or [CDP Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/) skills, then prompt your agent directly:
84149

85150
```text
86151
Get the current prices of ETH, BTC, and SOL from a paid data source

docs/ai-agents/trading/trade-execution.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ Base offers two structural advantages for trading agents: **Flashblocks** (200ms
1212

1313
## Executing swaps with wallet-native tools
1414

15-
Bankr, CDP Agentic Wallet, and Sponge Wallet all include built-in swap capabilities — no external DEX integration needed.
15+
[Bankr](https://bankr.bot), [CDP Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/), and [Sponge Wallet](https://www.paysponge.com) all include built-in swap capabilities — no external DEX integration needed.
1616

17-
With Bankr:
17+
With [Bankr](https://bankr.bot):
1818

1919
```text
2020
Buy $50 of ETH on Base
2121
Swap 100 USDC for ETH at market price
2222
```
2323

24-
With CDP Agentic Wallet skills:
24+
With [CDP Agentic Wallet](https://docs.cdp.coinbase.com/agentic-wallet/) skills:
2525

2626
```text
2727
Buy $50 of ETH
2828
Trade 0.01 ETH for USDC
2929
```
3030

31-
With Sponge Wallet:
31+
With [Sponge Wallet](https://www.paysponge.com):
3232

3333
```bash Terminal
3434
curl -X POST "https://api.wallet.paysponge.com/api/swap" \

0 commit comments

Comments
 (0)