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

Quick Start
Zero to first policy-gated x402 payment using the agent onboarding flow.
Authentication
Base URL, Bearer auth model, MCP headers, and approval signature flow.
API Reference
Endpoint-by-endpoint reference with request and response shapes.
MCP Server
Persistent zenithpay_* tools for Claude Code, Cursor, Windsurf, and more.
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
- Agent Wallet
- OKX Agentic Wallet (TEE), no raw private key handling in app code.
- Policy Engine
- SpendPolicy.sol enforces per-tx and daily constraints on X Layer.
- Payment Engine
POST /payorchestrates check -> optional swap -> x402 settlement.
- Seller Route
/sell/agent-intelimplements x402 seller flow (402challenge, verify, settle, paid response).
- Control Plane
- approvals queue, ledger, and MCP tools for operational control.
Payment lifecycle (high level)
- Agent submits
POST /paywithserviceUrl,maxAmount, andintent. - ZenithPay checks SpendPolicy first.
- If needed, ZenithPay swaps OKB -> USDG.
- ZenithPay executes x402 verify/settle.
- ZenithPay writes ledger and returns
approved,pending, orblocked.
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"
}'