Complete API reference for managed agent wallets, USDC payments, spending policies, and x402 micropayments.
Introduction
NexusPay is a managed payment infrastructure for AI agents. It provides agent wallets backed by real USDC on Base, policy-gated spending, instant P2P transfers between agents, and x402 micropayment paywalls — all via a single REST API.
ℹBase URL: https://nexuspay.app/api. All amounts are denominated in USDC (dollars). The API accepts and returns decimal values — 10.50 means $10.50 USDC.
Authentication
All API requests must include an API key in the X-Api-Key header. Keys are created per-agent and scoped to their associated wallet.
Keys are hashed with SHA-256 before storage — NexusPay never holds your plaintext key after creation. Store it immediately on first issue.
⚠API keys grant full access to the associated agent wallet. Never expose them client-side or commit them to source control.
Wallets
Agent wallets hold USDC balances and interact with the Base blockchain via Coinbase CDP. Each wallet has a unique on-chain address, an internal agent ID, and an optional spending policy.
List wallets
GEThttps://nexuspay.app/wallets
Returns all agent wallets with current balances and status.
On-chain transactions settle USDC on Base via the Coinbase CDP SDK. Every transaction is validated against the agent's active spending policy before settlement. Balances are decremented atomically before on-chain submission — if the chain call fails, the balance is refunded and the transaction is marked FAILED.
List transactions
GEThttps://nexuspay.app/transactions
Returns the transaction history with optional filters.
Parameter
Type
Description
agentId
string
Filter by agent. If omitted, returns all transactions.
⚠If the agent's spending policy blocks the transaction, the API returns HTTP 403 with policy_rejected and a breakdown of which checks failed — no funds are moved.
P2P Transfers
Agent-to-agent transfers swap balances within NexusPay's internal ledger — no gas fees, no on-chain latency. Both wallets update atomically in a single database transaction. P2P transfers are still subject to the sender's spending policy.
Transfer between agents
POSThttps://nexuspay.app/p2p
Parameter
Type
Description
fromAgentIdREQUIRED
string
Sender agent ID.
toAgentIdREQUIRED
string
Recipient agent ID. Must be an existing active wallet.
amountUsdcREQUIRED
number
Amount to transfer in USDC.
memo
string
Optional note stored with the transfer (e.g. 'Tool access fee').
Policies define the spend rules for an agent wallet. Every outgoing transaction (including P2P) is validated against the agent's active policy. A transaction is rejected if any enabled check fails — the API returns exactly which check blocked it.
x402 implements the HTTP 402 Payment Required standard for machine-to-machine micropayments. Register any API endpoint with a USDC price — when an agent hits it without a valid payment proof, they receive a 402 response with payment instructions. NexusPay auto-handles payment and retry transparently.
ℹSub-cent pricing is fully supported (e.g. 0.0001 USDC = $0.0001). This makes per-request monetisation economically viable for the first time.
NexusPay issues DID-compatible verifiable credentials so agents can prove their identity and spending authority to third-party services — without sharing private keys.
Issue credential
POSThttps://nexuspay.app/identity
Parameter
Type
Description
agentIdREQUIRED
string
Agent to issue the credential for.
claims
object
Arbitrary claims to embed in the credential JWT.
expiresInSeconds
number
Credential TTL in seconds. Defaults to 3600 (1 hour).