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

@ordlibrary/create-x402

v0.1.0

Published

Create and deploy your own X402 Solana AI agents

Readme

Create X402 - Build & Deploy Solana AI Agents

The easiest way to create, customize, and deploy Solana AI agents

npm version License: MIT

🚀 Quick Start

Create your first X402 agent in under 2 minutes:

bun create x402

Or with npm/npx:

npx @elizaos/create-x402

📦 What is X402?

X402 is a powerful framework for building Solana AI agents with:

  • 🤖 Multi-Provider AI - Google Gemini, OpenAI, Anthropic, xAI Grok
  • ⛓️ Solana Integration - Built-in Helius RPC, Jupiter DEX, Metaplex NFTs
  • 🎨 Content Creation - AI image, video, 3D, and music generation
  • 💬 Social Platforms - Twitter, Discord, Telegram automation
  • 🚀 One-Click Deploy - Railway, Vercel, Render, Fly.io
  • 📊 Web Dashboard - Manage agents from beautiful UI

🏗️ Agent Types

1. Trading Agent

Automated Solana trading with risk management

  • Jupiter DEX integration
  • Real-time market analysis
  • Position management
  • Risk controls

2. Content Creator

AI-powered media generation

  • Images (FAL, Stability, Runway)
  • Videos (Kling, Veo, Hunyuan)
  • 3D models (Tripo3D, Trellis)
  • Music & audio (ElevenLabs, MMAudio)

3. Social Media Agent

Autonomous social engagement

  • Twitter posting & replies
  • Discord community management
  • Telegram bot interactions

4. Developer Agent

Code generation & deployment

  • GitHub integration
  • E2B sandboxing
  • Vercel deployments
  • Code reviews

5. Custom Agent

Full X402 capabilities - build anything!

🎯 Features

Multi-Provider AI

// Automatically uses best provider MODEL_PROVIDER=gemini // or openai, anthropic, xai GEMINI_MODEL=gemini-2.5-flash GEMINI_THINKING_ENABLED=true


### Solana Integration

// Helius RPC with DAS API
HELIUS_API_KEY=your-key
HELIUS_RPC_URL=https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}

// Built-in wallet
SOLANA_PRIVATE_KEY=your-private-key

One-Command Deployment

# Deploy to Railway
create-x402 --deploy railway

# Deploy to Vercel
create-x402 --deploy vercel

# Deploy to Render
create-x402 --deploy render

📚 Usage

Interactive CLI

bun create x402

Follow the prompts:

  1. Choose agent name
  2. Select agent type
  3. Configure API keys
  4. Choose deployment platform
  5. Deploy! 🚀

Programmatic API

import { createX402Agent } from '@elizaos/create-x402';

await createX402Agent({
  name: 'my-trading-agent',
  type: 'trading',
  deployment: 'railway',
  apiKeys: {
    gemini: 'your-gemini-key',
    helius: 'your-helius-key',
  }
});

🔑 Required API Keys

Essential (Free Tier Available)

  • Google Gemini - https://aistudio.google.com/app/apikey
  • Helius - https://helius.dev (Solana RPC)

Optional Providers

  • OpenAI - https://platform.openai.com/api-keys
  • Anthropic - https://console.anthropic.com/
  • xAI Grok - https://console.x.ai

Agent-Specific

Trading Agent:

  • Solana private key (for trading)

Content Creator:

  • FAL AI - https://fal.ai
  • Runway - https://runwayml.com
  • Stability AI - https://platform.stability.ai

Social Agent:

  • Twitter API - https://developer.twitter.com
  • Discord Bot Token - https://discord.com/developers
  • Telegram Bot Token - https://t.me/botfather

🏗️ Project Structure

my-x402-agent/
├── src/
│   ├── character.ts      # Agent personality & config
│   ├── index.ts          # Entry point
│   └── plugin.ts         # Custom plugins
├── .env                  # API keys & config
├── package.json
├── tsconfig.json
└── railway.toml          # Deployment config

⚙️ Configuration

Environment Variables

# AI Provider
GEMINI_API_KEY=your-key
MODEL_PROVIDER=gemini

# Blockchain
HELIUS_API_KEY=your-key
SOLANA_PRIVATE_KEY=your-key

# Database (optional)
POSTGRES_URL=postgresql://...

# Logging
LOG_LEVEL=info

Character Customization

Edit src/character.ts:

export const character: Character = {
  name: 'YourAgent',
  plugins: [
    '@elizaos/plugin-sql',
    '@elizaos/plugin-google-genai',
    '@elizaos/plugin-solana-agent-kit',
  ],
  system: `You are a helpful AI agent...`,
  bio: ['Expert in Solana', 'AI-powered'],
};

🚀 Deployment

Railway (Recommended)

cd my-x402-agent
railway login
railway up

Vercel

cd my-x402-agent
vercel login
vercel

Render

cd my-x402-agent
render login
render deploy

Fly.io

cd my-x402-agent
flyctl auth login
flyctl deploy

📊 Web Dashboard

Access the X402 Dashboard to manage your agents:

bun x402 dashboard

Features:

  • 📈 Agent analytics & metrics
  • ⚙️ Configuration management
  • 🔄 Real-time monitoring
  • 💬 Message history
  • 💰 Revenue tracking

🔧 Advanced Usage

Custom Plugins

// src/plugin.ts
import { Plugin } from '@elizaos/core';

export const myPlugin: Plugin = {
  name: 'my-custom-plugin',
  actions: [/* ... */],
  providers: [/* ... */],
  services: [/* ... */],
};

Multi-Agent Setup

// src/index.ts
export const project: Project = {
  agents: [
    { character: tradingAgent },
    { character: socialAgent },
    { character: contentAgent },
  ],
};

Custom Deployment

// deploy.ts
import { X402Deployer } from '@elizaos/create-x402';

const deployer = new X402Deployer({
  platform: 'railway',
  projectName: 'my-agent',
  envVars: { /* ... */ },
});

await deployer.deploy();

🛠️ Development

Local Development

cd my-x402-agent
bun install
bun dev  # Start with hot reload

Build

bun run build

Test

bun test

📖 Examples

Trading Bot

bun create x402 --template trading

Content Creator

bun create x402 --template content

Social Agent

bun create x402 --template social

🤝 Support

📄 License

MIT License - see LICENSE file for details

🙏 Credits

Built with:


WebsiteDocsDiscord