Skip to content

PQSafe AgentPay

The first payment protocol built for AI agents. Post-quantum signed. Cryptographically authorized. Rail-agnostic.

Why PQSafe AgentPay?

AI agents need to spend money. Today they do it unsafely — hardcoded API keys, uncapped balances, no audit trail. PQSafe changes that.

Post-Quantum Secure

Every payment is authorized by an ML-DSA-65 signature (FIPS 204) — quantum-computer-resistant, standardized by NIST in 2024.

Spend Envelopes

Cryptographically bounded payment authorizations. Cap by amount, recipient, time window, and rail. Agents can’t spend outside the envelope.

Rail-Agnostic

One API, five rails: Airwallex, Wise, Stripe, USDC on Base, and x402. Switch rails without changing agent code.

Human-in-the-Loop

Set approval gates on any envelope. Payments above your threshold pause and wait for Telegram, Slack, or webhook approval.

Immutable Ledger

Every payment attempt is appended to a tamper-evident ledger. Full audit trail for compliance, debugging, and cost attribution.

Framework Adapters

Drop-in adapters for LangChain, CrewAI, MCP, and Mastra. Your agents stay framework-native.

Getting Started

Terminal window
npm install @pqsafe/agent-pay
import { generateKeyPair, createSpendEnvelope, createSignedEnvelope, executeAgentPayment } from '@pqsafe/agent-pay'
// Generate a post-quantum key pair (ML-DSA-65)
const { publicKey, secretKey } = await generateKeyPair()
// Create a bounded spend envelope
const envelope = createSpendEnvelope({
maxAmount: 50, // USD
currency: 'USD',
allowedRails: ['airwallex'],
allowedRecipients: ['anthropic.com'],
validUntil: new Date(Date.now() + 3600_000), // 1 hour
agentId: 'my-agent-v1',
})
// Sign and execute
const signed = createSignedEnvelope(envelope, secretKey)
const result = await executeAgentPayment(signed, {
recipient: 'anthropic.com/billing',
amount: 25,
memo: 'API credits top-up',
})

→ Full Quickstart | → Concepts | → Recipes