ZenithPay iconZenithPay

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.xyz

Who 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.md

The skill drives onboarding in one session.

2) Agent runs onboarding automatically

From the skill flow, the agent will:

  1. check for existing ZenithPay config
  2. create agent wallet (POST /wallet/genesis)
  3. request agent name/label and email when needed
  4. save local config
  5. register ZenithPay MCP server using your credentials
  6. return a policy-activation onboarding link for the human owner

Local config written by onboarding

The skill stores credentials in:

~/.zenithpay/config.json

Typical 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:

  • approved with txHash
  • pending with approvalId if above threshold
  • blocked with reason if policy hard-limit fails

5) Verify payment and audit state

Check:

  • GET /ledger for payment records
  • GET /limits for active policy state
  • GET /wallet/balance for 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_limits
  • zenithpay_balance
  • zenithpay_verify_merchant
  • zenithpay_pay_service
  • zenithpay_ledger

Continue with:

  • Authentication for integration modes
  • REST API for endpoint details
  • MCP Server for persistent agent tools

On this page