npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chainpeavax/agent

v2.0.0

Published

ChainPe Agent SDK — Pre-built AI agent with x402 payment capabilities on Avalanche C-Chain

Downloads

162

Readme

@chainpe/agent

Pre-built AI Agent with x402 Payment Capabilities on Avalanche

ChainPe Agent is an AI agent SDK that can discover, pay for, and use monetized API services. Built on the Vercel AI SDK with support for OpenAI and Anthropic.

Installation

npm install -g @chainpe/agent

Or as a library:

npm install @chainpe/agent

Quick Start

Prerequisites

Before you start, you'll need:

  1. LLM API Key - Get a free Groq API key at https://console.groq.com/
  2. AVAX - Available on major exchanges (Coinbase, Binance, Kraken, etc.)
  3. Avalanche Wallet - Generate a new wallet or use existing private key

1. Initialize Configuration

chainpe-agent init

This interactive wizard will ask you for:

  • LLM Mode: Local (Ollama) or Cloud API
  • LLM Provider: Groq (free), OpenAI, Anthropic, or Google Gemini
  • Model selection: Recommended models shown first
  • API key: Your LLM provider API key
  • Avalanche wallet private key: private key (0x…) (for automatic payments)
  • Preferred payment token: USDC

2. Check Status

chainpe-agent status

3. Run Tasks

chainpe-agent run "Find a weather service and get the weather for San Francisco"

Commands

| Command | Description | |---------|-------------| | chainpe-agent init | Interactive setup wizard | | chainpe-agent status | Show config and wallet balance | | chainpe-agent services | List available services | | chainpe-agent run <task> | Execute a task with the agent |

Programmatic Usage

import { ChainPeAgent } from "@chainpe/agent";

// Create agent (reads config from ~/.chainpe/agent.json)
const agent = new ChainPeAgent();

// List available services
const services = await agent.listServices();
console.log(services);

// Run a task
const result = await agent.run(
  "Find a research service and summarize quantum computing",
  {
    maxSteps: 5,
    verbose: true,
    onPayment: (receipt) => {
      console.log(`Paid ${receipt.amount} ${receipt.token}`);
    }
  }
);

console.log(result.text);
console.log(`Total spent: ${result.payments.totalSpent.AVAX} AVAX`);

How It Works

User Task → AI Agent → Discovers Services → Pays via x402 → Gets Response
                ↓
           On-Chain Registry (Avalanche)
  1. Agent receives a task from user
  2. Agent queries on-chain registry for relevant services
  3. Agent calls service, receives 402 Payment Required
  4. Agent signs x402 payment authorization
  5. Service returns data, agent processes and responds

Configuration

The agent stores config in ~/.chainpe/agent.json:

Example: Using Groq (Free Tier)

{
  "llm": {
    "mode": "api",
    "provider": "groq",
    "model": "qwen/qwen3-32b",
    "apiKey": "gsk_..."
  },
  "wallet": {
    "private key": "your twenty five word avalanche private key phrase here...",
    "address": "YOUR_ALGO_ADDRESS..."
  },
  "payment": {
    "preferredToken": "AVAX"
  },
  "network": "avalanche"
}

Example: Using OpenAI

{
  "llm": {
    "mode": "api",
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "sk-..."
  },
  "wallet": {
    "private key": "your twenty five word avalanche private key phrase here...",
    "address": "YOUR_ALGO_ADDRESS..."
  },
  "payment": {
    "preferredToken": "AVAX"
  },
  "network": "avalanche"
}

Example: Using Local Ollama

{
  "llm": {
    "mode": "local",
    "provider": "openai",
    "model": "qwen2.5:7b",
    "apiKey": "ollama",
    "baseURL": "http://localhost:11434/v1"
  },
  "wallet": {
    "private key": "your twenty five word avalanche private key phrase here...",
    "address": "YOUR_ALGO_ADDRESS..."
  },
  "payment": {
    "preferredToken": "AVAX"
  },
  "network": "avalanche"
}

Supported LLMs

  • Groq (Recommended for free tier): llama-3.3-70b, qwen/qwen3-32b
  • OpenAI: gpt-4o, gpt-4-turbo, gpt-3.5-turbo
  • Anthropic: claude-3-5-sonnet, claude-3-opus, claude-3-sonnet
  • Google Gemini: gemini-2.0-flash, gemini-1.5-pro
  • Local (Ollama): Any Ollama model (free, runs locally)

Getting API Keys

  • Groq (Free): https://console.groq.com/ - Fast inference, generous free tier
  • OpenAI: https://platform.openai.com/api-keys
  • Anthropic: https://console.anthropic.com/
  • Google AI: https://aistudio.google.com/app/apikey

Requirements

  • Node.js >= 18
  • LLM API key (Groq recommended for free tier) OR local Ollama installation
  • Avalanche wallet with AVAX (available on major exchanges)

License

MIT