PayAgent Developer Documentation

Crypto payments for humans and AI agents. Built by LCX (Liberty Crypto Exchange).

Core thesis: Every AI agent will need a wallet, payment rails, and financial autonomy. PayAgent is how they pay. A non-custodial payment service that allows humans and AI agents to send, receive, and automate crypto payments using stablecoins, with LCX as the network fee and reward token.

AI agents are becoming economic actors. They buy compute, pay APIs, settle micro-transactions, and transact with other agents. PayAgent is the financial infrastructure for this new economy.

PayAgent is built for:

👤

Free for Humans

Create payment links and pay directly from your wallet. Non-custodial, full control.

🤖

For AI Agents & Developers

Programmable payment rails via API. Agents create links, pay, and earn rewards autonomously.

🔗

Link-Based Settlement

Every payment is a link. Share with anyone, human or agent. Settles instantly on-chain.

🪙

Earn LCX with Every Payment

Payment link creators earn LCX token rewards on every successful settlement.

Quick Summary

What PayAgent Does

  • Free for humans to create payment links
  • Programmable payment rails for AI agents, firms, and developers via API
  • Get paid in stablecoins (USDC, USDT)
  • Earn LCX tokens for every completed payment
  • Pay small, flat network fees in LCX (auto-swapped via Uniswap if needed)
  • Automate agent-to-agent payments without human intervention

Supported Today

PropertyValue
NetworksEthereum, Base, Polygon, Arbitrum, Optimism, BNB Chain Live
Assets (Standard)USDC, USDT, DAI, WBTC, WETH, EURC
Assets (Pro)Any ERC-20 token on Ethereum
FeesPaid in LCX
CustodyNon-custodial

Key Concepts

Humans vs AI Agents

RoleDescription
Human 👤Creates payment links manually via UI
AI Agent 🤖Creates and pays links autonomously via API

Both follow the same economic rules. Both earn LCX rewards.

Stablecoins vs LCX

Stablecoins move value. LCX powers the network. Stablecoins are the medium of exchange. LCX is the network fuel, used for fees, creator rewards, and economic incentives.

Fees and Rewards

Standard Mode

PropertyValue
Network Fee2 LCX
Creator Reward1 LCX
Service Fee1 LCX
Supported AssetsUSDC, USDT

Pro Mode

PropertyValue
Network Fee4 LCX
Creator Reward2 LCX
Service Fee2 LCX
Supported AssetsAny ERC-20 token on Ethereum
Earn LCX with every payment. Every time a payment link you created is paid, you automatically earn LCX tokens. Rewards are credited on successful settlement.

Fee Details

The payer covers the fee. Fee is paid in LCX token (preferred) or deducted from the payment token (fallback). Payer only needs the payment token + ETH for gas.

ScenarioBehavior
Payer has ≥ 4 LCX4 LCX fee (2 platform + 2 creator reward). Creator gets full amount.
Payer has < 4 LCXFee deducted from payment token (50/50 split). Creator gets amount minus fee.
ETH paymentsFee converted to ETH equivalent using live price.

Fees are LCX-denominated, not USD-based. At current pricing: 2 LCX ≈ $0.08 (at $0.04/LCX). If a payer does not hold enough LCX, the amount is auto-sourced via Uniswap.

Human payers: use GET /api/request/:id/fee?payer=0x... (public, no auth) to get fee breakdown and transfer instructions.

Supported Assets

Standard Mode 2 LCX Fee

AssetType
USDCStablecoin (USD)
USDTStablecoin (USD)

Pro Mode 4 LCX Fee

Any ERC-20 token on Ethereum. Designed for advanced users, AI agents, and integrators who need flexibility beyond stablecoins.

For Humans

Create shareable links instantly and get paid. Connect your wallet, choose an amount and asset, generate a link, and share it.

  1. Connect your non-custodial wallet
  2. Choose amount and asset
  3. Generate payment link
  4. Share the link with anyone
  5. Earn LCX when the link is paid
Coming soon: Full payment history with filtering, export, and detailed analytics.

For AI Agents, Firms, and Developers

PayAgent provides programmable, automated payment rails via API. Flat, predictable fees in LCX tokens. No percentages, no hidden costs.

  • Create payment links via API
  • Pay links autonomously
  • Earn LCX rewards on every settlement
  • Operate without human intervention
  1. Agent creates a payment request via API
  2. Another agent or human pays the link
  3. Settlement occurs automatically on-chain
  4. LCX rewards distributed to the creator agent
Deterministic for agents. AI agents can predict costs, calculate rewards, and execute payments programmatically with zero ambiguity.

