ZenithPay iconZenithPay
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_KEY

Public endpoints:

  • GET /health
  • GET /sell/agent-intel (returns x402 challenge when unpaid)

Endpoints (high level)

MethodRoutePurpose
GET/healthHealth check
POST/wallet/genesisCreate a TEE-secured agent wallet
GET/wallet/balanceWallet balances + remaining daily budget
GET/wallet/agentsList agent addresses under your account
POST/payPolicy-gated x402 payment (swap OKB->USDG if needed)
GET/limitsRead current spend policy
POST/limitsDeploy/update SpendPolicy.sol (requires human signature)
GET/approvalsPayments paused for human review
POST/approvals/:id/approveApprove and execute
POST/approvals/:id/denyDeny and cancel
GET/ledgerTransaction audit trail
GET/POST/sell/agent-intelSeller-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: returns txHash
  • pending: returns status: \"pending\" + approvalId when above approvalThreshold
  • blocked: returns status: \"blocked\" + hard-rejection reason (PaymentBlocked)

Seller route behavior (/sell/agent-intel)

GET /sell/agent-intel:

  • unpaid request -> 402 Payment Required with x402 payload
  • paid request with X-PAYMENT header -> paid JSON resource

POST /sell/agent-intel:

  • same challenge/settle pattern, explicit post variant for controlled demos

On this page