x402作者: coinbase

Discover and call paid APIs using the X402 payment protocol with automatic USDC payments on Base. Search a bazaar of paid services by keyword, list all available resources, or inspect an endpoint's price and requirements without paying Make authenticated requests to X402 endpoints with automatic USDC payment in atomic units, supporting GET, POST, PUT, DELETE, and PATCH methods Includes query parameters, custom headers, request body support, and max-amount spending limits to control payment...

npx skills add https://github.com/coinbase/agentic-wallet-skills --skill x402

x402 Payment Protocol

Use the npx [email protected] x402 commands to discover, inspect, and call paid API endpoints using the X402 payment protocol. Payments are made in USDC on Base.

Workflow

The typical x402 workflow is:

  1. Find a service - Search the bazaar or get details for a known endpoint
  2. Check requirements - Inspect price, method, and input schema
  3. Make the request - Call the endpoint with automatic USDC payment

Commands

Search the Bazaar

Find paid services by keyword using CDP's vector search:

npx [email protected] x402 bazaar search <query> [-k <n>] [--network <network>] [--scheme <scheme>] [--max-price <price>] [--json]
OptionDescription
-k, --top <n>Number of results, 1–20 (default: 20)
--network <name>Filter by chain (base, base-sepolia, polygon, solana, solana-devnet)
--scheme <scheme>Filter by payment scheme: exact or upto
--max-price <price>Maximum price in USD (e.g. 0.01)
--asset <address>Filter by payment asset address
--pay-to <address>Filter by recipient wallet address
--extensions <type>Filter by extension type (e.g. outputSchema, bazaar)
--jsonOutput as JSON

List Bazaar Resources

Browse all available resources:

npx [email protected] x402 bazaar list [--network <network>] [--full] [--refresh] [--json]
OptionDescription
--network <name>Filter by chain (base, base-sepolia, polygon, solana, solana-devnet)
--fullShow complete details including schemas
--refreshRe-fetch resource index from CDP API
--jsonOutput as JSON

Discover Payment Requirements

Inspect an endpoint's x402 payment requirements without paying:

npx [email protected] x402 details <url> [--json]

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.

Make a Paid Request

Call an x402 endpoint with automatic USDC payment:

npx [email protected] x402 pay <url> [-X <method>] [-d <json>] [-q <params>] [-h <json>] [--max-amount <n>] [--json]
OptionDescription
-X, --method <method>HTTP method (default: GET)
-d, --data <json>Request body as JSON string
-q, --query <params>Query parameters as JSON string
-h, --headers <json>Custom HTTP headers as JSON string
--max-amount <amount>Max payment in USDC atomic units (1000000 = $1.00)
--correlation-id <id>Group related operations
--jsonOutput as JSON

Examples

# Search for weather-related paid APIs
npx [email protected] x402 bazaar search "weather"

# Search with more results
npx [email protected] x402 bazaar search "sentiment analysis" -k 10

# Check what an endpoint costs
npx [email protected] x402 details https://example.com/api/weather

# Make a GET request (auto-pays)
npx [email protected] x402 pay https://example.com/api/weather

# Make a POST request with body
npx [email protected] x402 pay https://example.com/api/sentiment -X POST -d '{"text": "I love this product"}'

# Limit max payment to $0.10
npx [email protected] x402 pay https://example.com/api/data --max-amount 100000

# Browse all bazaar resources with full details
npx [email protected] x402 bazaar list --full

USDC Amounts

X402 uses USDC atomic units (6 decimals):

Atomic UnitsUSD
1000000$1.00
100000$0.10
50000$0.05
10000$0.01

Prerequisites

Error Handling

  • "Not authenticated" - Run npx [email protected] auth login <email> first
  • "No X402 payment requirements found" - URL may not be an x402 endpoint
  • "CDP API returned 429" - Rate limited; cached data will be used if available
  • "Insufficient balance" - Fund wallet with USDC (npx [email protected] balance to check)

來自 coinbase 的更多技能

authenticate-wallet
by coinbase
Email OTP-based wallet authentication with validation and status checking. Two-step login flow: initiate with email to receive a 6-digit OTP, then verify with the flowId and code to complete authentication Includes input validation rules for email, flowId, and OTP to prevent shell injection before executing commands Provides status checking, balance queries, address retrieval, and wallet window access via companion CLI commands All commands support --json output for machine-readable...
fund
by coinbase
Deposit USDC to wallet via Coinbase Onramp or direct transfer. Opens a companion UI where users select preset amounts ($10, $20, $50) or custom values and choose from Apple Pay, debit card, bank transfer, or Coinbase account funding Supports multiple payment methods with varying settlement times: instant for card and Apple Pay, 1–3 days for ACH bank transfers Deposits funds as USDC on the Base network; alternatively, users can send USDC directly to the wallet address via npx [email protected]...
monetize-service
by coinbase
Deploy a paid API endpoint that other agents can discover and pay for via x402 protocol. Charges USDC per request on Base using HTTP 402 payment protocol; clients pay with signed transactions, no API keys or accounts required Automatically registers endpoints with the x402 Bazaar for agent discovery when you declare discovery extensions Supports multiple pricing tiers, wildcard routes, and multiple payment options per endpoint using Express middleware Built on @x402/express and @x402/core...
pay-for-service
by coinbase
Call paid APIs on Base with automatic USDC payment via x402 protocol. Executes HTTP requests (GET, POST, etc.) to x402-enabled endpoints with atomic USDC payments handled automatically Supports request customization through method, JSON body, query parameters, and custom headers Includes payment controls: set maximum USDC amount per request and group related operations with correlation IDs Requires wallet authentication and sufficient USDC balance; validates all user input to prevent shell...
query-blockchain-data
by coinbase
Query onchain blockchain data on Base using the CDP SQL API via x402. Use when you or your user want to view onchain information about decoded blocks,…
query-onchain-data
by coinbase
Query onchain data on Base using SQL with per-query x402 payments. Access decoded events, transactions, and blocks via CoinbaseQL, a ClickHouse-based SQL dialect supporting joins, CTEs, subqueries, and standard functions Three main tables available: base.events (decoded smart contract logs), base.transactions (full transaction data), and base.blocks (block metadata) Requires filtering on indexed fields ( event_signature , address , block_timestamp ) in event queries to avoid full table...
search-for-service
by coinbase
Search and discover paid API services available on the x402 bazaar marketplace. Query the marketplace using BM25 relevance search, list all available resources, or inspect specific endpoints to see pricing and payment requirements without paying Supports filtering by network (base, base-sepolia) and output formats (human-readable or JSON) Results are cached locally and auto-refresh every 12 hours; no authentication required for any search or discovery operation Use as a fallback when no...
send-usdc
by coinbase
Transfer USDC to Ethereum addresses or ENS names on Base. Accepts both hex addresses (0x...) and ENS names (.eth) as recipients, with automatic ENS resolution Supports flexible amount formats: dollar notation ($5.00), decimal (1.50), or atomic units (1000000) Requires wallet authentication via the authenticate-wallet skill and sufficient USDC balance before sending Includes input validation to prevent shell injection and optional JSON output for programmatic use

NotebookLM 網頁匯入器

一鍵將網頁和 YouTube 影片匯入 NotebookLM。超過 200,000 位使用者信賴。

安裝 Chrome 擴充功能