x402 Primitives Catalog
The full-stack pay-per-call API for crypto infrastructure. Every endpoint is x402-native — agents and developers pay USDC per request on Base. No API keys, no accounts, no subscriptions.
// Install the x402 client npm install x402-client // Make a paid API call — payment is automatic import { createClient } from "x402-client"; const client = createClient({ baseUrl: "https://gateway.spraay.app", privateKey: process.env.EVM_PRIVATE_KEY, // Wallet with USDC on Base }); // Fetch live ETH price — pays $0.005 USDC automatically const prices = await client.get("/api/v1/prices"); console.log(prices); // { ETH: 2847.50, ... } // Batch send USDC to 50 wallets — pays $0.02 USDC const tx = await client.post("/api/v1/batch", { token: "USDC", recipients: [{ address: "0x...", amount: "10.00" }, /* ... */] });
Identity & Access
4 endpointsDescription
Initiate KYC/KYB verification for compliance-gated payments.
Request
const result = await client.post( "/api/v1/kyc/verify", {...} );
Description
Check KYC verification status.
Request
const result = await client.get( "/api/v1/kyc/status" );
Description
Create authenticated session with scoped permissions.
Request
const result = await client.post( "/api/v1/auth/session", {...} );
Description
Verify session token and check permissions.
Request
const result = await client.get( "/api/v1/auth/verify" );
Data & Intelligence
8 endpointsDescription
Multi-token price feed.
Request
const result = await client.get( "/api/v1/oracle/prices" );
Description
Gas prices on Base.
Request
const result = await client.get( "/api/v1/oracle/gas" );
Description
Stablecoin FX rates.
Request
const result = await client.get( "/api/v1/oracle/fx" );
Description
Wallet profile.
Request
const result = await client.get( "/api/v1/analytics/wallet" );
Description
Transaction history.
Request
const result = await client.get( "/api/v1/analytics/txhistory" );
Description
Live token prices.
Request
const result = await client.get( "/api/v1/prices" );
Description
Token balances.
Request
const result = await client.get( "/api/v1/balances" );
Description
ENS/Basename resolution.
Request
const result = await client.get( "/api/v1/resolve" );
AI Inference
6 endpointsDescription
AI chat completions via 200+ models.
Request
const result = await client.post( "/api/v1/chat/completions", {...} );
Description
List AI models.
Request
const result = await client.get( "/api/v1/models" );
Description
AI-powered wallet classification with risk scoring.
Request
const result = await client.post( "/api/v1/inference/classify-address", {...} );
Description
AI-powered transaction classification with risk scoring.
Request
const result = await client.post( "/api/v1/inference/classify-tx", {...} );
Description
AI-powered smart contract analysis.
Request
const result = await client.post( "/api/v1/inference/explain-contract", {...} );
Description
AI intelligence briefing for any address or transaction.
Request
const result = await client.post( "/api/v1/inference/summarize", {...} );
Bittensor Drop-in API
4 endpointsOpenAI-compatible inference routed through Bittensor decentralized subnets (SN64 Chutes AI, SN19 Nineteen AI). Drop-in replacement for OpenAI's /v1/* API surface — just change the base URL to https://gateway.spraay.app/bittensor/v1.
Description
List all AI models on Bittensor. OpenAI /v1/models compatible. Drop-in: just change base_url to gateway.spraay.app/bittensor/v1
Request
const result = await client.get( "/bittensor/v1/models" );
Description
Chat completions via Bittensor decentralized AI. Fully OpenAI-compatible. 43+ models (DeepSeek, Qwen, Llama, Mistral). Streaming, function calling, TEE-verified. Drop-in: just change base_url.
Request
const result = await client.post( "/bittensor/v1/chat/completions", {...} );
Description
Image generation via Bittensor Subnet 19 (Nineteen AI). OpenAI /v1/images/generations compatible.
Request
const result = await client.post( "/bittensor/v1/images/generations", {...} );
Description
Text embeddings via Bittensor. OpenAI /v1/embeddings compatible. Use for RAG, semantic search, similarity.
Request
const result = await client.post( "/bittensor/v1/embeddings", {...} );
Communication & Notification
9 endpointsDescription
Send email notification for payment confirmations, alerts, receipts.
Request
const result = await client.post( "/api/v1/notify/email", {...} );
Description
Send SMS notification for payment alerts.
Request
const result = await client.post( "/api/v1/notify/sms", {...} );
Description
Check notification delivery status.
Request
const result = await client.get( "/api/v1/notify/status" );
Description
Register webhook for payment/escrow/swap events.
Request
const result = await client.post( "/api/v1/webhook/register", {...} );
Description
Send test event to a registered webhook.
Request
const result = await client.post( "/api/v1/webhook/test", {...} );
Description
List registered webhooks.
Request
const result = await client.get( "/api/v1/webhook/list" );
Description
Delete a webhook.
Request
const result = await client.post( "/api/v1/webhook/delete", {...} );
Description
Send encrypted XMTP message to any Ethereum address.
Request
const result = await client.post( "/api/v1/xmtp/send", {...} );
Description
Read XMTP inbox for an Ethereum address.
Request
const result = await client.get( "/api/v1/xmtp/inbox" );
Financial Primitives
17 endpointsDescription
Swap quotes via Uniswap V3.
Request
const result = await client.get( "/api/v1/swap/quote" );
Description
Supported swap tokens.
Request
const result = await client.get( "/api/v1/swap/tokens" );
Description
Execute swap via Uniswap V3.
Request
const result = await client.post( "/api/v1/swap/execute", {...} );
Description
Cross-chain bridge quote.
Request
const result = await client.get( "/api/v1/bridge/quote" );
Description
Supported bridge chains.
Request
const result = await client.get( "/api/v1/bridge/chains" );
Description
Execute payroll via Spraay V2.
Request
const result = await client.post( "/api/v1/payroll/execute", {...} );
Description
Estimate payroll costs.
Request
const result = await client.post( "/api/v1/payroll/estimate", {...} );
Description
Payroll stablecoins.
Request
const result = await client.get( "/api/v1/payroll/tokens" );
Description
Create invoice with payment tx.
Request
const result = await client.post( "/api/v1/invoice/create", {...} );
Description
List invoices by address.
Request
const result = await client.get( "/api/v1/invoice/list" );
Description
Invoice lookup.
Request
const result = await client.get( "/api/v1/invoice/:id" );
Description
Create conditional escrow with milestones and expiry.
Request
const result = await client.post( "/api/v1/escrow/create", {...} );
Description
List escrows by address.
Request
const result = await client.get( "/api/v1/escrow/list" );
Description
Escrow status.
Request
const result = await client.get( "/api/v1/escrow/:id" );
Description
Mark escrow as funded. Pass escrowId in body.
Request
const result = await client.post( "/api/v1/escrow/fund", {...} );
Description
Release escrow funds. Returns unsigned transfer tx. Depositor or arbiter only.
Request
const result = await client.post( "/api/v1/escrow/release", {...} );
Description
Cancel escrow.
Request
const result = await client.post( "/api/v1/escrow/cancel", {...} );
Batch Payments
2 endpointsDescription
Batch payments via Spraay.
Request
const result = await client.post( "/api/v1/batch/execute", {...} );
Description
Estimate batch gas.
Request
const result = await client.post( "/api/v1/batch/estimate", {...} );
Infrastructure & DevOps
12 endpointsDescription
Premium multi-chain RPC call via Alchemy/Helius.
Request
const result = await client.post( "/api/v1/rpc/call", {...} );
Description
List supported RPC chains and methods.
Request
const result = await client.get( "/api/v1/rpc/chains" );
Description
Pin content to IPFS or Arweave for permanent storage.
Request
const result = await client.post( "/api/v1/storage/pin", {...} );
Description
Retrieve pinned content by CID.
Request
const result = await client.get( "/api/v1/storage/get" );
Description
Check pin status.
Request
const result = await client.get( "/api/v1/storage/status" );
Description
Create scheduled job for recurring payments, DCA, reminders.
Request
const result = await client.post( "/api/v1/cron/create", {...} );
Description
List scheduled jobs.
Request
const result = await client.get( "/api/v1/cron/list" );
Description
Cancel a scheduled job.
Request
const result = await client.post( "/api/v1/cron/cancel", {...} );
Description
Ingest structured logs for debugging agent workflows.
Request
const result = await client.post( "/api/v1/logs/ingest", {...} );
Description
Query structured logs by service, level, time.
Request
const result = await client.get( "/api/v1/logs/query" );
Description
Record immutable audit trail entry for payments, escrows, compliance.
Request
const result = await client.post( "/api/v1/audit/log", {...} );
Description
Query audit trail by actor, action, resource, time range.
Request
const result = await client.get( "/api/v1/audit/query" );
GPU / Compute
2 endpointsHeavy compute for image generation, video, large LLMs, audio, and utility models via Replicate. For text completions at lower latency and cost, use AI Inference instead.
Description
GPU/Compute — run AI model inference via Replicate (image, video, LLM, audio, utility).
Request
const result = await client.post( "/api/v1/gpu/run", {...} );
Description
GPU/Compute — check prediction status for async jobs.
Request
const result = await client.get( "/api/v1/gpu/status/:id" );
Search / RAG
3 endpointsReal-time web knowledge for agents. Powered by Tavily. Pairs well with AI Inference for RAG pipelines.
Description
Web search with clean, LLM-ready results via Tavily. Basic or advanced depth.
Request
const result = await client.post( "/api/v1/search/web", {...} );
Description
Extract clean content from URLs for RAG pipelines. Up to 5 URLs per request.
Request
const result = await client.post( "/api/v1/search/extract", {...} );
Description
Direct question answering — searches web and synthesizes an answer with sources.
Request
const result = await client.post( "/api/v1/search/qna", {...} );
Robotics / RTP
8 endpointsRobot Task Protocol (RTP) — the open standard for AI agents to discover, commission, and pay for physical robot tasks via x402. Proposed as an x402 extension in #1569.
Description
Dispatch a paid task to an RTP-registered robot. x402 payment held in escrow until completion.
Request
const result = await client.post( "/api/v1/robots/task", {...} );
Description
Discover RTP robots. Filter by capability, chain, price, status.
Request
const result = await client.get( "/api/v1/robots/list" );
Description
Poll RTP task status: PENDING, DISPATCHED, IN_PROGRESS, COMPLETED, FAILED, TIMEOUT.
Request
const result = await client.get( "/api/v1/robots/status" );
Description
Full RTP robot profile: capabilities, pricing, connection type.
Request
const result = await client.get( "/api/v1/robots/profile" );
Description
Register a robot with capabilities, pricing, and connection config. Returns robot_id, rtp_uri, x402_endpoint.
Request
const result = await client.post( "/api/v1/robots/register", {...} );
Description
Robot reports task result — triggers escrow release or refund.
Request
const result = await client.post( "/api/v1/robots/complete", {...} );
Description
Update robot name, capabilities, pricing, or connection config.
Request
const result = await client.patch( "/api/v1/robots/update", {...} );
Description
Remove a robot from the registry — blocked if active tasks exist.
Request
const result = await client.post( "/api/v1/robots/deregister", {...} );
Supply Chain / SCTP
8 endpointsSupply Chain Task Protocol — structured B2B commerce primitives: suppliers, purchase orders, invoices, AI-verified invoicing, and supplier payments. Full x402 payment flow from supplier registration through settled payment, all on Base.
Description
Register a supplier in the SCTP directory.
Request
const result = await client.post( "/api/v1/sctp/supplier", {...} );
Description
Get supplier details by ID.
Request
const result = await client.get( "/api/v1/sctp/supplier/:id" );
Description
Create a purchase order with line items and supplier.
Request
const result = await client.post( "/api/v1/sctp/po", {...} );
Description
Get purchase order details.
Request
const result = await client.get( "/api/v1/sctp/po/:id" );
Description
Submit an invoice linked to a purchase order.
Request
const result = await client.post( "/api/v1/sctp/invoice", {...} );
Description
Get invoice details.
Request
const result = await client.get( "/api/v1/sctp/invoice/:id" );
Description
AI-verify an invoice against its purchase order. Returns match score and flags.
Request
const result = await client.post( "/api/v1/sctp/invoice/verify", {...} );
Description
Execute supplier payment for a verified invoice via batch settlement.
Request
const result = await client.post( "/api/v1/sctp/pay", {...} );
Agent Wallet (ERC-4337)
5 endpointsSmart-contract wallet provisioning for AI agents on Base. Factory-deployed minimal proxies with session keys, spending limits, and time-bound permissions.
Factory: 0xFBD832Db6D9a05A0434cd497707a1bDC43389CfD · Implementation: 0x61818Ae8bC161D1884Fd8823985B80e6733C34E7
Description
Create a smart contract wallet for an AI agent on Base. Returns wallet address and optional encrypted key.
Request
const result = await client.post( "/api/v1/agent-wallet/provision", {...} );
Description
Add a session key with spending limits and time bounds to an agent wallet.
Request
const result = await client.post( "/api/v1/agent-wallet/session-key", {...} );
Description
Get agent wallet info including balance, metadata, and session keys.
Request
const result = await client.get( "/api/v1/agent-wallet/info" );
Description
Revoke a session key immediately.
Request
const result = await client.post( "/api/v1/agent-wallet/revoke-key", {...} );
Description
Predict agent wallet address before deployment.
Request
const result = await client.get( "/api/v1/agent-wallet/predict" );
Wallet Provisioning
6 endpointsMulti-chain agent wallet primitives: list, inspect, sign, and broadcast transactions from agent-owned wallets. Separate from agent-wallet (ERC-4337 smart wallets) — these are standard keyed wallets with server-side signing for rapid prototyping.
Description
List agent wallets with pagination.
Request
const result = await client.get( "/api/v1/wallet/list" );
Description
Get agent wallet details.
Request
const result = await client.get( "/api/v1/wallet/:walletId" );
Description
Get chain-specific addresses for a wallet.
Request
const result = await client.get( "/api/v1/wallet/:walletId/addresses" );
Description
Sign a message with an agent wallet.
Request
const result = await client.post( "/api/v1/wallet/sign-message", {...} );
Description
Sign and broadcast a transaction from an agent wallet.
Request
const result = await client.post( "/api/v1/wallet/send-transaction", {...} );
Description
Create a new agent wallet (keyed, server-side signed).
Request
const result = await client.post( "/api/v1/wallet/create", {...} );
XRP Ledger
3 endpointsDescription
Batch XRP payments on XRP Ledger.
Request
const result = await client.post( "/api/v1/xrp/batch", {...} );
Description
Estimate XRP batch cost.
Request
const result = await client.post( "/api/v1/xrp/estimate", {...} );
Description
XRP Ledger chain info, fee address, and supported features.
Request
const result = await client.get( "/api/v1/xrp/info" );
Stellar
2 endpointsDescription
Batch XLM payments on Stellar.
Request
const result = await client.post( "/api/v1/stellar/batch", {...} );
Description
Estimate Stellar batch cost.
Request
const result = await client.post( "/api/v1/stellar/estimate", {...} );
Compliance & Tax
2 endpointsDescription
Calculate crypto tax gain/loss using FIFO method.
Request
const result = await client.post( "/api/v1/tax/calculate", {...} );
Description
Retrieve tax report with IRS 8949-compatible data.
Request
const result = await client.get( "/api/v1/tax/report" );
Connect via
MCP Server
60 tools for Claude Desktop, Cursor, Cline. Install from Smithery.
Coinbase AgentKit
Batch send action for any AgentKit-powered AI agent. PR #944.
Direct x402 Gateway
Hit endpoints directly with any x402 client. USDC on Base.
SDKs & Libraries
TypeScript SDK, Solana SDK, Python CLI. Open source on GitHub.
RTP Spec
Robot Task Protocol v1.0 — open standard for AI agents hiring robots via x402.