API Overview

PayAgent is a crypto payment infrastructure platform for AI agents. Register your agent, get HMAC credentials, and let your agents create and pay payment links programmatically.

🔐HMAC-SHA256 Auth
💬AI Chat
🔔Webhooks
👛Wallet Dashboard

Base URL

https://www.payagent.co

npm Package

Install the PayAgent SDK for agent integrations:

npm install @payagent/sdk ethers

Quick Example

// Create a payment link
const link = await payagent.createLink({
  amount: "100",
  asset: "USDC",
  mode: "standard"
});

// Returns: { linkId, url, status, fee: "2 LCX" }

HMAC Authentication

All API requests from agents are authenticated using HMAC-SHA256 signing. Your api_secret never leaves your environment — only the computed signature is sent over the wire.

Required Headers

HeaderDescription
x-api-key-idPublic identifier — pk_live_...
x-timestampUnix epoch seconds (must be within 5 min of server time)
x-signatureHMAC-SHA256 hex digest of the string-to-sign

String-to-Sign Format

# Format:
# timestamp\nMETHOD\npath\nSHA256(body)

# Replay protection: timestamp must be within 5 minutes of server time

Shell Signing Helper

#!/bin/bash
KEY_ID="pk_live_YOUR_KEY_ID"
SECRET="sk_live_YOUR_SECRET"
METHOD=$1   # GET or POST
PATH_=$2    # /api/create-link
BODY=$3     # '{"amount":"10"}' or ''

TS=$(date +%s)
BODY_HASH=$(echo -n "$BODY" | shasum -a 256 | cut -d' ' -f1)
STRING_TO_SIGN="${TS}\n${METHOD}\n${PATH_}\n${BODY_HASH}"
SIG=$(echo -ne "$STRING_TO_SIGN" | openssl dgst -sha256 -hmac "$SECRET" | cut -d' ' -f2)

echo "x-api-key-id: $KEY_ID"
echo "x-timestamp: $TS"
echo "x-signature: $SIG"

Agent Registration

Step 1: Register Your Agent

Register via cURL. Complete X verification to get your HMAC credentials (api_key_id + api_secret).

curl -X POST https://www.payagent.co/api/agents/register \
  -H "Content-Type: application/json" \
  -d '{
    "username": "my-agent",
    "email": "dev@example.com",
    "wallet_address": "0xYourWalletAddress"
  }'

# Response:
# {
#   "success": true,
#   "agent_id": "agent_my-agent_a1b2c3",
#   "verification_challenge": "payagent-verify-my-agent-abc123",
#   "instructions": "Post the challenge to X, then call /api/agents/verify-x"
# }

# After X verification → you receive HMAC credentials:
# {
#   "api_key_id": "pk_live_abc123...",
#   "api_secret": "sk_live_xyz789...",
#   "api_key_expires_at": "2026-02-21T..."
# }
# Save both — they will NOT be shown again.

Step 2: Verify on X (Twitter)

Post the verification challenge to X (Twitter), then call the verify endpoint with your tweet URL. On success, you'll receive your HMAC credentials.

# 1. Post to X (Twitter):
#    "payagent-verify-my-agent-abc123"

# 2. Call verify endpoint with your tweet URL:
curl -X POST https://www.payagent.co/api/agents/verify-x \
  -H "Content-Type: application/json" \
  -d '{
    "username": "my-agent",
    "tweet_url": "https://x.com/yourhandle/status/1234567890"
  }'

# Response (save both credentials — shown ONCE):
# {
#   "success": true,
#   "api_key_id": "pk_live_abc123...",
#   "api_secret": "sk_live_xyz789...",
#   "api_key_expires_at": "2026-02-21T...",
#   "x_username": "yourhandle"
# }
Important: API keys expire after 10 days. Use the dashboard or POST /api/agents/rotate-key to regenerate before expiry.

SDK & Payments

Install @payagent/sdk v0.2.0+. The SDK handles HMAC signing, transaction signing, broadcasting, and verification automatically.

Installation

npm install @payagent/sdk ethers

Full Implementation Example

const { PayAgentClient } = require('@payagent/sdk');

// ── Initialize the client ───────────────────────────────
const client = new PayAgentClient({
  apiKeyId: 'pk_live_YOUR_KEY_ID',      // public identifier
  apiSecret: 'sk_live_YOUR_SECRET',     // signing secret (never transmitted)
  privateKey: process.env.WALLET_PRIVATE_KEY,
  baseUrl: 'https://www.payagent.co',
});

console.log('Wallet address:', client.address);

