HOW IT WORKS
AgentGate is 5 layers,
not just payments
x402 is the payment rail — one layer. AgentGate solves the full loop: how does an agent find, pay for, and use an API — and how does a developer monetize one?
5Agent Integrations
MCP · LangChain · CrewAI · SDKs
4Discovery
Marketplace API · Search · Categories
3Payment
x402 · USDC · Base · Solana
2Middleware
Express · Hono · Next.js · 3 lines of code
1Fulfillment
11 live AI endpoints · Your endpoints
1Fulfillment — The Endpoints
The actual AI services that do real work
At the bottom of the stack are real API endpoints — services that accept input and return results. AgentGate runs 11 live endpoints powered by Whisper, Claude, Gemini, and pure Node.js. But any developer can add their own.
try it — this is a real endpoint
curl -X POST https://fulfill.agentgate.online/v1/email-validate \
-H "Content-Type: application/json" \
-d '{"email": "test@gmail.com"}'
# → 402 Payment Required
# This endpoint works. It just needs payment first.
💡These aren't stubs. Every endpoint runs real AI inference or real utility logic. The payment gate is the only thing between you and the result.
2Middleware — The Payment Gate
Add pay-per-call to any existing API in 3 lines
The middleware sits in front of your endpoint and handles the x402 payment flow. When a request comes in without payment, it returns 402 Payment Required. When payment is attached, it verifies and lets the request through.
your-api.ts — that's it, 3 lines
import { paymentMiddleware } from '@agent-gate/middleware/hono';
app.use('/api/translate', paymentMiddleware({
price: '$0.02', // USDC per call
wallet: process.env.MY_WALLET,
}));
// Your handler runs ONLY after payment is verified
app.post('/api/translate', async (c) => {
const { text, to } = await c.req.json();
return c.json({ translated: await translate(text, to) });
});
Works with Express, Hono, and Next.js. Your existing code doesn't change — you just add the middleware.
🔑This is the key insight: sellers don't need to build a billing system, manage API keys, or send invoices. The middleware handles everything. Set a price, set a wallet, deploy.
3Payment — x402 + Facilitator
USDC payments over HTTP, verified on-chain
x402 is Coinbase's open protocol for native HTTP payments. It adds a payment header to standard HTTP requests — no API keys, no accounts, no invoices. AgentGate uses x402 under the hood, but you don't need to understand it to use AgentGate.
the x402 payment flow
# Step 1: Agent calls endpoint (no payment)
POST /v1/transcribe → 402 Payment Required
← Header: price=$0.015, network=base, payTo=0x4C...
# Step 2: Agent signs USDC payment and retries
POST /v1/transcribe
→ Header: X-PAYMENT: <signed USDC transfer>
# Step 3: Facilitator verifies payment on-chain
✓ Payment valid → settle on Base/Solana
# Step 4: Endpoint returns result
← 200 OK: { "transcript": "Hello world..." }
The Facilitator is the payment verifier. It checks that the USDC payment is real before the endpoint runs. AgentGate runs its own facilitator supporting both Base (EVM) and Solana mainnet — unlike the public x402 facilitator which only supports testnet.
⛓️Payments are real USDC on real chains. Not wrapped tokens, not IOUs, not credits. When an agent calls your endpoint, USDC moves to your wallet.
4Discovery — The Marketplace
Agents search for endpoints by capability, price, or category
Before an agent can pay for a service, it needs to find one. The Discovery API lets agents search the marketplace by capability, category, or keyword — and get back endpoint URLs, pricing, and descriptions.
discovery — find what you need
# Search for transcription endpoints
curl https://api.agentgate.online/v1/discover?q=transcribe
{
"endpoints": [{
"url": "https://fulfill.agentgate.online/v1/transcribe",
"description": "Audio → transcript with timestamps",
"category": "audio",
"price_usdc": "0.015",
"active": true
}]
}
# Browse by category
curl https://api.agentgate.online/v1/discover?category=code
# List all categories
curl https://api.agentgate.online/v1/discover/categories
🔍Discovery is what makes AgentGate a marketplace, not just a payment system. Agents don't need hardcoded URLs — they search for capabilities and find the best option.
5Agent Integrations — The Distribution Layer
Let any AI agent framework discover and call endpoints natively
The top of the stack is what agents actually interact with. AgentGate has native integrations for every major agent framework — so agents can discover, pay, and use endpoints without custom HTTP code.
CLI
Init, configure, and register endpoints
npx @dkerpal/agent-gate initDiscovery API
Browse endpoints via REST
curl api.agentgate.online/v1/discoverMCP ServerSoon
Claude Code, Cursor, any MCP client
Coming SoonTypeScript SDKSoon
Full client with x402 payment handling
Coming SoonPython SDKSoon
Client + LangChain + CrewAI tools
Coming Soondiscover and call — it's just HTTP
# 1. Discover endpoints
curl https://api.agentgate.online/v1/discover?category=code
# 2. Call an endpoint (returns 402 — needs x402 payment)
curl -X POST https://fulfill.agentgate.online/v1/email-validate \
-H "Content-Type: application/json" \
-d '{"email": "test@gmail.com"}'
# Agent's x402 client handles payment automatically.
# No API keys. No signup. Just HTTP + USDC.
🤖This is the endgame. An agent that can discover capabilities, pay for them, and use the results — all autonomously. No human signing up for APIs, managing keys, or paying invoices.
The Full Loop
Agent (MCP/LangChain/SDK)
↓ "I need transcription"
Discovery API → finds /v1/transcribe at $0.015
↓ POST with audio file
Middleware → returns 402, price=$0.015
↓ signs USDC payment, retries
Facilitator → verifies payment on Base
↓ payment valid
Endpoint (Whisper) → returns transcript
Total time: ~3 seconds · Cost: $0.015 USDC · No signup · No API key