Pay to Agent
Pay another agent by Agent ID instead of a raw address. The recipient must be a registered, non-revoked identity — never an anonymous wallet. Payouts, splits, and tips over USDC on Base mainnet.
Pay to Agent
KYA required
Pay-to-Agent never settles to an anonymous address. The recipient must be a registered, active agent identity in your account. An unknown or revoked agent is refused before any money moves.
A consumer spend can name another agent as the payee instead of a raw
0x address. CodeSpar resolves the Agent ID to that agent's on-chain wallet,
checks it is a known, non-revoked identity (Know-Your-Agent),
and settles the USDC through the same proven direct-transfer leg — with a
hash-chained receipt. This is the primitive under agent-to-agent payouts,
revenue splits, and tips.
Paying an agent
Set the mandate's payee (and the spend's payee) to agent:<agent_id>:
# 1. mint a mandate that allowlists the agent payee
codespar mandate create \
--consumer payer \
--agent orchestrator \
--payee "agent:helper-42" \
--cap 100 --per-tx-cap 100 --rail usdc-onchain --currency USDC
# 2. spend against it
curl -X POST https://api.codespar.dev/v1/consumers/mandates/<cm_...>/spend \
-H "authorization: Bearer $CODESPAR_API_KEY" \
-H "content-type: application/json" \
-d '{ "agent_id": "orchestrator", "amount_minor": 10, "payee": "agent:helper-42" }'The agent: payee routes to the USDC slot, resolves to helper-42's wallet,
and settles wallet-to-wallet on Base. The recipient agent needs no setup beyond
being registered — the payer constructs the payment from the Agent ID alone.
The KYA gate
Resolution enforces that the recipient is a real, current identity:
| Condition | Result |
|---|---|
Agent is registered and active | Resolves; the payment settles |
| Agent id is unknown in your account | 403 agent_not_registered |
| Agent identity is suspended / retired / unregistered | 403 agent_revoked |
The refusal happens before settlement, so a rejected payment never moves money. Register agents through the Agent identity surface.
What is and isn't included
The rail-level primitive — resolve by Agent ID, KYA gate, settle with a receipt — is live. Splits (one payment fanned across several helper agents) and tips as packaged flows build on this same primitive and are rolling out with design partners.
Related
- Monetize Gateway — the other direction: charge agents for your service.
- Agent trust — Know-Your-Agent identity and reputation.
- Directed-pay — the signed-mandate spend model this rides on.
Monetize Gateway
Charge AI agents per call for your API, MCP server, or any REST endpoint. Put a paywall in front of it, share a gateway URL, get paid in USDC over x402 — no signup, no card, no session.
Agent identity and trust (KYA)
Verifiable agent identity (did:web + Ed25519), signed reputation, and the register / rotate / revoke key lifecycle. Know Your Agent for the money side.