This is an x402 micropayment quickstart for AI agents and developers integrating ClawMerchants assets. You'll learn how agents discover assets, inspect free previews, and execute per-access payments using USDC on Base L2 — all without human intervention.
402 Payment Required response with a machine-readable payment request./v1/preview/:assetId to inspect the asset content.X-PAYMENT header.Every ClawMerchants asset endpoint returns HTTP 402 when called without payment. This is the x402 protocol — a machine-readable payment request designed for autonomous agents.
Example: GET https://clawmerchants.com/v1/data/defi-yields-live
HTTP/1.1 402 Payment Required
X-Asset-Preview-URL: https://clawmerchants.com/v1/preview/defi-yields-live
X-Agent-Catalog: https://clawmerchants.com/v1/catalog
{
"x402Version": 1,
"error": "Payment required",
"accepts": [{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "10000",
"resource": "https://clawmerchants.com/v1/data/defi-yields-live",
"description": "Access DeFi Yield Opportunities data",
"mimeType": "application/json",
"payTo": "0x...",
"maxTimeoutSeconds": 300,
"asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
}],
"asset": {
"id": "defi-yields-live",
"name": "DeFi Yield Opportunities",
"description": "Live DeFi yield data across protocols...",
"category": "crypto",
"previewUrl": "https://clawmerchants.com/v1/preview/defi-yields-live",
"guideUrl": "https://clawmerchants.com/learn/how-to-buy"
}
}
The asset object in the 402 body gives agents immediate context: what the asset is, what category it belongs to, and where to find a free preview. The accepts array specifies exactly how much USDC to send, to which address, on which chain.
X-Agent-Catalog header points to /v1/catalog — a machine-readable JSON catalog of all assets. Agents can enumerate the full marketplace from any single 402 response.
Every asset has a free preview endpoint at /v1/preview/:assetId. For live data feeds, preview returns the most recent sample data. For SKILL.md protocols, preview returns the first ~500 characters.
Example: GET https://clawmerchants.com/v1/preview/defi-yields-live
{
"assetId": "defi-yields-live",
"assetType": "data",
"preview": {
"pools": [
{ "protocol": "Aave", "chain": "base", "symbol": "USDC", "apy": 4.21 },
{ "protocol": "Compound", "chain": "base", "symbol": "ETH", "apy": 2.87 }
],
"timestamp": "2026-03-16T07:30:00Z"
},
"previewNote": "Sample data. Full dataset requires payment.",
"priceUsdc": "0.01",
"paymentEndpoint": "https://clawmerchants.com/v1/data/defi-yields-live"
}
For SKILL.md protocols (behavioral instructions for agents), preview returns an excerpt so agents can verify the protocol matches their task before purchasing:
GET https://clawmerchants.com/v1/preview/code-review-skill
{
"assetId": "code-review-skill",
"assetType": "skill",
"preview": "# Code Review Protocol\n\nYou are an expert code reviewer...\n[excerpt — full protocol requires payment]",
"priceUsdc": "0.02",
"paymentEndpoint": "https://clawmerchants.com/v1/data/code-review-skill"
}
8453, RPC https://mainnet.base.org0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913import { withPaymentInterceptor } from 'x402-fetch';
import { createWalletClient, http } from 'viem';
import { base } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const walletClient = createWalletClient({ account, chain: base, transport: http() });
// x402-fetch handles 402 detection, payment signing, and retry automatically
const fetch402 = withPaymentInterceptor(fetch, walletClient);
const response = await fetch402('https://clawmerchants.com/v1/data/defi-yields-live');
const data = await response.json();
// data now contains the full DeFi yield dataset
The x402-fetch interceptor handles the full flow automatically: it detects the 402, reads the accepts array, signs the USDC payment on Base, and resends with the X-PAYMENT header. No manual signing required.
ClawMerchants verifies the payment on-chain before releasing the asset. The platform takes a 5% fee; the remainder goes directly to the asset provider's wallet. The entire flow is non-custodial: ClawMerchants never holds funds.
Explore assets by category or enumerate the full catalog programmatically:
| Category | What's in it | Link |
|---|---|---|
| Agent Skills | SKILL.md behavioral protocols — code review, security audit, testing eval, cost optimization | /browse/agent-skills |
| Crypto | DeFi yield feeds, token anomaly detection | /browse/crypto |
| Developer | GitHub trending repos, Hacker News top stories, MCP tools | /browse/developer |
| Full catalog (JSON) | All assets, all categories, machine-readable | /.well-known/agent-catalog.json |
ClawMerchants — agent-native marketplace — x402 + USDC + Base L2 | Per-access vs one-time skills →