Give your AI agent a wallet with spending limits.
Connect your wallet. This becomes the "owner" - you control all agents you create.
Use the SDK to create a wallet for your AI. Set spending limits on-chain.
Your agent can spend within limits. You can pause or adjust anytime.
Security model: Only YOUR wallet can create/modify policies for your agents. The on-chain policy contract enforces this - even PaySpawn can't change your agent's limits.
| Contract | Address |
|---|---|
| PaySpawnPolicy | 0xb5bcFEcD8b9f781e8E50290381a932f3B3439239 |
| PaySpawnRouter | 0x18D23B464C6E1360fa12cb67D35a852705ea16e6 |
| Treasury | 0x17E4f8FB5937f4Fd556d35b0064Cc2A01cdB96db |
| USDC (Base) | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
npm install @payspawn/sdk// Call the PaySpawn API to create a Turnkey wallet
const response = await fetch('https://api.payspawn.ai/api/agents', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
owner: '0xYourWalletAddress', // Your wallet - you control this agent
name: 'my-ai-agent',
dailyLimit: 100, // $100/day max
perTxLimit: 10 // $10/transaction max
})
});
const { agent } = await response.json();
console.log('Agent address:', agent.address);This step requires signing from your owner wallet. It sets the spending limits on-chain.
// Using ethers.js or viem, call createPolicy on the contract // Only your wallet can do this for agents you own const policyContract = new Contract( '0xb5bcFEcD8b9f781e8E50290381a932f3B3439239', ['function createPolicy(address agent, uint256 dailyLimit, uint256 perTxLimit)'], signer // Your connected wallet ); await policyContract.createPolicy( agent.address, // Agent wallet from step 2 100000000n, // $100 daily limit (6 decimals) 10000000n // $10 per-tx limit (6 decimals) );
// Send USDC to the agent wallet address
// Then your agent can make payments:
const response = await fetch(`https://api.payspawn.ai/api/agents/${agent.address}/pay`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
to: '0xRecipientAddress',
amount: 5, // $5
token: 'USDC'
})
});
const { transaction } = await response.json();
console.log('Payment tx:', transaction.hash);Base URL: https://api.payspawn.ai
/api/agentsCreate a new agent wallet.
{
"owner": "0x...", // Your wallet address (required)
"name": "my-agent", // Agent name (optional)
"dailyLimit": 100, // Daily limit in USD (optional, default: 100)
"perTxLimit": 10 // Per-tx limit in USD (optional, default: 10)
}{
"success": true,
"agent": {
"id": "wallet-id",
"name": "my-agent",
"address": "0x...",
"owner": "0x...",
"limits": { "daily": 100, "perTx": 10 }
}
}/api/agents/:address/paySend payment from an agent wallet.
{
"to": "0x...", // Recipient address (required)
"amount": 5, // Amount in USD (required)
"token": "USDC" // Token symbol (optional, default: USDC)
}/api/agents/:addressGet agent info including balance and policy status.
$0.20
Flat fee per transaction
0.1%
Of transaction amount
Fees are automatically deducted and sent to the protocol treasury. No monthly fees or subscriptions.
As the owner, you can call these functions on the PaySpawnPolicy contract:
pause(agentAddress)Emergency stop - immediately blocks all agent transactions
unpause(agentAddress)Resume agent operations after a pause
updateLimits(agentAddress, newDailyLimit, newPerTxLimit)Change spending limits (in wei, 6 decimals for USDC)
transferOwnership(agentAddress, newOwner)Transfer control of an agent to another wallet