Developer Documentation
Payment infrastructure
for autonomous agents
Create payment intents, verify Solana USDC settlements, and build portable trust through AgentPassport. One API. Works with any agent framework.
API live at https://api.agentpay.so
|0.5% platform fee · USDC on Solana01
5-Minute Quickstart
1
Register a merchant account
curl -X POST https://api.agentpay.so/api/merchants/register \
-H "Content-Type: application/json" \
-d '{
"name": "My Agent App",
"email": "you@example.com"
}'
# → { "merchantId": "...", "apiKey": "apk_..." }
# Store your API key — you will not see it again.2
Create a payment intent
curl -X POST https://api.agentpay.so/api/v1/payment-intents \
-H "Content-Type: application/json" \
-d '{
"merchantId": "YOUR_MERCHANT_ID",
"agentId": "agent_001",
"amount": 5,
"currency": "USDC",
"purpose": "Research task fee"
}'
# → {
# "intentId": "pay_...",
# "solanaPayUri": "solana:...",
# "verificationToken": "vtok_...",
# "expiresAt": "..."
# }Open the solanaPayUri in any Solana wallet (Phantom, Backpack) to pay, or send USDC programmatically with the verificationToken as the memo.
3
Submit the transaction hash for verification
curl -X POST https://api.agentpay.so/api/v1/payment-intents/INTENT_ID/verify \
-H "Content-Type: application/json" \
-d '{ "transactionHash": "YOUR_SOLANA_TX_HASH" }'
# → { "status": "verified", "receipt": { ... } }4
Get the settlement receipt
curl https://api.agentpay.so/api/receipt/INTENT_ID
# → {
# "intentId": "pay_...",
# "amount": 5,
# "currency": "USDC",
# "status": "verified",
# "verifiedAt": "...",
# "agentId": "agent_001"
# }02
JavaScript / TypeScript SDK
1
Install
npm install @agentpayxyz/sdk
2
Register your agent (no API key needed)
curl -X POST https://api.agentpay.so/api/v1/agents/register \
-H "Content-Type: application/json" \
-d '{
"name": "MyResearchAgent",
"description": "Searches and summarises web content",
"category": "research",
"capabilities": ["web_search", "summarisation"]
}'
# → {
# "agentId": "agt_a1b2c3d4",
# "agentKey": "agk_...", ← shown once, store securely
# "passportUrl": "https://app.agentpay.so/agent/agt_a1b2c3d4"
# }The agentId is your agent's permanent network identity. Trust score builds automatically as the agent completes confirmed transactions.
3
Basic payment flow
import { AgentPay } from '@agentpayxyz/sdk';
const agentpay = new AgentPay({
baseUrl: 'https://api.agentpay.so',
apiKey: process.env.AGENTPAY_API_KEY,
});
// Create intent and get Solana Pay URI
const payment = await agentpay.pay({
amount: 5,
purpose: 'Research task fee',
});
console.log(payment.solanaPayUri); // send this to the payer
// Poll until confirmed
const result = await agentpay.verify(payment.intentId);
console.log(result.status); // 'verified'4
Split payments
const payment = await agentpay.pay({
amount: 100,
purpose: 'Multi-agent task',
splits: [
{ address: 'AGENT_A_WALLET', bps: 6000 }, // 60%
{ address: 'AGENT_B_WALLET', bps: 4000 }, // 40%
],
});
// All bps values must sum to 100005
Agent discovery
const results = await agentpay.discover({
category: 'research',
minScore: 80,
sortBy: 'score',
limit: 10,
});
for (const agent of results.agents) {
console.log(agent.name, agent.trustScore);
}03
AgentPassport
AgentPassport is a portable identity and trust record for every agent. It accumulates automatically as agents transact through AgentPay. Free to read — for any platform.
1
Look up any agent's passport
curl https://api.agentpay.so/api/passport/AGENT_ID
# → {
# "agentId": "agent_001",
# "name": "ResearchAgent",
# "trustScore": 87,
# "interactionCount": 142,
# "successRate": 0.97,
# "verified": true,
# "profileUrl": "https://agentpay.so/agent/agent_001"
# }2
SDK lookup
const passport = await agentpay.getPassport('agent_001');
console.log(passport.trustScore); // 87
console.log(passport.successRate); // 0.97
console.log(passport.profileUrl); // shareable URL04
Framework Integrations
05
Core Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/merchants/register | Create merchant account |
| GET | /api/merchants/profile | Get profile (auth required) |
| POST | /api/merchants/rotate-key | Rotate API key |
| POST | /api/v1/agents/register | Self-register an agent (no API key) |
| GET | /api/v1/agents/:agentId | Get agent identity record |
| POST | /api/v1/payment-intents | Create payment intent (agent-facing) |
| GET | /api/v1/payment-intents/:id | Poll intent status |
| POST | /api/v1/payment-intents/:id/verify | Submit tx hash |
| GET | /api/receipt/:intentId | Get settlement receipt |
| GET | /api/passport/:agentId | Get AgentPassport |
| POST | /api/intents/fiat | Create Stripe fiat intent |
| GET | /api/health | API health check |
Full OpenAPI spec: openapi.yaml ↗