Logo

Algopay API

Algopay is an agent-native payment infrastructure on Algorand. AI agents initiate USDC payments on-chain with gas sponsored by a pre-funded LogicSig account — the paying agent never needs ALGO.

Base URL

https://api.algopay.xyz/api

Authentication

All routes except /auth/* require a JWT Bearer token obtained from the OAuth flow.

Authorization: Bearer <jwt_token>

Routes

PrefixResourceAuth
/authOAuth login, token refresh, user identity
/keysAPI key registration and validationJWT
/gas-poolUSDC gas pool managementJWT
/agentsAgent creation and spend limitsJWT
/paymentsPayment initiation and settlementJWT
/webhooksWebhook registration and deliveryJWT
/auditAudit log retrievalJWT

Payment flow

1. POST /keys/register → get apiKeyId 2. POST /gas-pool → create pool (link apiKeyId, fund USDC) 3. POST /agents → create agent (link poolId, set daily limit) 4. POST /payments → initiate (status = pending) 5. POST /payments/:id/process → submit on-chain atomic group txn[0] lsig fee=5000 (gas sponsor) txn[1] xfer USDC → PaymentProcessor txn[2] appl processPayment() → status = settled, webhook fired

Errors

StatusMeaning
400Validation error or business rule violation
401Missing or invalid JWT
404Resource not found
500Unexpected server error
{ "error": "Agent daily limit exceeded" }