@agnic/wallet-skills 1.1.0 → 1.2.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,51 +1,75 @@
1
1
  ---
2
2
  name: check-balance
3
- description: Check USDC balance across networks (Base, Solana)
3
+ description: Check USDC balance across networks. Use when you or the user want to check balance, see how much money is in the wallet, view funds, or check available USDC. Covers phrases like "check my balance", "how much USDC do I have", "what's my balance", "show funds", "wallet balance".
4
4
  user-invocable: true
5
5
  disable-model-invocation: false
6
- allowed-tools: ["Bash(npx agnic@latest *)"]
6
+ allowed-tools: ["Bash(npx agnic@latest status*)", "Bash(npx agnic@latest balance*)"]
7
7
  ---
8
8
 
9
- # Check Balance
9
+ # Checking USDC Balance
10
10
 
11
- Check the user's USDC balance across supported networks.
11
+ Use the `npx agnic@latest balance` command to check USDC balance across supported networks.
12
12
 
13
- ## Steps
13
+ ## Confirm wallet is initialized and authed
14
14
 
15
- 1. Verify authentication:
16
- ```bash
17
- npx agnic@latest status --json
18
- ```
19
- If not authenticated, run `npx agnic@latest auth login` first.
15
+ ```bash
16
+ npx agnic@latest status
17
+ ```
18
+
19
+ If the wallet is not authenticated, refer to the `authenticate-wallet` skill.
20
+
21
+ ## Command Syntax
22
+
23
+ ```bash
24
+ npx agnic@latest balance [--network <network>] [--json]
25
+ ```
26
+
27
+ ## Options
28
+
29
+ | Option | Description |
30
+ | -------------------- | ------------------------------------------ |
31
+ | `--network <name>` | Filter by network (default: all networks) |
32
+ | `--json` | Output result as JSON |
33
+
34
+ ## Supported Networks
35
+
36
+ | Network | Description |
37
+ | -------------- | --------------------- |
38
+ | `base` | Base mainnet (primary) |
39
+ | `base-sepolia` | Base testnet |
40
+ | `solana` | Solana mainnet |
41
+ | `solana-devnet`| Solana devnet |
42
+
43
+ ## Examples
44
+
45
+ ```bash
46
+ # Check balance on all networks
47
+ npx agnic@latest balance
20
48
 
21
- 2. Check balance for all networks:
22
- ```bash
23
- npx agnic@latest balance --json
24
- ```
49
+ # Check balance on Base mainnet only
50
+ npx agnic@latest balance --network base
25
51
 
26
- 3. Or check a specific network:
27
- ```bash
28
- npx agnic@latest balance --network base --json
29
- npx agnic@latest balance --network solana --json
30
- ```
52
+ # Get JSON output
53
+ npx agnic@latest balance --json
54
+ ```
31
55
 
32
56
  ## Expected Output
33
57
 
