ZenithPay iconZenithPay

Introduction

Welcome

ZenithPay is a spend governance layer for AI agents on X Layer.

ZenithPay banner

It combines:

  • OKX Agentic Wallet (TEE key custody)
  • SpendPolicy.sol on X Layer (hard policy gate)
  • x402 verify/settle via OKX Payments API
  • auto-swap OKB -> USDG when required
  • ledger + approvals for full auditability

Why ZenithPay exists

AI agents can spend money faster than humans can supervise them. A secure payment stack needs:

  • hard limits that cannot be bypassed by backend bugs
  • deterministic payment routing for machine-to-machine APIs
  • clear operator visibility for approved/blocked/pending outcomes

ZenithPay gives all three with onchain policy enforcement first, then payment execution.

System components

  1. Agent Wallet
    • OKX Agentic Wallet (TEE), no raw private key handling in app code.
  2. Policy Engine
    • SpendPolicy.sol enforces per-tx and daily constraints on X Layer.
  3. Payment Engine
    • POST /pay orchestrates check -> optional swap -> x402 settlement.
  4. Seller Route
    • /sell/agent-intel implements x402 seller flow (402 challenge, verify, settle, paid response).
  5. Control Plane
    • approvals queue, ledger, and MCP tools for operational control.

Payment lifecycle (high level)

  1. Agent submits POST /pay with serviceUrl, maxAmount, and intent.
  2. ZenithPay checks SpendPolicy first.
  3. If needed, ZenithPay swaps OKB -> USDG.
  4. ZenithPay executes x402 verify/settle.
  5. ZenithPay writes ledger and returns approved, pending, or blocked.

Current production references

  • API: https://api.usezenithpay.xyz
  • Seller route: https://api.usezenithpay.xyz/sell/agent-intel
  • SpendPolicy: 0x1250e52B7154E12F66e8E347ce116F463D4E248B

Minimal pay example

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://api.usezenithpay.xyz/sell/agent-intel",
    "maxAmount": "0.01",
    "intent": "Fetch paid seller intel"
  }'

On this page