// ── Create a payment link ───────────────────────────────
const link = await client.createLink({
  amount: '10',
  network: 'sepolia',      // 'sepolia' | 'ethereum' | 'base'
  token: 'USDC',           // 'USDC' | 'USDT' | 'ETH' | 'LCX'
  description: 'Service fee',
});
console.log('Link created:', link.linkId);

// ── Pay a link (one call) ───────────────────────────────
const result = await client.payLink(link.linkId);
console.log('Status:', result.status);        // 'PAID'
for (const tx of result.transactions) {
  console.log(`  ${tx.description}: ${tx.txHash} (${tx.status})`);
}

// ── Or step-by-step for more control ────────────────────
const instructions = await client.getInstructions('REQ-ABC123');
// ... sign & broadcast yourself ...
const verification = await client.verifyPayment('REQ-ABC123', '0xTxHash');

Create a Payment Link (cURL)

network is required. Supported: sepolia, ethereum, base. All requests use HMAC signing.

curl -X POST https://www.payagent.co/api/create-link \
  -H "Content-Type: application/json" \
  -H "x-api-key-id: pk_live_YOUR_KEY_ID" \
  -H "x-timestamp: $(date +%s)" \
  -H "x-signature: <computed HMAC signature>" \
  -d '{
    "amount": "10",
    "network": "ethereum",
    "token": "USDC",
    "description": "Service fee"
  }'

# Response:
# {
#   "success": true,
#   "linkId": "REQ-ABC123",
#   "link": "/r/REQ-ABC123",
#   "network": "ethereum",
#   "token": "USDC",
#   "amount": "10"
# }

SDK Methods Reference

MethodDescription
client.payLink(linkId)Fetch instructions, sign, broadcast, and verify in one call
client.createLink({ ... })Create a payment link (amount, network, token, description)
client.getInstructions(linkId)Fetch transfer instructions only (for manual control)
client.verifyPayment(id, txHash)Verify a payment by transaction hash
client.getChains()List supported chains and tokens
client.addressYour wallet address (read-only property)

AI Chat (Natural Language)

Talk to PayAgent AI (powered by Grok). It can create links, check status, and more. When creating a link, the AI will ask which chain to use.

curl -X POST https://www.payagent.co/api/chat \
  -H "Content-Type: application/json" \
  -H "x-api-key-id: pk_live_YOUR_KEY_ID" \
  -H "x-timestamp: $(date +%s)" \
  -H "x-signature: <computed>" \
  -d '{ "message": "Create a 5 USDC payment link on base" }'

Webhooks

Register webhook URLs to receive real-time notifications when payment events occur.

curl -X POST https://www.payagent.co/api/webhooks \
  -H "Content-Type: application/json" \
  -H "x-api-key-id: pk_live_YOUR_KEY_ID" \
  -H "x-timestamp: $(date +%s)" \
  -H "x-signature: <computed>" \
  -d '{
    "url": "https://your-agent.com/webhook",
    "events": ["payment.paid", "payment.created"]
  }'

# Events: payment.created, payment.paid, payment.expired
# Payloads include HMAC-SHA256 signature in X-PayAgent-Signature header
EventTriggered When
payment.createdA new payment link is created
payment.paidA payment link is settled on-chain
payment.expiredA payment link expires without being paid

Key Management

API keys expire after 10 days. Rotate, deactivate, or delete your agent. These actions require JWT authentication (wallet login) or can be done from the dashboard.

# Rotate API Key (JWT required — via dashboard wallet login)
curl -X POST https://www.payagent.co/api/agents/rotate-key \
  -H "Authorization: Bearer <your_jwt_token>"

# Response (save both — shown ONCE):
# {
#   "api_key_id": "pk_live_new_id...",
#   "api_secret": "sk_live_new_secret...",
#   "expires_at": "2026-02-23T..."
# }

# Deactivate Agent (soft — can be reactivated)
curl -X POST https://www.payagent.co/api/agents/deactivate \
  -H "Authorization: Bearer <your_jwt_token>"

# Delete Agent (soft — payment history preserved)
curl -X DELETE https://www.payagent.co/api/agents/me \
  -H "Authorization: Bearer <your_jwt_token>"
Tip: Use the Agents Dashboard to manage keys with a simple click — no cURL needed. Just connect your wallet.

Dashboard Authentication (Wallet)

The browser dashboard uses wallet-based authentication — no secrets in the browser. Connect your wallet, sign a challenge message, and get a short-lived JWT session.

# 1. Get challenge nonce
POST /api/auth/challenge
{ "wallet_address": "0x..." }
→ { "nonce": "Sign this to login to PayAgent: abc123...", "expires_in": 300 }

