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

CapabilityDescriptionSDK MethodBilling
Multi-chain RPCQuery blockchain state across 26 ecosystems, 44 networksclient.call()Credit prepurchase
AI Model InferenceCall multiple AI models with unified interfaceclient.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.

ApproachBest forNotes
SDK (recommended)Agent developmentHandles auth, payment, retries automatically
Raw HTTP (curl)Debugging, understanding protocolMust handle auth and payment manually
npm install @zan_team/x402 viem
import { 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 dataNode Service
AI model inferenceAI Models
BothQuick 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

ConceptDescription
Wallet = IdentitySIWE (EVM) or SIWS (Solana) signature proves wallet ownership — no registration needed
x402 ProtocolHTTP 402 Payment Required — gateway requests USDC payment, SDK signs automatically
CreditsPrepurchased units for RPC calls; deducted per method weight
Rolling SettlementAI billing model: first call is free, each subsequent call settles the previous call's token cost
Auto-PaymentSDK 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

DocumentDescription
Quick StartZero to first call in 3 minutes
x402 PaymentHow payment works under the hood
Node ServiceMulti-chain RPC guide (26 ecosystems, 44 networks)
AI ModelsAI model inference with rolling settlement
SDK ReferenceFull API reference for @zan_team/x402
Service DiscoveryLLM-optimized endpoints for agent self-navigation

Links



Did this page help you?