Skip to main content
The Zhentan server exposes a REST API used by the client and agent to manage the transaction lifecycle — from queueing and risk scoring to execution and portfolio data.

Base URL

Authentication

Every route except the public reads (/portfolio, /tokens, /notifications, /health) requires a bearer token:
  • Agent calls authenticate with the shared AGENT_SECRET. The server refuses to boot without it.
  • Client calls authenticate with a Privy identity token (JWT), verified against PRIVY_JWT_VERIFICATION_KEY; the caller is scoped to their own Safe.
  • /payout additionally requires the x-admin-key header (ADMIN_API_KEY).
  • /runtime uses its own dedicated bearer token (RUNTIME_API_TOKEN) and fails closed — every runtime endpoint answers 503 when the token is unset.
For local development without an agent, DEV_OPEN=1 disables authentication; it is refused at boot when NODE_ENV=production.

Endpoints

Live API playground coming soon. You’ll be able to test endpoints directly from this page.