# 2. Sign nonce with wallet (EIP-191) and verify
POST /api/auth/verify
{ "wallet_address": "0x...", "signature": "0x..." }
→ { "token": "eyJ...", "expires_in": 3600, "agent": { ... } }

# 3. Use JWT for dashboard actions
GET /api/agents/me
Authorization: Bearer eyJ...

Authentication Methods Summary

MethodUsed ByHow It Works
HMAC-SHA256SDK / AI Agents / cURLx-api-key-id + x-timestamp + x-signature. Secret stays in your environment.
Wallet JWTBrowser DashboardWallet signature (EIP-191) to get a 1-hour JWT. No secrets in the browser.
None (Public)Anyone/api/chains, /api/stats, /api/request/:id, /api/auth/*

All Endpoints

Public (No Auth)

POST/api/agents/registerRegister agent
POST/api/agents/verify-xX verification
POST/api/auth/challengeWallet login nonce
POST/api/auth/verifyWallet login verify
GET/api/chainsList chains & tokens
GET/api/request/:idView payment link
GET/api/request/:id/feeFee breakdown for payer
GET/api/statsPlatform statistics
GET/api/rewards?wallet=0x...Creator rewards (human + agent)
GET/api/agents/by-wallet?wallet=0x...Lookup agent by wallet
GET/api/agents/listList all agents (public summary)
GET/api/pricesToken prices (LCX, ETH, USDC, USDT)
GET/healthHealth check

HMAC-Signed (SDK / Agents / cURL)

POST/api/create-linkCreate payment link
POST/api/pay-linkGet payment instructions
POST/api/verifyVerify payment on-chain
POST/api/chatAI chat (natural language)
GET/api/requestsList your payment links
POST/api/webhooksRegister webhook
GET/api/webhooksList webhooks
PUT/api/webhooks/:idUpdate webhook
DELETE/api/webhooks/:idDelete webhook
POST/api/webhooks/:id/testSend test webhook event
DELETE/api/request/:idDelete payment request

HMAC or JWT (Both Auth Methods)

GET/api/agents/meAgent profile
POST/api/agents/walletUpdate wallet address
GET/api/agents/logsAPI request logs
GET/api/agents/ip-historyIP address history

JWT Only (Dashboard / Wallet Login)

POST/api/agents/rotate-keyRotate HMAC credentials
POST/api/agents/deactivateDeactivate agent
DELETE/api/agents/meDelete agent (soft)

Chains & Tokens

ChainIdentifier
Ethereum Mainnet Liveethereum
Base Livebase
Polygon Livepolygon
Arbitrum One Livearbitrum
Optimism Liveoptimism
BNB Chain Livebsc
Sepolia Testnet Testnetsepolia

Tokens per chain: USDC, USDT, ETH, LCX, DAI, WBTC, WETH, EURC. Query GET /api/chains for full details including contract addresses.

MCP Integration

Use PayAgent tools inside Claude Desktop, Cursor, or any MCP-compatible AI client.

Quick Setup

Install the payagent-mcp npm package. Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "payagent": {
      "command": "npx",
      "args": ["-y", "payagent-mcp"],
      "env": {
        "PAYAGENT_API_KEY": "your-api-key-id",
        "PAYAGENT_API_SECRET": "your-api-secret"
      }
    }
  }
}

Restart Claude Desktop. You'll see 7 PayAgent tools available.

Available Tools

ToolDescription
create_payment_linkCreate a payment request link with amount, token, and chain
check_payment_statusCheck if a payment has been completed
get_wallet_balanceQuery agent wallet balances on-chain
withdraw_fundsSend funds from agent wallet to any address
list_paymentsList recent payment requests
get_fee_estimateCalculate fees before creating a payment
pay_payment_linkPay a payment request directly from agent wallet

Remote API Endpoints

The MCP package connects to these backend endpoints:

EndpointAuthDescription
GET /api/mcp/toolsPublicList all available MCP tools and schemas
POST /api/mcp/callAPI KeyExecute a tool (x-api-key-id + x-api-secret headers)

Telegram Bot

Create payment links, tip users, and manage your wallet from Telegram.

Commands

CommandDescriptionExample
/startInitialize bot and create wallet/start
/createCreate a payment link/create 10 USDC
/balanceCheck wallet balance/balance
/tipTip another Telegram user/tip @username 2 USDC
/helpList all commands/help

How Tipping Works

When you tip a Telegram user, the bot looks up their wallet. If they haven't started the bot yet, a wallet is created for them automatically. The USDC is sent on-chain from your bot wallet to theirs.

Agent Wallets

Managed custodial wallets for AI agents to hold, receive, and send funds autonomously.

Endpoints

EndpointDescription
GET /api/agent/walletGet or create agent wallet
GET /api/agent/wallet/balancesQuery on-chain token balances
POST /api/agent/wallet/withdrawSend funds to an external address
GET /api/agent/wallet/transactionsTransaction history
GET /api/agent/wallet/policyGet spending policy
PUT /api/agent/wallet/policyUpdate spending limits

Withdraw Example

POST /api/agent/wallet/withdraw
Content-Type: application/json

{
  "to": "0xRecipientAddress",
  "token": "USDC",
  "amount": "10.00",
  "chain": "base"
}

Security

Private keys are encrypted with AES-256-GCM using a server-side encryption key. Keys are never exposed via API. Spending policies enforce daily transaction limits and per-transaction caps.

PropertyValue
EncryptionAES-256-GCM with server-side key
Key exposureNever exposed via API
Daily limitConfigurable per agent
Per-transaction capConfigurable per agent

QR Payments (ERC-681)

Payment QR codes use the ERC-681 standard to open wallet apps directly with transaction details pre-filled.

URI Format

For native ETH payments:

ethereum:0xReceiverAddress@chainId?value=amountInWei

For ERC-20 token payments (e.g., USDC):

ethereum:0xTokenContract@chainId/transfer?address=0xReceiver&uint256=atomicAmount

Supported Wallets

Scanning the QR code opens the transaction in any wallet that supports the ethereum: URI scheme:

WalletSupport
MetaMaskMobile & browser extension QR scanner Supported
Trust WalletDeep link + QR Supported
Coinbase WalletDeep link + QR Supported
Rainbow, Zerion, othersAny wallet supporting ethereum: URIs Supported

On mobile devices, deep-link buttons are shown for MetaMask, Trust Wallet, and Coinbase Wallet.

Network & Roadmap

Live Networks

Ethereum, Base, Arbitrum, Optimism, Polygon, BSC. Live

Recently Shipped (Q1 2026)

FeatureStatus
Multi-chain support (6 networks)Live
MCP server for Claude DesktopLive
Telegram bot with tippingLive
Agent wallets with spending policiesLive
ERC-681 QR codes for wallet deep-linkingLive
Gasless permits (EIP-2612)Live

Upcoming (Q2 2026)

FeatureStatus
Agent-to-Agent marketplace (AgentHire)Planned
PayAgent crypto card (NFC, own network)Planned
Hosted MCP SSE endpointPlanned
Liberty Chain by LCXPlanned
Recurring payment subscriptionsPlanned
Python & Go SDKsPlanned

Security & Custody

  • Non-custodial for humans. Human users retain full control of their private keys at all times.
  • Managed wallets for agents. Agent wallet private keys are encrypted with AES-256-GCM. Keys are never exposed via API.
  • Settlement happens on-chain via smart contracts across 6 supported networks.
  • All transactions are publicly verifiable on-chain.
  • Agent spending policies enforce daily limits and per-transaction caps.
  • HMAC secrets never leave your environment — only signatures are transmitted.
  • MCP API uses encrypted API key/secret pairs with rate limiting.
  • Dashboard uses wallet-signed JWT — no secrets stored in browser.
  • Sentry error monitoring and enhanced health checks for production reliability.

FAQ

Is PayAgent free?

For humans, creating payment links is free. The payer covers a flat 2 LCX fee (~$0.08) plus Ethereum gas.

Who earns LCX?

The creator of the payment link, whether human or AI agent. 1 LCX per Standard, 2 LCX per Pro.

Who pays the fee?

The payer. If the payer doesn't hold LCX, it is auto-swapped via Uniswap.

Can AI agents use PayAgent?

Yes. Agents create links, pay, and earn rewards via API without human intervention.

Is PayAgent custodial?

No. Fully non-custodial. Users and agents control their own funds and keys.

What about gas fees?

Standard Ethereum gas fees apply and are paid by the payer, in addition to the flat LCX network fee.

How do API keys work?

After X verification, you receive a public key ID and a secret. Keys expire after 10 days and can be rotated via dashboard or API.

Is this a beta?

Yes. PayAgent is a beta product launch by LCX AI Labs.

PayAgent is developed by LCX AI Labs. This is a beta product launch.

PayAgent is provided "as is" and may change. Users are responsible for complying with applicable laws. Terms of service are governed by LCX International.

PayAgent settles value in stablecoins, charges flat LCX network fees, and rewards creators on every payment.