Verify AI agents, enforce spending mandates, and process x402 payments before a single transaction is accepted.
import { MandateClient } from '@mandate/sdk'
const client = new MandateClient({
apiKey: process.env.MANDATE_API_KEY,
})
const data = await client.fetchWithPayment(
'https://api.example.com/premium/data',
{
agentId: 'agt_research_bot',
mandateId: 'mnd_data_only_10usd',
}
)
// Handles 402, policy check,
// proof generation, and retryimport { requireMandate } from '@mandate/middleware'
app.get(
'/premium/data',
requireMandate({
price: '0.10',
currency: 'USDC',
category: 'data',
}),
(c) => {
const agentId = c.get('mandateAgentId')
return c.json({
data: '...',
paid_by: agentId,
})
}
)Designed for agents built on
When an AI agent calls a paid API, the seller has no way to know if it is authorized, who owns it, what it is allowed to spend, or whether it can actually pay.
Existing payment infrastructure assumes a human is at checkout. Existing API keys give agents unlimited access. Neither model works for autonomous agents.
Give your AI agent a stable identity and attach a mandate defining its spending authority, allowed merchants, and expiry.
When the agent calls a protected endpoint, Mandate checks its identity, mandate validity, and policy in under 300ms.
A cryptographic proof is generated, the mandate budget is charged atomically, and the resource is returned.
Every agent gets a stable, verifiable identity. Revoke access instantly if an agent is compromised.
Define exactly what each agent can do: max spend per transaction, total budget, allowed merchants, and expiry.
Seven checks on every transaction: agent status, mandate validity, merchant allowlist, category, per-tx limit, total budget, and risk.
Native support for the x402 HTTP payment protocol. Sandbox mode works without any blockchain. Production settles in USDC.
One function call handles the entire 402 challenge, policy check, proof generation, and retry.
Every verification, policy decision, and payment is logged. Queryable by agent, mandate, merchant, and time.
Free sandbox. No credit card. Full x402 flow in under an hour.