34
- ```json
35
- [
36
- { "network": "base", "balance": "125.50", "address": "0x..." },
37
- { "network": "solana", "balance": "0", "address": "N/A" }
38
- ]
58
+ ```
59
+ Network Balance Address
60
+ base 125.50 USDC 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7
61
+ base-sepolia 0.00 USDC 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7
62
+ solana 0.00 USDC N/A
63
+ solana-devnet 0.00 USDC N/A
39
64
  ```
40
65
 
41
- ## Supported Networks
66
+ ## Prerequisites
42
67
 
43
- - `base` Base mainnet (EVM, primary)
44
- - `solana` — Solana mainnet
45
- - `base-sepolia` — Base testnet
46
- - `solana-devnet` — Solana devnet
68
+ - Must be authenticated (`npx agnic@latest status` to check)
47
69
 
48
70
  ## Error Handling
49
71
 
50
- - If not authenticated: prompt user to run `npx agnic@latest auth login`
51
- - If a network returns an error, report it and show available balances
72
+ Common errors:
73
+
74
+ - "Not authenticated" — Run `npx agnic@latest auth login` first
75
+ - Network timeout — Try again or specify a single network with `--network base`
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: check-balance
3
+ description: Check USDC balance across networks. Use when the user asks about their balance, funds, or how much they have.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Run `npx agnic balance --json` to get balances across all networks
9
+ 2. If user asks about a specific network, use `npx agnic balance --network <network> --json`
10
+ 3. Present the balance in a clear format with network and amount
11
+
12
+ Supported networks: base, solana, base-sepolia, solana-devnet
13
+
14
+ ## Allowed Tools
15
+ - npx agnic balance
@@ -1,46 +1,79 @@
1
1
  ---
2
2
  name: fund-wallet
3
- description: Get instructions for funding your AgnicPay wallet
3
+ description: Get instructions for funding your AgnicPay wallet with USDC. Use when you or the user want to add funds, deposit USDC, top up the wallet, or need more balance. Covers phrases like "add funds", "deposit", "top up", "fund my wallet", "how do I get USDC", "need more balance".
4
4
  user-invocable: true
5
5
  disable-model-invocation: false
6
- allowed-tools: ["Bash(npx agnic@latest *)"]
6
+ allowed-tools: ["Bash(npx agnic@latest status*)", "Bash(npx agnic@latest address*)", "Bash(npx agnic@latest balance*)"]
7
7
  ---
8
8
 
9
- # Fund Wallet
9
+ # Funding the AgnicPay Wallet
10
10
 
11
- Provide instructions for adding funds to the user's AgnicPay wallet.
11
+ Provide instructions for adding USDC to the user's AgnicPay wallet on Base.
12
12
 
13
- ## Steps
13
+ ## Confirm wallet is initialized and authed
14
14
 
15
- 1. Check if the user is authenticated:
16
- ```bash
17
- npx agnic@latest status --json
18
- ```
15
+ ```bash
16
+ npx agnic@latest status
17
+ ```
19
18
 
20
- 2. Show the user's wallet address:
21
- ```bash
22
- npx agnic@latest address --json
23
- ```
19
+ If the wallet is not authenticated, refer to the `authenticate-wallet` skill.
24
20
 
25
- 3. Explain funding options:
21
+ ## Get Wallet Address
26
22
 
27
- **Option 1: AgnicPay Dashboard**
28
- - Go to [pay.agnic.ai](https://pay.agnic.ai)
29
- - Navigate to your dashboard
30
- - Use the "Add Funds" feature to deposit USDC
23
+ ```bash
24
+ npx agnic@latest address
25
+ ```
31
26
 
32
- **Option 2: Direct Transfer**
33
- - Send USDC to your wallet address on Base network
34
- - The address is shown by `agnic address`
35
- - Use any wallet (MetaMask, Coinbase, etc.) to send USDC on Base
27
+ This displays the user's wallet address on each supported network.
36
28
 
37
- 4. After funding, verify the balance:
38
- ```bash
39
- npx agnic@latest balance --json
40
- ```
29
+ ## Funding Options
30
+
31
+ ### Option 1: AgnicPay Dashboard (Recommended)
32
+
33
+ 1. Go to [pay.agnic.ai](https://pay.agnic.ai)
34
+ 2. Sign in with the same account used in the CLI
35
+ 3. Navigate to the dashboard
36
+ 4. Use the **"Add Funds"** button to deposit USDC via card, bank transfer, or crypto
37
+
38
+ ### Option 2: Direct USDC Transfer
39
+
40
+ Send USDC directly to the wallet address on **Base network**:
41
+
42
+ 1. Get the address: `npx agnic@latest address`
43
+ 2. From any wallet (MetaMask, Coinbase, Phantom, etc.), send USDC on **Base** to that address
44
+ 3. Verify arrival: `npx agnic@latest balance --network base`
45
+
46
+ **Important**: Send USDC on **Base network** only. USDC on other chains (Ethereum mainnet, Arbitrum, etc.) will not appear in the AgnicPay balance.
47
+
48
+ ### Option 3: Bridge from Another Chain
49
+
50
+ If the user has USDC on Ethereum, Arbitrum, or Optimism, they can bridge to Base using:
51
+ - [bridge.base.org](https://bridge.base.org) (official Base bridge)
52
+ - Any cross-chain bridge that supports Base
53
+
54
+ ## Verify Balance
55
+
56
+ After funding, confirm the deposit arrived:
57
+
58
+ ```bash
59
+ npx agnic@latest balance --network base
60
+ ```
41
61
 
42
62
  ## Important Notes
43
63
 
44
- - AgnicPay wallets use USDC (not ETH) for payments and trading
45
- - Base network is the primary chain
46
- - Minimum recommended balance: $1.00 USDC for testing
64
+ - AgnicPay wallets use **USDC** (not ETH) for payments and trading
65
+ - **Base network** is the primary chain
66
+ - Minimum recommended balance: **$1.00 USDC** for testing
67
+ - Small amounts of ETH on Base may be needed for gas (auto-handled in most cases)
68
+
69
+ ## Prerequisites
70
+
71
+ - Must be authenticated (`npx agnic@latest status` to check)
72
+
73
+ ## Error Handling
74
+
75
+ Common errors:
76
+
77
+ - "Not authenticated" — Run `npx agnic@latest auth login` first
78
+ - Balance shows 0 after transfer — Verify the transfer was on Base network (not Ethereum mainnet)
79
+ - Transfer pending — Base transactions typically confirm in 2-3 seconds
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: fund-wallet
3
+ description: Get instructions for funding your AgnicPay wallet. Use when the user needs to add funds, deposit, or top up.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Check current balance: `npx agnic balance --json`
9
+ 2. Show the wallet address: `npx agnic address`
10
+ 3. Provide funding instructions:
11
+ - Visit https://pay.agnic.ai to fund via the dashboard
12
+ - Or send USDC directly to the displayed wallet address on Base or Solana
13
+ 4. After funding, verify with `npx agnic balance --json`
14
+
15
+ ## Allowed Tools
16
+ - npx agnic balance
17
+ - npx agnic address
@@ -1,52 +1,79 @@
1
1
  ---
2
2
  name: get-agent-identity
3
- description: Check your agent's on-chain ERC-8004 identity and trust score
3
+ description: Check your agent's on-chain ERC-8004 identity, trust score, and KYA credentials. Use when you or the user want to see agent identity, check trust score, view KYA credentials, or check agent status. Covers phrases like "what's my agent ID", "check trust score", "show my identity", "agent status", "KYA credentials".
4
4
  user-invocable: true
5
5
  disable-model-invocation: false
6
- allowed-tools: ["Bash(npx agnic@latest *)"]
6
+ allowed-tools: ["Bash(npx agnic@latest status*)", "Bash(npx agnic@latest agent-identity*)"]
7
7
  ---
8
8
 
9
- # Get Agent Identity
9
+ # Getting Agent Identity
10
10
 
11
- Check the user's on-chain ERC-8004 agent identity, trust score, and KYA credentials.
11
+ Check the user's on-chain ERC-8004 agent identity, trust score, and KYA (Know Your Agent) credentials.
12
12
 
13
- ## Steps
13
+ ## Confirm wallet is initialized and authed
14
14
 
15
- 1. Verify authentication:
16
- ```bash
17
- npx agnic@latest status --json
18
- ```
15
+ ```bash
16
+ npx agnic@latest status
17
+ ```
18
+
19
+ If the wallet is not authenticated, refer to the `authenticate-wallet` skill.
20
+
21
+ ## Check Agent Identity
19
22
 
20
- 2. Check agent identity:
21
- ```bash
22
- npx agnic@latest agent-identity --json
23
- ```
24
- Note: If `agent-identity` is not available, use the API directly:
25
- ```bash
26
- npx agnic@latest x402 pay "https://api.agnic.ai/api/agent/identity" --method GET --json
27
- ```
23
+ ```bash
24
+ npx agnic@latest agent-identity --json
25
+ ```
26
+
27
+ This returns the agent's on-chain identity including:
28
+ - **Agent ID** — The ERC-721 token ID on the ERC-8004 Identity Registry
29
+ - **Owner address** The wallet that owns the agent NFT
30
+ - **Trust score** — Reputation score (0-100) based on transaction history
31
+ - **Categories** — Authorized action categories (e.g., payment, general, alcohol)
32
+ - **Status** — Whether the agent is active or suspended
28
33
 
29
34
  ## What is ERC-8004?
30
35
 
31
36
  ERC-8004 ("Trustless Agents") is an Ethereum standard that gives AI agents:
32
- - **On-chain identity** — An NFT representing the agent
33
- - **Reputation score** Trust score based on transaction history
34
- - **Verifiable credentials** KYA (Know Your Agent) credentials for identity verification
37
+
38
+ | Feature | Description |
39
+ | ------- | ----------- |
40
+ | **On-chain identity** | An ERC-721 NFT representing the agent on the Identity Registry |
41
+ | **Reputation score** | Trust score (0-100) based on on-chain transaction history |
42
+ | **KYA credentials** | SD-JWT verifiable credentials for identity verification |
43
+ | **Delegation** | Spending limits and category permissions via KYA delegation credentials |
44
+
45
+ ## Contract Addresses
46
+
47
+ | Contract | Network | Address |
48
+ | -------- | ------- | ------- |
49
+ | Identity Registry | Base Mainnet | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` |
50
+ | Identity Registry | Base Sepolia | `0x8004A818BFB912233c491871b3d84c89A494BD9e` |
51
+ | Reputation | Base Mainnet | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` |
52
+ | Reputation | Base Sepolia | `0x8004B663056A597Dffe9eCcC1965A193B7388713` |
35
53
 
36
54
  ## Expected Output
37
55
 
38
56
  ```json
