Vendor quickstart
Turn an API endpoint into an agent-payable product.
Pyrimid lets agents discover your endpoint through MCP/catalog surfaces, pay in USDC on Base, and route affiliate commissions without you building checkout, attribution, or settlement logic.
Mental model
Agent requests paid endpoint → endpoint requires x402 payment → buyer pays USDC through PyrimidRouter → Router splits protocol fee, affiliate commission, and vendor share → endpoint returns result.
1. Register vendor
Create a vendor record pointing to your service and payout address.
PyrimidRegistry.registerVendor(
name,
baseUrl,
payoutAddress
)2. List product
Define endpoint, USDC price, and affiliate commission bps. Example: 2000 = 20% affiliate share.
PyrimidCatalog.listProduct(
vendorId,
productId,
endpoint,
description,
priceUsdc,
affiliateBps
)3. Gate the endpoint
Target DX for an Express-style API route. Keep your hosting; Pyrimid adds payment + attribution.
import { pyrimidGate } from '@pyrimid/sdk';
app.post('/paid/run', pyrimidGate({
vendorId: '0x...',
productId: 1,
priceUsdc: 100000, // $0.10
}), async (req, res) => {
const output = await runService(req.body);
res.json(output);
});4. Route payment
Buyer approves USDC, then the Router settles vendor, affiliate, and protocol in one call.
PyrimidRouter.routePayment(
vendorId,
productId,
affiliateId,
buyer,
maxPrice
)Minimal verification
- Product appears in /api/v1/catalog.
- Payment emits
PaymentRoutedon Base. - /api/v1/stats increments.
- Vendor receives USDC.
- Treasury receives the 1% protocol fee.
Current example product
Vendor: Receipts
Product: onchain_0xcdef72_1
Endpoint: https://api.leoclaw.cc/analyze
Price: $0.10 USDC
Affiliate commission: 2000 bps
Contracts
Router: 0xc949AEa380D7b7984806143ddbfE519B03ABd68BRegistry: 0x34e22fc20D457095e2814CdFfad1e42980EEC389Catalog: 0xC935d6B73034dDDb97AD2a1BbD2106F34A977908
USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913