Call these APIs from your agent
Every service here is a standard HTTP endpoint protected by x402. No API keys, no sign-up, no subscription — your agent pays a tiny USDC micro-payment per call on Base and gets the result. Built for autonomous agents and bots.
1. Discover services (machine-readable)
Crawl the catalog for every endpoint, price, and input schema:
GET https://402.com.tr/.well-known/x402 GET https://402.com.tr/api/catalog
2. Call an endpoint with x402
Hit the endpoint, get a 402, pay, and the SDK retries automatically. Example with @x402/fetch:
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY); // holds USDC on Base
const client = new x402Client();
client.register("eip155:8453", new ExactEvmScheme(account));
const fetchWithPay = wrapFetchWithPayment(fetch, client);
// Example: Token Risk Check ($0.02)
const res = await fetchWithPay(
"https://402.com.tr/api/x402/token-risk?address=..."
);
console.log(await res.json());The agent wallet needs only USDC on Base — gas is paid by the facilitator (x402 is gasless for the payer).
3. Use as MCP tools
Drop this minimal MCP server into your agent (Claude Desktop, Cursor, custom) to expose these endpoints as tools your model can call. It pays per call with your wallet:
// x402-bazaar-mcp.mjs — run with: node x402-bazaar-mcp.mjs
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
import { z } from "zod";
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const client = new x402Client().register("eip155:8453", new ExactEvmScheme(account));
const pay = wrapFetchWithPayment(fetch, client);
const server = new McpServer({ name: "x402-bazaar", version: "1.0.0" });
// Auto-register every service from the live catalog as a tool
const catalog = await (await fetch("https://402.com.tr/api/catalog")).json();
for (const s of catalog.services) {
server.tool(s.id.replace(/-/g, "_"), s.description,
Object.fromEntries(Object.keys(s.input).map((k) => [k, z.string()])),
async (args) => {
const url = new URL(s.endpoint);
for (const [k, v] of Object.entries(args)) if (v) url.searchParams.set(k, v);
const r = await pay(url.toString());
return { content: [{ type: "text", text: await r.text() }] };
});
}
await server.connect(new StdioServerTransport());Needs @modelcontextprotocol/sdk, @x402/fetch, @x402/evm, viem, zod. Set AGENT_PRIVATE_KEY to a Base wallet funded with USDC.