Quick Start
Agent-first onboarding from zero to first policy-gated x402 payment
This guide is the real operator flow: you start inside your AI agent, run skill onboarding once, activate policy as the human owner, then execute the first policy-gated payment.
Production base URL
https://api.usezenithpay.xyzWho does what
- Agent handles automated setup and payment tool calls.
- Human owner approves onboarding and policy activation in the dashboard wallet flow.
1) Start in your agent chat
Paste this into your AI agent:
# Ask your AI agent: Read this skill and follow the onboarding instructions.
curl -s https://api.usezenithpay.xyz/skill.mdThe skill drives onboarding in one session.
2) Agent runs onboarding automatically
From the skill flow, the agent will:
- check for existing ZenithPay config
- create agent wallet (
POST /wallet/genesis) - request agent name/label and email when needed
- save local config
- register ZenithPay MCP server using your credentials
- return a policy-activation onboarding link for the human owner
Local config written by onboarding
The skill stores credentials in:
~/.zenithpay/config.jsonTypical shape:
{
"agentAddress": "0x...",
"apiKey": "zpk_...",
"label": "research-agent-01",
"createdAt": "2026-01-01T00:00:00Z"
}This file is then used to register the MCP server and persist agent identity across sessions.
3) Human owner activates policy on dashboard
Open the onboarding link from the agent.
Then:
- connect OKX wallet
- sign owner actions
- register/link agent
- set/activate spend policy (
perTxLimit,dailyBudget, allowlist, approval threshold)
At this point your agent is linked and policy-gated.
4) Execute first policy-gated payment
curl -X POST https://api.usezenithpay.xyz/pay \
-H "Authorization: Bearer $ZENITHPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentAddress": "0xYOUR_AGENT",
"serviceUrl": "https://api.usezenithpay.xyz/sell/agent-intel",
"maxAmount": "0.01",
"intent": "First policy-gated x402 payment test"
}'Possible outcomes:
approvedwithtxHashpendingwithapprovalIdif above thresholdblockedwith reason if policy hard-limit fails
5) Verify payment and audit state
Check:
GET /ledgerfor payment recordsGET /limitsfor active policy stateGET /wallet/balancefor remaining daily budget and wallet balances
Example balance check:
curl -s "https://api.usezenithpay.xyz/wallet/balance?address=0xYOUR_AGENT"6) Move to persistent MCP usage
After successful onboarding, use the MCP tools directly in your agent:
zenithpay_get_limitszenithpay_balancezenithpay_verify_merchantzenithpay_pay_servicezenithpay_ledger
Continue with:
Authenticationfor integration modesREST APIfor endpoint detailsMCP Serverfor persistent agent tools