39
57
  {
40
58
  "agentId": 373,
41
- "ownerAddress": "0x046906b3...",
59
+ "ownerAddress": "0x046906b3cd9d73bf85eb01d795d333b364b75842",
42
60
  "status": "active",
43
- "registeredAt": "2024-12-15T...",
61
+ "registeredAt": "2024-12-15T10:30:00Z",
44
62
  "trustScore": 85,
45
- "categories": ["payment", "general"]
63
+ "categories": ["payment", "general"],
64
+ "hasDelegation": true
46
65
  }
47
66
  ```
48
67
 
68
+ ## Prerequisites
69
+
70
+ - Must be authenticated (`npx agnic@latest status` to check)
71
+ - Agent identity is automatically created during AgnicPay sign-up
72
+
49
73
  ## Error Handling
50
74
 
51
- - If the user doesn't have an agent identity, they can create one via the AgnicPay dashboard
52
- - Agent identity is automatically created during OAuth sign-up
75
+ Common errors:
76
+
77
+ - "Not authenticated" — Run `npx agnic@latest auth login` first
78
+ - "No agent identity found" — The user may not have an agent registered yet; create one via the AgnicPay dashboard at [pay.agnic.ai](https://pay.agnic.ai)
79
+ - "Agent suspended" — The agent's delegation may have been revoked; contact support
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: get-agent-identity
3
+ description: Check agent's on-chain identity, trust score, and KYA credentials. Use when the user asks about agent identity, trust, reputation, or credentials.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Check auth status: `npx agnic status --json`
9
+ 2. If authenticated, show the agent's wallet address and identity info
10
+ 3. Explain what ERC-8004 agent identity provides:
11
+ - On-chain identity (NFT-based)
12
+ - Trust score and reputation
13
+ - KYA (Know Your Agent) credentials for identity verification
14
+ - Delegation credentials for authorized actions
15
+ 4. Direct user to https://pay.agnic.ai for full identity management
16
+
17
+ ## Allowed Tools
18
+ - npx agnic status
19
+ - npx agnic address
@@ -1,67 +1,109 @@
1
1
  ---
2
2
  name: pay-for-service
3
- description: Make paid requests to x402-enabled APIs
3
+ description: Make paid requests to x402-enabled APIs using USDC. Use when you or the user want to call a paid API, make an x402 payment, use a bazaar service, or pay for an API request. Covers phrases like "call this API", "use this service", "pay for the request", "make a paid call", "fetch from x402 endpoint".
4
4
  user-invocable: true
5
5
  disable-model-invocation: false
6
- allowed-tools: ["Bash(npx agnic@latest *)"]
6
+ allowed-tools: ["Bash(npx agnic@latest status*)", "Bash(npx agnic@latest x402 pay *)", "Bash(npx agnic@latest x402 details *)", "Bash(npx agnic@latest balance*)"]
7
7
  ---
8
8
 
9
- # Pay for Service
9
+ # Paying for x402 Services
10
10
 
11
- Make a paid x402 request to an API endpoint. AgnicPay handles the payment automatically.
11
+ Use the `npx agnic@latest x402 pay` command to call x402-enabled API endpoints with automatic USDC payment on Base.
12
12
 
13
- ## Steps
13
+ ## Confirm wallet is initialized and authed
14
14
 
15
- 1. Verify authentication:
16
- ```bash
17
- npx agnic@latest status --json
18
- ```
15
+ ```bash
16
+ npx agnic@latest status
17
+ ```
18
+
19
+ If the wallet is not authenticated, refer to the `authenticate-wallet` skill.
20
+
21
+ ## Command Syntax
22
+
23
+ ```bash
24
+ npx agnic@latest x402 pay <url> [-X <method>] [-d <json>] [-q <params>] [-h <json>] [--max-amount <n>] [--json]
25
+ ```
26
+
27
+ ## Arguments & Options
28
+
29
+ | Option | Description |
30
+ | ----------------------- | -------------------------------------------------- |
31
+ | `<url>` | Full URL of the x402-enabled API endpoint |
32
+ | `-X, --method <method>` | HTTP method (default: GET) |
33
+ | `-d, --data <json>` | Request body as JSON string |
34
+ | `-q, --query <params>` | Query parameters as JSON string |
35
+ | `-h, --headers <json>` | Custom HTTP headers as JSON string |
36
+ | `--max-amount <amount>` | Max payment in USDC atomic units (1000000 = $1.00) |
37
+ | `--correlation-id <id>` | Group related operations |
38
+ | `--json` | Output as JSON |
39
+
40
+ ## USDC Amounts
19
41
 
20
- 2. Check balance to ensure sufficient funds:
42
+ X402 uses USDC atomic units (6 decimals):
43
+
44
+ | Atomic Units | USD |
45
+ | ------------ | ----- |
46
+ | 1000000 | $1.00 |
47
+ | 100000 | $0.10 |
48
+ | 50000 | $0.05 |
49
+ | 10000 | $0.01 |
50
+
51
+ ## Input Validation
52
+
53
+ Before constructing the command, validate:
54
+
55
+ - **url**: Must be a valid HTTPS URL (`^https://[^\s;|&]+$`). Reject URLs containing spaces, semicolons, pipes, or backticks.
56
+ - **method**: Must be one of GET, POST, PUT, DELETE, PATCH (case-insensitive).
57
+ - **data**: Must be valid JSON. Parse it first; reject if parsing fails.
58
+ - **max-amount**: Must be a positive integer (`^\d+$`).
59
+
60
+ Do not pass unvalidated user input into the command.
61
+
62
+ ## Workflow
63
+
64
+ 1. **Check requirements first** (optional but recommended):
21
65
  ```bash
22
- npx agnic@latest balance --network base --json
66
+ npx agnic@latest x402 details <url>
23
67
  ```
