Skip to content

Commit 164a8f0

Browse files
readme updates
1 parent 699898c commit 164a8f0

3 files changed

Lines changed: 74 additions & 5 deletions

File tree

README.md

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,32 @@
22

33
[![Tests](https://github.com/Primer-Systems/x402/actions/workflows/test.yml/badge.svg)](https://github.com/Primer-Systems/x402/actions/workflows/test.yml)
44

5-
Implementation of the [x402 payment protocol](https://x402.org) for HTTP 402 payments.
5+
Implementation of the [x402 payment protocol](https://x402.org) for HTTP 402 payments. **OpenClaw compatible** 🦞
66

77
## Components
88

9-
- **sdk-typescript/** - TypeScript SDK for payers and payees
10-
- **sdk-python/** - Python SDK for payers and payees
9+
- **sdk-typescript/** - TypeScript SDK for payers and payees ([npm](https://www.npmjs.com/package/@primersystems/x402))
10+
- **sdk-python/** - Python SDK for payers and payees ([pypi](https://pypi.org/project/primer-x402/))
11+
- **openclaw/** - OpenClaw skill for AI agent payments
1112
- **tools/** - CLI tools for testing and token approval
1213
- **Contracts/** - *Prism* smart contract for ERC-20 settlements
1314

14-
## Quick Start
15+
## Quick Start (CLI)
16+
17+
```bash
18+
# Node.js
19+
npx @primersystems/x402 wallet create
20+
npx @primersystems/x402 probe https://api.example.com/paid
21+
npx @primersystems/x402 pay https://api.example.com/paid --dry-run
22+
23+
# Python
24+
pip install primer-x402
25+
x402 wallet create
26+
x402 probe https://api.example.com/paid
27+
x402 pay https://api.example.com/paid --dry-run
28+
```
29+
30+
## Quick Start (Code)
1531

1632
### As a Payer (Client)
1733

@@ -68,6 +84,28 @@ Key v2 features:
6884

6985
**Facilitator:** `https://x402.primer.systems` (Base networks only)
7086

87+
## OpenClaw Integration
88+
89+
Set up x402 payments for your AI agent with one command:
90+
91+
```bash
92+
# Node.js
93+
npx @primersystems/x402 openclaw init
94+
95+
# Python
96+
x402 openclaw init
97+
```
98+
99+
This creates a wallet, configures the network, and installs the x402 skill. See [openclaw/SKILL.md](openclaw/SKILL.md) for the full skill documentation.
100+
101+
## Links
102+
103+
- [x402 Protocol Specification](https://x402.org)
104+
- [Documentation](https://primer.systems/x402)
105+
- [TypeScript SDK](https://www.npmjs.com/package/@primersystems/x402)
106+
- [Python SDK](https://pypi.org/project/primer-x402/)
107+
- [Primer Pay Browser Extension](https://chromewebstore.google.com/detail/primer-pay/bckienhfmjoolgkafljofomegfafanmh)
108+
71109
## License
72110

73-
MIT - Primer Systems
111+
MIT - [Primer Systems](https://primer.systems)

sdk-python/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,38 @@ x402 <command> [options]
219219
| `wallet balance <address>` | Check USDC/ETH balance |
220220
| `wallet from-mnemonic` | Restore wallet from mnemonic |
221221
| `probe <url>` | Check if URL supports x402 |
222+
| `pay <url>` | Make a payment to a 402 endpoint |
223+
| `pay <url> --dry-run` | Preview payment without paying |
222224
| `networks` | List supported networks |
223225
| `facilitator` | Show facilitator info |
224226
| `openclaw init` | Set up x402 for OpenClaw |
225227
| `openclaw status` | Check OpenClaw status |
226228

229+
### Environment Variables
230+
231+
| Variable | Description |
232+
|----------|-------------|
233+
| `X402_PRIVATE_KEY` | Wallet private key |
234+
| `X402_NETWORK` | Default network (default: base) |
235+
| `X402_MAX_AMOUNT` | Default max payment amount |
236+
| `X402_FACILITATOR` | Facilitator URL override |
237+
238+
### Examples
239+
240+
```bash
241+
# Create wallet and save output
242+
x402 wallet create --json > wallet.json
243+
244+
# Check balance on Arbitrum
245+
x402 wallet balance 0x... --network arbitrum
246+
247+
# Preview payment (dry run)
248+
x402 pay https://api.example.com/data --dry-run
249+
250+
# Pay for an API
251+
X402_PRIVATE_KEY=0x... x402 pay https://api.example.com/data --max-amount 0.10
252+
```
253+
227254
## Wallet Utilities
228255

229256
```python

sdk-typescript/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ npx @primersystems/x402 <command> [options]
379379
| `wallet from-mnemonic` | Restore wallet from mnemonic phrase |
380380
| `probe <url>` | Check if URL supports x402 payments |
381381
| `pay <url>` | Make a payment to a 402 endpoint |
382+
| `pay <url> --dry-run` | Preview payment without paying |
382383
| `networks` | List supported networks |
383384
| `facilitator` | Show facilitator info |
384385
| `openclaw init` | Set up x402 for OpenClaw agents |
@@ -402,6 +403,9 @@ npx @primersystems/x402 wallet create --json > wallet.json
402403
# Check balance on Arbitrum
403404
npx @primersystems/x402 wallet balance 0x... --network arbitrum
404405

406+
# Preview payment (dry run)
407+
npx @primersystems/x402 pay https://api.example.com/data --dry-run
408+
405409
# Pay for an API
406410
X402_PRIVATE_KEY=0x... npx @primersystems/x402 pay https://api.example.com/data --max-amount 0.10
407411
```

0 commit comments

Comments
 (0)