ChainPe Docs
Getting started

Getting Started

Getting Started

Welcome to ChainPe. This section walks you from zero to a working paid API call on Avalanche C-Chain in a few minutes.

What you will build

By the end of this section you will have:

  1. Installed the @chainpeavax/sdk package
  2. Created a ChainPe client with a funded Avalanche C-Chain wallet
  3. Made a real USDC micropayment to a registered API and received a response
  4. Optionally registered your own service on-chain

Prerequisites

RequirementNotes
Node.js 18+The SDK uses native fetch and ES modules
A funded Avalanche C-Chain walletYou need a small amount of USDC on Avalanche C-Chain
A private keyThe SDK signs EIP-3009 USDC authorizations client-side

Getting USDC and AVAX

  • AVAX (for gas, if running your own transactions): AVAX is available on major exchanges.
  • USDC (for paying APIs on mainnet): USDC is available on major CEXes and bridges (e.g., Stargate).

The non-custodial facilitator pays AVAX gas on your behalf when you make x402 payments, so agents only need USDC in their wallet, not AVAX.

Sections

  • Installation — npm/pnpm install commands for all packages
  • Quickstart — end-to-end: make a paid call in 5 minutes
  • First Payment — detailed walkthrough of the USDC micropayment flow

Choosing the right entry point

Use caseStart here
Using a paid API from your own TypeScript/JavaScript codeQuickstart using @chainpeavax/sdk
Building a Vercel AI SDK agent that pays for servicesAI Tools
Building a LangChain agentAI Tools
Using Claude to pay for APIs via MCPInstall chainpe-wallet-mcp per the README
Monetizing your own APIMerchant Registration
Running the services locallyDeployment Overview

On this page