Developer Docs
Everything you need to give your AI agents autonomous payment capability.
Overview
PayMind is agent payment infrastructure built on the x402 protocol and Coinbase CDP. The core flow: 1. Your agent wallet is provisioned on Base L2 via Coinbase CDP 2. You top up the wallet via Stripe (GBP → USDC) or direct crypto deposit 3. When your agent hits a 402-gated endpoint, x402-client handles payment automatically 4. Every transaction is recorded, policy-checked, and surfaced in your dashboard
Quickstart
Install the SDK in your agent project:
import { X402Client } from '@paymind/x402-client';
const client = new X402Client({
facilitatorUrl: process.env.X402_FACILITATOR_URL,
walletAddress: process.env.AGENT_WALLET_ADDRESS,
privateKey: process.env.AGENT_PRIVATE_KEY,
maxAutoApproveUsdc: 0.05, // auto-pay up to $0.05
});
// Just make your request — x402 handled automatically
const response = await fetch('https://api.dataservice.xyz/enrichment');
const { response: finalResponse, paymentResult } =
await client.handleX402Response(response, {
url: 'https://api.dataservice.xyz/enrichment',
method: 'GET',
});
console.log(paymentResult?.txHash); // 0xabc...
REST API
All API endpoints require Bearer authentication with a PayMind API key.
# Provision a wallet for a new agent
curl -X POST https://api.paymind.io/api/v1/agents \
-H "Authorization: Bearer pm_live_xxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "DealMind Scout",
"orgId": "your-org-uuid",
"provisionWalletNow": true
}'
# Response
{
"agent": {
"id": "uuid",
"name": "DealMind Scout",
"wallet_address": "0xabc...",
"balance_usdc": 0,
"status": "active"
},
"walletProvisioned": true
}Spending Policies
Every agent has an associated spending policy. Policies are checked before every transaction. Policy parameters: - daily_limit_usdc: Maximum total spend per calendar day - per_tx_limit_usdc: Maximum spend per single transaction - allowed_categories: Allowlist of categories (api, data, compute) - kill_switch_enabled: Immediately halt all agent spending
# Set spending policy
curl -X POST https://api.paymind.io/api/v1/payments/policy-check \
-H "Authorization: Bearer pm_live_xxxx" \
-d '{
"agentId": "uuid",
"amountUsdc": 0.05,
"category": "api"
}'
# Response
{
"allowed": true,
"remainingDailyUsdc": 9.95,
"dailyLimitUsdc": 10,
"perTxLimitUsdc": 1
}x402 Protocol Specification
PayMind implements the open x402 protocol. Read the full spec to understand the payment flow and build compatible services.
x402.org →