ChainPe Docs

Introduction

ChainPe — x402 USDC payments and ERC-8004 reputation for AI agents on Avalanche

ChainPe

ChainPe is payment + reputation infrastructure for the Avalanche agent economy.

Providers monetize any HTTP API (or AI agent) per request in USDC with one command. AI agents discover, pay for, and rate those services autonomously. A non-custodial facilitator settles on Avalanche C-Chain in ~1–2 seconds, and every paid call builds portable on-chain ERC-8004 reputation.

The core insight

You build an AI agent and it needs to call a paid API. What do you do today? You hardcode an API key. You prepay a subscription. You pray it doesn't leak.

There is no way for the agent to pay per call autonomously — and no way for it to know which provider to trust. The missing layer is payment + reputation rails built for machines: pay-per-request, settled in under a second, with portable on-chain trust, and cheap enough that a $0.01 call is not eaten by fees.

ChainPe is that layer, on Avalanche.

Payments in three lines

import { ChainPe } from '@chainpeavax/sdk'

const cp = new ChainPe({ privateKey: process.env.PRIVATE_KEY!, network: 'avalanche' })
const res = await cp.fetch('https://api.example.com/paid')  // auto-pays a 402 in USDC
const data = await res.json()

cp.fetch is a drop-in fetch replacement. On a 402 Payment Required response it signs a USDC payment (EIP-3009), retries, and returns the successful response. The agent never needs AVAX — the non-custodial facilitator pays gas.

Key components

ComponentDescription
ChainPeRegistryOn-chain registry of x402-gated services. Providers register; agents discover. Keyed by keccak256(developer, name).
ERC-8004 ReputationPortable agent identity + reputation. Every paid call can build score; self-feedback is blocked on-chain.
PolicyVaultProgrammable, gasless spending policy. Owners set per-call caps, daily limits, and allowlists. The chain enforces every constraint.
x402 ProxyThe @chainpeavax/cli package starts a payment-gated reverse proxy in front of any backend. No code changes to the backend.
FacilitatorNon-custodial x402 verify/settle service that submits payer-signed USDC transfers and pays Avalanche gas.
IndexerWatches on-chain events → Postgres → O(1) REST discovery and reputation API.
DashboardProvider dashboard at /dashboard: sign in with your wallet to see your services, USDC payments, buyers and ERC-8004 reputation.

ChainPe vs traditional approaches

FeatureAPI Keys / StripeChainPe
Agent can sign up autonomouslyNo — requires a humanYes
Pay per single callNo — subscriptions onlyYes
Provider knows counterpartyNo — anonymousYes — on-chain identity (ERC-8004)
Trust is portable across appsNo — locked to one platformYes — cross-app, cross-chain
Agent spending capped on-chainNoYes — PolicyVault
Agent needs native gas token—No — facilitator covers AVAX gas
Settlement timeVaries (card fraud windows)~1–2 seconds, deterministic finality
Settlement cost2–3% card feeSub-cent on Avalanche

Who ChainPe is for

Merchants (API sellers / providers)

You have an API, an LLM agent, or any HTTP service that produces value. You want to monetize it per-call without API keys, subscriptions, or credit card integrations. You run chainpe init && chainpe start && chainpe register and the x402 proxy gates each request. You receive USDC directly to your wallet — no intermediary holds funds.

AI Agent Builders (buyers)

You build autonomous agents that call external services. You want those agents to pay for what they use, without hardwired API keys that can leak, and with a way to discover trustworthy services ranked by real on-chain reputation. You install @chainpeavax/sdk or @chainpeavax/ai-tools and your agent gains the ability to discover, pay, and rate services in the same loop.

End Users / Operators

You deploy an agent on behalf of users and want fine-grained control over how much it can spend. You deploy a PolicyVault, deposit USDC, set per-call caps and daily limits, and grant the agent a session key. If the agent tries to exceed a limit, the Avalanche chain rejects the transaction outright — not a backend check, the chain.

Infrastructure, not a single app

ChainPe is infrastructure. Claude/MCP is just one client. The same payment + reputation core powers:

SurfacePackageDescription
SDK@chainpeavax/sdkPayments + reputation in 3 lines for any Node/TS project
Agent tools@chainpeavax/ai-toolsVercel AI SDK + LangChain tool adapters
CLI@chainpeavax/cliProvider proxy + consumer fetch/discover commands
Claude walletchainpe-wallet-mcpMCP extension — Claude gets an Avalanche x402 wallet
Agent SDK@chainpeavax/agentStandalone LLM agent loop that discovers and pays
Dashboardapps/avalanche-dashboardProvider dashboard, served at /dashboard by chainpe-cloud
Facilitatorservices/chainpe-facilitatorNon-custodial x402 verify/settle (Railway-deployed)
Indexerservices/chainpe-indexerEvents → Postgres → O(1) REST API

Live on Avalanche C-Chain

ChainPeRegistry: 0x2a589f1e4e3Cd0A3ee986cec5202aF3760E3170E (verified, mainnet)

Provider dashboard: /dashboard

Facilitator: https://chainpe-facilitator-production-000a.up.railway.app (x402 verify / settle)

Next steps

On this page