Introduction
ZAN Services for AI Agents
Overview
ZAN provides two core services for AI agents through ZANx402:
- ZAN Node Service — JSON-RPC proxy across 26 ecosystems and 44 networks
- ZAN AI Service (ZAN Router) — Multi-model AI inference with per-token billing
Agents authenticate with a crypto wallet (SIWE/SIWS), pay with on-chain USDC via the x402 protocol, and call services through the SDK. No account registration, no API keys — fully autonomous operation.
Try it now → Visit ZANx402 to experience ZAN Services via x402 directly in your browser.
What agents can do
| Capability | Description | SDK Method | Billing |
|---|---|---|---|
| Multi-chain RPC | Query blockchain state across 26 ecosystems, 44 networks | client.call() | Credit prepurchase |
| AI Model Inference | Call multiple AI models with unified interface | client.chat() | Per-token rolling settlement |
Integration path
The SDK is the recommended (and required) integration path. It encapsulates wallet signature authentication, x402 on-chain payment, and automatic retry logic — operations that involve cryptographic signing and blockchain interaction.
| Approach | Best for | Notes |
|---|---|---|
| SDK (recommended) | Agent development | Handles auth, payment, retries automatically |
| Raw HTTP (curl) | Debugging, understanding protocol | Must handle auth and payment manually |
npm install @zan_team/x402 viemimport { createX402Client } from '@zan_team/x402';
const client = await createX402Client({
gatewayUrl: 'https://x402.zan.top',
privateKey: process.env.PRIVATE_KEY as `0x${string}`,
autoPayment: true,
preAuth: true,
});
// RPC: query blockchain data
const block = await client.call('eth', 'mainnet', 'eth_blockNumber');
// AI: call a model
const response = await client.chat('deepseek-v4-flash', {
messages: [{ role: 'user', content: 'What is x402?' }],
});Choose your path
| Your agent needs... | Go to |
|---|---|
| Multi-chain blockchain data | Node Service |
| AI model inference | AI Models |
| Both | Quick Start |
How it works
Agent (SDK) x402 Gateway Facilitator
│ │ │
│────── SIWE/SIWS sign ───────▶│ │
│◀─────── JWT token ───────────│ │
│ │ │
│────── client.call() ────────▶│───── forward to ZAN ─────▶│
│◀───────── result ────────────│◀─────── response ─────────│
│ │ │
│ [credits exhausted] │ │
│────── 402 → auto-pay ───────▶│ │
│ │───── verify payment ─────▶│
│ │◀─────── valid ────────────│
│ │───── settle on-chain ────▶│
│◀──── credits topped up ──────│ │
│ │ │
│─────── retry call ──────────▶│────── forward to ZAN ────▶│
│◀───────── result ────────────│◀────── response ──────────│
Key concepts
| Concept | Description |
|---|---|
| Wallet = Identity | SIWE (EVM) or SIWS (Solana) signature proves wallet ownership — no registration needed |
| x402 Protocol | HTTP 402 Payment Required — gateway requests USDC payment, SDK signs automatically |
| Credits | Prepurchased units for RPC calls; deducted per method weight |
| Rolling Settlement | AI billing model: first call is free, each subsequent call settles the previous call's token cost |
| Auto-Payment | SDK with autoPayment: true handles all 402 challenges transparently |
Supported AI development tools
The SDK works in any Node.js environment. Use it with:
- Claude Code / Cursor / VS Code agents
- LangChain / LlamaIndex tool calls
- AutoGPT / CrewAI autonomous loops
- Custom agent frameworks
- CI/CD pipelines and scripts
Documentation
| Document | Description |
|---|---|
| Quick Start | Zero to first call in 3 minutes |
| x402 Payment | How payment works under the hood |
| Node Service | Multi-chain RPC guide (26 ecosystems, 44 networks) |
| AI Models | AI model inference with rolling settlement |
| SDK Reference | Full API reference for @zan_team/x402 |
| Service Discovery | LLM-optimized endpoints for agent self-navigation |
Links
- ZANx402 Official Site: ZANx402 — Try ZAN Services via x402 instantly
- ZAN Node Service API Reference: https://docs.zan.top/reference/api-instructions
- x402 Protocol Specification: https://x402.org
- SDK Repository: ZANx402-SDK
Updated about 10 hours ago
Did this page help you?
