Sell a Paid MCP/API Call with x402 + Pyrimid
This guide shows a reproducible no-spend flow for exposing a paid MCP/API product through Pyrimid: catalog metadata, HTTP 402 payment requirements, Base USDC settlement metadata, and affiliate-aware retry headers.
Catalog metadata
Query the live catalog: catalog endpoint.
{
"vendor_id": "pyrimid-growth",
"product_id": "mcp-server-audit",
"price_display": "$0.10",
"affiliate_bps": 4000,
"network": "base",
"asset": "USDC",
"endpoint": "https://pyrimid.ai/api/v1/paid/mcp-server-audit?url=https://example.com/mcp"
}
HTTP 402 before payment
curl -i "https://pyrimid.ai/api/v1/paid/mcp-server-audit?url=https://example.com/mcp"
The endpoint returns HTTP 402 with `accepts[]` metadata containing `network`, `asset`, `payTo`, `resource`, `vendorId`, `productId`, and `affiliateBps`.
Retry after payment
curl "https://pyrimid.ai/api/v1/paid/mcp-server-audit?url=https://example.com/mcp" \
-H "X-PAYMENT: <x402-payment-proof>" \
-H "X-Affiliate-ID: qingfeng-pyrimid-guide"
Verification
Run npm run check in the source repo to verify the live catalog and 402 response.