HTTP 402 Payment Gateway for AI Agents (USDC)
turnstile-agent-gateway is an early-stage JavaScript project in the AI payments / x402 ecosystem. It currently has 2 GitHub stars and 0 forks.
Turnstile is a zero-friction, wallet-based API gateway designed for AI agents.
Agents struggle with traditional "Human" commerce:
Turnstile implements the HTTP 402 Payment Required status code correctly for the agent economy.
x-payment-tx header.Authorization: Bearer <token> for subsequent requests.No API Keys. No Accounts. Just Pay & Play.
npm install turnstile-gateway
import { turnstile } from 'turnstile-gateway';
app.get('/premium-resource',
turnstile({
receiver: "0xYourWallet...",
price: "1.0"
}),
(req, res) => {
res.json({ data: "Premium Content" });
}
);
git clone https://github.com/tracychen/turnstile-agent-gateway
cd turnstile-agent-gateway
npm install
Edit server.js and set your RECEIVER_WALLET.
node server.js
# Step 1: Get Rejection
curl -i http://localhost:3001/api/ace-insight
# Step 2: Pay 1.0 USDC (Base Sepolia) & Get TX Hash
# Step 3: Exchange TX for Session Token
curl -i -H "x-payment-tx: 0x..." http://localhost:3001/api/ace-insight
# Step 4: Use Session Token (Free Access for 1h)
curl -i -H "Authorization: Bearer <token>" http://localhost:3001/api/ace-insight
It turns every API endpoint into a vending machine. Agents can "buy" capabilities (computation, storage, data) from each other instantly. With Session Tokens, we move from "Pay-Per-Request" to "Pay-Per-Session", enabling real SaaS models for bots.
Your AI trading terminal assistant for US stocks, commodities, forex, and crypto.
The agent-native LLM router for autonomous agents. 55+ models (8 free), <1ms local routing, USDC payments on Base & Solana via x402.
A local-first AI agent with persistent memory, emotional intelligence, and a peer-to-peer skills economy.
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.