An AI-powered solana intelligence platform. Pay-per-use with x402 micropayments.
x402-SolIntel-Gateway is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on openai, solana, x402, x402-payment. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like x402-openai-python, x402-openai-typescript, tdm-sdk, Task-router-x402, Ros-X402-Node, dna-x402.
AI-Powered Solana Intelligence with Pay-Per-Use Pricing
SolIntel Gateway is a production-ready platform that demonstrates how x402 micropayments unlock new business models in crypto. Instead of forcing users into expensive monthly subscriptions, we charge $0.02-0.10 per analysis using USDC on Solana.
Traditional crypto intelligence platforms lock users into $50-500/month subscriptions. If you only need to analyze a few tokens per month, you're effectively paying $10-50 per query. This pricing model exists because micropayments haven't been economically viable—credit card fees make it unprofitable to charge $0.02, and Ethereum gas fees cost more than the service itself.
SolIntel Gateway solves this by combining three technologies:
The result is a platform where users pay only for what they use, with 90-98% cost savings compared to traditional subscription models.
Built for the Solana x402 Hackathon 2024.
1. The Subscription Trap
Most crypto analysis platforms force upfront monthly payments regardless of usage. A user making 5 queries per month on a $50 subscription is paying $10 per query. This creates two problems:
2. Micropayments Don't Work (Yet)
Traditional payment rails can't profitably process micro-transactions:
3. Real-Time Settlement Required
AI services have variable costs (OpenAI charges per token) and need instant payment verification to prevent abuse. Traditional payment methods take 2-3 days to settle, breaking the real-time API experience.
The Gap: No way to profitably charge $0.02-0.10 for individual AI queries... until x402 + Solana.
SolIntel Gateway demonstrates that x402 makes previously impossible business models viable:
Economic Viability
Abuse Prevention
User Experience
Six AI intelligence services powered by Anthropic Claude and real-time blockchain data:
| Service | Price | Purpose |
|---|---|---|
| Quick Token Check | $0.02 | Risk scoring and security analysis |
| Trading Signals | $0.03 | AI-powered buy/sell recommendations |
| Wallet Intelligence | $0.05 | Trading performance analysis |
| Code Generator | $0.05 | Solana program code generation |
| Deep Token Analysis | $0.08 | Comprehensive due diligence reports |
| Smart Contract Audit | $0.10 | Security vulnerability detection |
Get the platform running locally in under 5 minutes.
# Clone the repository
git clone https://github.com/yourusername/x402-solintel-gateway.git
cd x402-solintel-gateway
# Install all dependencies using pnpm workspaces
pnpm install:all
# Copy and configure environment variables
cp .env.example .env
Edit .env with your API keys:
# Required: Anthropic API key from https://console.anthropic.com/
ANTHROPIC_API_KEY=sk-ant-your-key-here
# Required: Helius API key from https://www.helius.dev/
HELIUS_API_KEY=your-helius-key-here
# Required: Birdeye API key from https://birdeye.so/
BIRDEYE_API_KEY=your-birdeye-key-here
# Required: Your Solana wallet address for receiving payments
RECIPIENT_WALLET=YourSolanaWalletAddressHere
You'll need three terminal windows:
# Terminal 1: Start Redis
redis-server
# Terminal 2: Start payment facilitator
pnpm dev:facilitator
# Terminal 3: Start API gateway
pnpm dev:gateway
# Terminal 4: Start frontend dashboard
pnpm dev:dashboard
Connect your Phantom or Solflare wallet and try a Quick Token Check.
All payments are in USDC on Solana mainnet.
Fast risk assessment for any Solana token. Returns risk score, top holder distribution, security flags, liquidity analysis, and AI-generated summary.
Use case: Quick screening before investing
AI-powered trading recommendations including buy/sell/hold signal, entry points, take profit targets, stop loss suggestions, and reasoning.
Use case: Quick trading decisions
Analyze any wallet's trading performance. Returns total PnL, win rate, top holdings, trading history, and copy-trade signals.
Use case: Following successful traders
Generate Solana program code with Anchor framework, full implementation, test suite, and deployment instructions.
Use case: Rapid prototyping and learning
Comprehensive due diligence including everything from Quick Check plus historical price analysis, whale tracking, social sentiment, trading volume trends, and PDF export.
Use case: Thorough research before major investments
Security analysis for Solana programs. Returns vulnerability scan, security score, common attack vectors, best practices, and detailed report.
Use case: Before deploying or interacting with smart contracts
Frontend (Next.js 15)
|
v
API Gateway (Express + x402)
|
+-- x402 Payment Middleware
| |
| +-- Returns HTTP 402 if no payment
| +-- Verifies signed transactions
| +-- Enforces payment before AI processing
|
+-- Payment Service --> Facilitator --> Solana Blockchain
| |
| +-- USDC Transfer
| +-- <500ms settlement
| +-- $0.00001 fee
|
+-- Service Factory --> Job Queue (Bull + Redis)
|
v
AI Processing
|
+-- Anthropic Claude
+-- Helius API
+-- Birdeye API
+-- Rugcheck API
Frontend
API Gateway
Payment Facilitator
External Integrations
| Package | Version | Purpose |
|---|---|---|
| Express | 4.21 | API server framework |
| TypeScript | 5.6 | Static typing and safety |
| Bull | 4.12 | Job queue management |
| Redis | Latest | Queue storage and caching |
| @solana/web3.js | 1.95 | Blockchain interaction |
| @anthropic-ai/sdk | 0.71 | Claude AI integration |
| Package | Version | Purpose |
|---|---|---|
| Next.js | 15.5 | React framework |
| React | 19.0 | UI components |
| TypeScript | 5.6 | Type safety |
| TailwindCSS | 3.4 | Styling |
| Solana Wallet Adapter | 0.15 | Wallet integration |
Understanding how x402 micropayments work:
1. Initial Request (No Payment)
User makes API request without payment header:
POST /api/token-check
Content-Type: application/json
{
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
2. Gateway Returns HTTP 402
Server responds with payment requirements:
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"error": "Payment Required",
"message": "This service requires payment: $0.020 USDC",
"payment": {
"recipient": "GatewayWalletAddress",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 20000,
"currency": "USDC",
"invoiceId": "550e8400-e29b-41d4-a716-446655440000",
"timeout": 60
}
}
3. User Signs Transaction
Frontend creates and signs USDC transfer with wallet:
const transaction = new Transaction().add(
createTransferInstruction(
userTokenAccount,
gatewayTokenAccount,
userWallet.publicKey,
20000 // 0.02 USDC in lamports
)
);
const signedTx = await wallet.signTransaction(transaction);
4. Retry with Payment Proof
Frontend retries request with signed transaction:
POST /api/token-check
Content-Type: application/json
X-Payment: eyJpbnZvaWNlSWQiOi4uLiwidHJhbnNhY3Rpb24iOi4uLn0=
{
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
5. Payment Verification
Gateway forwards to facilitator for verification:
6. Process Request
After payment verification:
7. Return Results
HTTP/1.1 200 OK
X-Payment-Response: {"signature":"5kD...","amount":0.02}
Content-Type: application/json
{
"analysis": {
"riskScore": 45,
"holders": 15234,
"aiSummary": "..."
},
"receipt": {
"txSignature": "5kD...",
"timestamp": 1702831200000,
"amount": 0.02
}
}
Development: http://localhost:4021
Production: https://your-domain.com
All paid endpoints require payment via X-Payment header containing base64-encoded payment payload.
Quick token risk assessment.
Request:
{
"address": "TokenMintAddress"
}
Response:
{
"analysis": {
"riskScore": 45,
"holders": 15234,
"topHolders": [...],
"securityFlags": {
"mintAuthority": false,
"freezeAuthority": false
},
"liquidity": {
"usd": 1250000
},
"aiSummary": "..."
},
"receipt": {
"txSignature": "...",
"amount": 0.02,
"timestamp": 1702831200000
}
}
Analyze wallet trading performance.
Request:
{
"address": "WalletAddress"
}
Get AI trading recommendations.
Request:
{
"tokenAddress": "TokenMintAddress"
}
Security analysis for smart contracts.
Request:
{
"programId": "ProgramAddress"
}
Comprehensive token analysis.
Request:
{
"tokenAddress": "TokenMintAddress"
}
Generate Solana program code.
Request:
{
"description": "Create a token staking program",
"type": "anchor"
}
GET /health - Health checkGET /api/jobs/:jobId - Job statusGET /receipts - Payment historyGET /stats - Platform statisticsx402-solintel-gateway/
├── backend/
│ ├── gateway/ # Main API server
│ │ ├── src/
│ │ │ ├── config.ts # Configuration
│ │ │ ├── index.ts # Entry point
│ │ │ ├── integrations/ # External API clients
│ │ │ ├── middleware/ # x402 enforcement
│ │ │ ├── queue/ # Bull worker
│ │ │ ├── routes/ # API routes
│ │ │ ├── services/ # Business logic
│ │ │ └── utils/ # Helpers
│ │ └── package.json
│ └── facilitator/ # Payment settlement
│ └── src/
│ └── index.ts
├── frontend/
│ └── dashboard/ # Next.js app
│ ├── app/ # Pages
│ ├── components/ # React components
│ └── lib/ # Utilities
├── shared/
│ └── types/ # Shared TypeScript types
├── .env.example
├── package.json
└── pnpm-workspace.yaml
# Install dependencies
pnpm install:all
# Build all projects
pnpm build:all
# Build specific workspace
pnpm --filter gateway build
# Clean build artifacts
pnpm clean
# Type checking
pnpm -r tsc --noEmit
backend/gateway/src/services/shared/types/src/index.tsbackend/gateway/src/routes/backend/gateway/src/config.tsfrontend/dashboard/app/# Test all external API connections
./test-apis.sh
For complete deployment instructions, see DEPLOYMENT.md and QUICK_DEPLOY.md.
./cloudflare-build.shfrontend/dashboard/.next/NODE_VERSION=20
NEXT_PUBLIC_GATEWAY_URL=https://your-gateway.up.railway.app
NEXT_PUBLIC_SOLANA_RPC=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY
backend/gatewaybackend/facilitatorCreate Dockerfile:
FROM node:20-alpine
WORKDIR /app
RUN npm install -g pnpm
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
COPY backend/gateway ./backend/gateway
COPY shared/types ./shared/types
RUN pnpm install --frozen-lockfile
RUN pnpm --filter gateway build
CMD ["pnpm", "--filter", "gateway", "start"]
Build and run:
docker build -t solintel-gateway .
docker run -p 4021:4021 --env-file .env solintel-gateway
# Install Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install pnpm
npm install -g pnpm
# Clone and build
git clone https://github.com/yourusername/x402-solintel-gateway.git
cd x402-solintel-gateway
pnpm install:all
pnpm build:all
# Install PM2
npm install -g pm2
# Start services
pm2 start pnpm --name "gateway" -- --filter gateway start
pm2 start pnpm --name "facilitator" -- --filter facilitator start
# Auto-restart on boot
pm2 startup
pm2 save
Option 1: Redis Cloud (Free Tier)
REDIS_URL in environmentOption 2: Self-Hosted
# Install Redis
sudo apt-get install redis-server
# Start service
sudo systemctl start redis
sudo systemctl enable redis
# Verify
redis-cli ping # Should return "PONG"
"ANTHROPIC_API_KEY not set"
Missing or invalid API key. Get one from https://console.anthropic.com/ and add to .env:
ANTHROPIC_API_KEY=sk-ant-your-actual-key-here
"Connection refused on port 6379"
Redis not running. Start it:
# macOS
brew services start redis
# Linux
sudo systemctl start redis
# Verify
redis-cli ping
"HTTP 402 but payment not processing"
"Module not found" errors
Dependencies not installed. Clean install:
rm -rf node_modules
pnpm install:all
CORS errors
Update allowed origins in backend/gateway/src/index.ts:
app.use(cors({
origin: ['http://localhost:3001', 'https://your-domain.com'],
credentials: true,
}));
TypeScript build errors
Clean build artifacts and rebuild:
pnpm clean
pnpm build:all
Contributions welcome! Please follow these guidelines:
git checkout -b feature/improvement)git commit -m "feat: add improvement")git push origin feature/improvement)We use Conventional Commits:
feat: - New featurefix: - Bug fixdocs: - Documentation changesrefactor: - Code refactoringchore: - Maintenance tasksMIT License
Copyright (c) 2024 SolIntel Gateway
Built for Encode Solana Hackathon: Winter Build Challenge 2025
Powered by:
Pay-per-use AI intelligence. No subscriptions. Just Solana.
Drop-in OpenAI Python client with transparent x402 payment support.
Drop-in OpenAI Typescript client with transparent x402 payment support.
Open contract-facing SDK for payable routes and gateway-backed integrations. Thin public surface for authorize, checkout, and session flows.
Task-router-x402 is a Node.js/Express service for orchestrating robots and agents with x402 payment integration.
A ROS 1 (Noetic) package that turns robot capabilities into paid API endpoints - using Solana’s x402 protocol for pay-to-access control — and includes tools for making and verifying payments to external services.
DNA — Payment rails for AI agents. x402 micropayment protocol on Solana. Netting, transfer, stream settlement. Receipt anchoring on-chain.
Your AI trading terminal assistant for US stocks, commodities, forex, and crypto.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
Open Source AI trading agent that operates autonomously across 1000+ markets - Polymarket, Kalshi, Binance, Hyperliquid, Solana DEXs, 5 EVM chains. Scans for edge, executes instantly, manages risk while you sleep. Agent commerce protocol for machine-to-machine payments. Self-hosted. Built on Claude.
The self-improving LLM router that optimize your agentic workflows with every runs, works with any harnesses, any models, any loops.