Observed since 21 Oct, 11:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xshae/glide-gateway
Middleware that verifies World ID and unlocks payments for human-backed agent requests.
Middleware that verifies World ID and unlocks payments for human-backed agent requests.
The internet wasn't built for machines. APIs can't tell if a request comes from a real human or a bot. Glide sits in front of any API and enforces a 3-tier access model based on proof of humanity — powered by World ID, x402 payments, and XMTP audit receipts.
In the agentic economy, APIs are flooded by autonomous agents. Traditional "Pay-Per-API" models create a "Bot Tax" for humans: you shouldn't have to pay for every single request once you've proven you're a human person. Simultaneously, bots should pay to prevent spam and resource exhaustion.
Glide solves this by:
Glide enforces a 3-Tier Access Model directly at the middleware layer:
| Tier | Requirement | Priority | Cost | UX Effect |
|---|---|---|---|---|
| BOT | No World ID | Low | $1.00 USDC | 2000ms Throttle |
| HUMAN | World ID (Proof of Personhood) | High | $0.00 | <50ms Latency |
| PREMIUM | World ID + x402 Payment | Instant | $0.50 USDC | <10ms + Ultra Quality |
.
├── src/
│ ├── index.ts # Main Gateway entry (Express + x402 Resource Server)
│ ├── config.ts # Environment & Pricing configuration
│ ├── db.ts # SQLite layer for transaction persistence
│ ├── agentkit.ts # World ID AgentKit hooks & extensions
│ ├── middleware/
│ │ └── glide.ts # THE CORE: 3-tier access control logic
│ └── services/
│ └── xmtp.ts # Fire-and-forget Audit delivery system
├── glide/ # Next.js Dashboard & Landing Page
├── scripts/ # End-to-end demo simulations (Bot/Human/Premium)
└── README.md # You are here
The heart of Glide is the glideMiddleware which resolves the access tier before the request even reaches your business logic.
The system inspects incoming HTTP headers to determine the request's "DNA":
function resolveTier(req: Request): GlideTier {
const hasWorldId = !!req.headers["x-world-id-proof"];
const hasPaid = !!req.headers["x-payment-verified"];
if (hasWorldId && hasPaid) return "premium";
if (hasWorldId) return "human";
return "bot";
}
Once the tier is resolved, Glide applies the policy (throtlling, payment gating, or instant passthrough):
@x402/express server. In demo mode, it applies a botDelayMs (default 2s) to simulate resource throttling.Every paid or human-verified transaction generates a structured audit receipt sent via XMTP. This allows human owners to monitor what their autonomous agents are doing in real-time.
Glide uses @xmtp/agent-sdk to deliver JSON payloads:
{
"type": "AGENT_TRANSACTION",
"merchant": "AgenticStore_v1",
"cost": "1.00",
"currency": "USDC",
"status": "SETTLED",
"short_code": "xJ8-7k2P1",
"revoke_url": "https://gateway.glide.com/revoke?code=xJ8-7k2P1"
}
The revoke_url included in the XMTP message allows a human to instantly revoke an agent's access token stored in Glide's SQLite database. If a token is revoked, the /premium-data endpoint will reject all subsequent requests from that agent.
Glide is designed to be developer-first. You can wrap any existing API endpoint in less than 5 minutes.
Install Glide:
npm install @0xshae/glide-gateway
Mount the Middleware:
import { glideMiddleware } from "@0xshae/glide-gateway";
app.get("/api/ai-generate",
glideMiddleware({
requireWorldId: true,
fallback: "pay",
botDelayMs: 2000
}),
(req, res) => {
// Your actual business logic reached after identity/payment verification
const { glideTier } = req as any;
res.json({ message: `Access granted for ${glideTier}` });
}
);
XMTP_RECIPIENT_ADDRESS to be different from the XMTP_WALLET_KEY address to avoid self-messaging loops.
.env.Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@worldcoin/agentkitEnvironment{
"local_name": "@worldcoin/agentkit",
"alias": false,
"peer_metadata": null
} | ^0.1.0 | runtime |
@x402/coreEnvironment{
"local_name": "@x402/core",
"alias": false,
"peer_metadata": null
} | ^2.8.0 | runtime |
@x402/evmEnvironment{
"local_name": "@x402/evm",
"alias": false,
"peer_metadata": null
} | ^2.8.0 | runtime |
@x402/expressEnvironment{
"local_name": "@x402/express",
"alias": false,
"peer_metadata": null
} | ^2.8.0 | runtime |
@x402/fetchEnvironment{
"local_name": "@x402/fetch",
"alias": false,
"peer_metadata": null
} | ^2.8.0 | runtime |
@xmtp/agent-sdkEnvironment{
"local_name": "@xmtp/agent-sdk",
"alias": false,
"peer_metadata": null
} | ^2.2.0 | runtime |
better-sqlite3Environment{
"local_name": "better-sqlite3",
"alias": false,
"peer_metadata": null
} | ^11.0.0 | runtime |
dotenvEnvironment{
"local_name": "dotenv",
"alias": false,
"peer_metadata": null
} | ^16.4.0 | runtime |
expressEnvironment{
"local_name": "express",
"alias": false,
"peer_metadata": null
} | ^4.21.0 | runtime |
nanoidEnvironment{
"local_name": "nanoid",
"alias": false,
"peer_metadata": null
} | ^3.3.7 | runtime |
viemEnvironment{
"local_name": "viem",
"alias": false,
"peer_metadata": null
} | ^2.47.6 | runtime |
@types/better-sqlite3Environment{
"local_name": "@types/better-sqlite3",
"alias": false,
"peer_metadata": null
} | ^7.6.0 | development |
@types/expressEnvironment{
"local_name": "@types/express",
"alias": false,
"peer_metadata": null
} | ^5.0.0 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^22.0.0 | development |
ts-node-devEnvironment{
"local_name": "ts-node-dev",
"alias": false,
"peer_metadata": null
} | ^2.0.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^5.7.0 | development |
Source distribution
{
"integrity": "sha512-HEadke4MJrJGNwj4X69EdJVruU0Pb5l37H0VB4keCNkAJ/CxzNBcNhWP8/V5tbuIl3N/BRI/diap3MsiK1FJaw==",
"shasum": "0b878167f7336971ce0c0c46f4aa9084a11edc25",
"tarball": "https://registry.npmjs.org/@0xshae/glide-gateway/-/glide-gateway-1.0.0.tgz",
"fileCount": 30,
"unpackedSize": 63865,
"signatures": [
{
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
"sig": "MEUCIQD0MN6pzc/7x8IbscJJ9GCUId7vcGc2DdMGIE/5gkWYJwIgZlv/kQvwvss3xv/P5Tb3sglGCXGza7plxdmZY9CzhJs="
}
]
}Observed since 21 Oct, 11:26 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:bb1b9d6548c5ec79aedf88fe60cf58587cea85d4aff4469beba42fafff864f16