Integration
Rest API
ZenithPay REST endpoints for wallet, policy, payment, approvals, and ledger
ZenithPay REST API is the owner-facing control plane for onboarding, spend policy, and payment execution.
Base URL
https://api.usezenithpay.xyz
Authentication
Use Bearer auth on protected endpoints.
Authorization: Bearer $ZENITHPAY_API_KEYPublic endpoints:
GET /healthGET /sell/agent-intel(returns x402 challenge when unpaid)
Endpoints (high level)
| Method | Route | Purpose |
|---|---|---|
GET | /health | Health check |
POST | /wallet/genesis | Create a TEE-secured agent wallet |
GET | /wallet/balance | Wallet balances + remaining daily budget |
GET | /wallet/agents | List agent addresses under your account |
POST | /pay | Policy-gated x402 payment (swap OKB->USDG if needed) |
GET | /limits | Read current spend policy |
POST | /limits | Deploy/update SpendPolicy.sol (requires human signature) |
GET | /approvals | Payments paused for human review |
POST | /approvals/:id/approve | Approve and execute |
POST | /approvals/:id/deny | Deny and cancel |
GET | /ledger | Transaction audit trail |
GET/POST | /sell/agent-intel | Seller-side x402 challenge + paid resource |
Example: create an agent wallet
curl -X POST https://api.usezenithpay.xyz/wallet/genesis \
-H "Authorization: Bearer $ZENITHPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "agent@yourdomain.com",
"label": "research-agent-01"
}'Example: pay a service
curl -X POST https://api.usezenithpay.xyz/pay \
-H "Authorization: Bearer $ZENITHPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentAddress": "0xcadf...1a9",
"serviceUrl": "https://exa.ai/search",
"maxAmount": "0.25",
"intent": "Research DeFi trends on X Layer"
}'Possible POST /pay outcomes:
approved: returnstxHashpending: returnsstatus: \"pending\"+approvalIdwhen aboveapprovalThresholdblocked: returnsstatus: \"blocked\"+ hard-rejection reason (PaymentBlocked)
Seller route behavior (/sell/agent-intel)
GET /sell/agent-intel:
- unpaid request ->
402 Payment Requiredwith x402 payload - paid request with
X-PAYMENTheader -> paid JSON resource
POST /sell/agent-intel:
- same challenge/settle pattern, explicit post variant for controlled demos