68
+ This shows the price, method, and schema without making a payment.
24
69
 
25
- 3. Make the x402 payment request:
70
+ 2. **Verify balance**:
26
71
  ```bash
27
- npx agnic@latest x402 pay "<url>" --json
72
+ npx agnic@latest balance --network base
28
73
  ```
29
74
 
30
- 4. For POST requests with a body:
75
+ 3. **Make the paid request**:
31
76
  ```bash
32
- npx agnic@latest x402 pay "<url>" --method POST --body '{"key": "value"}' --json
77
+ npx agnic@latest x402 pay <url> --json
33
78
  ```
34
79
 
35
- ## Parameters
80
+ ## Examples
36
81
 
37
- - `<url>` — Full URL of the x402-enabled API endpoint
38
- - `--method` HTTP method (default: GET)
39
- - `--body` Request body as JSON string (for POST/PUT)
82
+ ```bash
83
+ # Make a GET request (auto-pays)
84
+ npx agnic@latest x402 pay https://example.com/api/weather
40
85
 
41
- ## Example
86
+ # Make a POST request with body
87
+ npx agnic@latest x402 pay https://example.com/api/sentiment -X POST -d '{"text": "I love this product"}'
42
88
 
43
- ```bash
44
- npx agnic@latest x402 pay "https://api.example.com/analysis" \
45
- --method POST \
46
- --body '{"query": "latest market data"}' \
47
- --json
89
+ # Limit max payment to $0.10
90
+ npx agnic@latest x402 pay https://example.com/api/data --max-amount 100000
91
+
92
+ # Get JSON output
93
+ npx agnic@latest x402 pay https://example.com/api/weather --json
48
94
  ```
49
95
 
50
- ## Expected Output
96
+ ## Prerequisites
51
97
 
52
- ```json
53
- {
54
- "status": 200,
55
- "cost": "0.001",
56
- "network": "base",
57
- "transactionHash": "0xabc123...",
58
- "data": { "result": "..." }
59
- }
60
- ```
98
+ - Must be authenticated (`npx agnic@latest auth login`)
99
+ - Wallet must have sufficient USDC balance on Base
61
100
 
62
101
  ## Error Handling
63
102
 
64
- - If not authenticated: prompt user to run `npx agnic@latest auth login`
65
- - If balance is insufficient, inform the user and suggest funding
66
- - If the API returns an error, show the status code and response body
67
- - The `--body` flag must be valid JSON; if invalid, the CLI will report the parse error
103
+ Common errors:
104
+
105
+ - "Not authenticated" Run `npx agnic@latest auth login` first
106
+ - "Insufficient balance" Fund wallet with USDC (`npx agnic@latest balance` to check)
107
+ - "No X402 payment requirements found" — URL may not be an x402 endpoint
108
+ - Invalid JSON in `--data` — Ensure the body is valid JSON before passing
109
+ - HTTP 4xx/5xx from the API — Show the status code and response body to the user
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: pay-for-service
3
+ description: Make a paid request to an x402-enabled API. Use when the user wants to call, use, or pay for an API service.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Confirm the API URL and HTTP method with the user
9
+ 2. Check balance: `npx agnic balance --network base --json`
10
+ 3. Execute: `npx agnic x402 pay <url> --method <METHOD> --json`
11
+ 4. If the request needs a body, add `--body '{"key":"value"}'`
12
+ 5. Present the API response and cost to the user
13
+
14
+ ## Allowed Tools
15
+ - npx agnic balance
16
+ - npx agnic x402 pay
@@ -1,57 +1,85 @@
1
1
  ---
2
2
  name: search-for-service
3
- description: Search for x402-enabled APIs and services
3
+ description: Search and browse the x402 bazaar marketplace for paid API services. Use when you or the user want to find available services, see what's available, discover APIs, or need an external service to accomplish a task. Also use as a fallback when no other skill clearly matches — search the bazaar to see if a paid service exists. Covers "what can I do?", "find me an API for...", "what services are available?", "search for...", "browse the bazaar".
4
4
  user-invocable: true
5
5
  disable-model-invocation: false
6
- allowed-tools: ["Bash(npx agnic@latest *)"]
6
+ allowed-tools: ["Bash(npx agnic@latest x402 bazaar *)", "Bash(npx agnic@latest x402 details *)"]
7
7
  ---
8
8
 
9
- # Search for Service
9
+ # Searching the x402 Bazaar
10
10
 
11
- Discover x402-enabled APIs that can be paid for using AgnicPay.
11
+ Use the `npx agnic@latest x402` commands to discover and inspect paid API endpoints available on the x402 bazaar marketplace. No authentication or balance is required for searching.
12
12
 
13
- ## Steps
13
+ ## Commands
14
14
 
15
- 1. Search for APIs matching the user's query:
16
- ```bash
17
- npx agnic@latest x402 search "<query>" --json
18
- ```
15
+ ### Search the Bazaar
19
16
 
20
- 2. Optionally filter by category:
21
- ```bash
22
- npx agnic@latest x402 search "<query>" --category AI --json
23
- ```
17
+ Find paid services by keyword using BM25 relevance search:
24
18
 
25
- 3. Present the results to the user with names, descriptions, prices, and URLs.
19
+ ```bash
20
+ npx agnic@latest x402 bazaar search <query> [-k <n>] [--force-refresh] [--json]
21
+ ```
22
+
23
+ | Option | Description |
24
+ | ----------------- | ------------------------------------ |
25
+ | `-k, --top <n>` | Number of results (default: 5) |
26
+ | `--force-refresh` | Re-fetch resource index from CDP API |
27
+ | `--json` | Output as JSON |
28
+
29
+ Results are cached locally at `~/.config/agnic/bazaar/` and auto-refresh after 12 hours.
30
+
31
+ ### List Bazaar Resources
26
32
 
27
- ## Parameters
33
+ Browse all available resources:
28
34
 
29
- - `<query>` — Search term (e.g., "sentiment analysis", "weather data")
30
- - `--category` Filter by category: AI, Crypto, Data, Trading, Finance, Weather
31
- - `--limit <n>` — Max results (default: 10)
35
+ ```bash
36
+ npx agnic@latest x402 bazaar list [--network <network>] [--full] [--json]
37
+ ```
38
+
39
+ | Option | Description |
40
+ | ------------------ | --------------------------------------- |
41
+ | `--network <name>` | Filter by network (base, base-sepolia) |
42
+ | `--full` | Show complete details including schemas |
43
+ | `--json` | Output as JSON |
32
44
 
33
- ## Example
45
+ ### Discover Payment Requirements
46
+
47
+ Inspect an endpoint's x402 payment requirements without paying:
34
48
 
35
49
  ```bash
36
- npx agnic@latest x402 search "sentiment analysis" --category AI --json
50
+ npx agnic@latest x402 details <url> [--json]
37
51
  ```
38
52
 
39
- ## Expected Output
40
-
41
- ```json
42
- {
43
- "apis": [
44
- {
45
- "name": "Sentiment Pro",
46
- "description": "Real-time sentiment analysis",
47
- "price": "0.001",
48
- "url": "https://api.example.com/sentiment"
49
- }
50
- ]
51
- }
53
+ Auto-detects the correct HTTP method (GET, POST, PUT, DELETE, PATCH) by trying each until it gets a 402 response, then displays price, accepted payment schemes, network, and input/output schemas.
54
+
55
+ ## Examples
56
+
57
+ ```bash
58
+ # Search for weather-related paid APIs
59
+ npx agnic@latest x402 bazaar search "weather"
60
+
61
+ # Search with more results
62
+ npx agnic@latest x402 bazaar search "sentiment analysis" -k 10
63
+
64
+ # Browse all bazaar resources with full details
65
+ npx agnic@latest x402 bazaar list --full
66
+
67
+ # Check what an endpoint costs
68
+ npx agnic@latest x402 details https://example.com/api/weather
52
69
  ```
53
70
 
71
+ ## Prerequisites
72
+
73
+ - No authentication needed for search, list, or details commands
74
+
75
+ ## Next Steps
76
+
77
+ Once you've found a service you want to use, use the `pay-for-service` skill to make a paid request to the endpoint.
78
+
54
79
  ## Error Handling
55
80
 
56
- - If no results found, suggest broadening the search or trying different keywords
57
- - Authentication is NOT required for search (it's a public endpoint)
81
+ Common errors:
82
+
83
+ - "CDP API returned 429" — Rate limited; cached data will be used if available
84
+ - "No X402 payment requirements found" — URL may not be an x402 endpoint
85
+ - No results — Try broadening the search query or using different keywords