Spaces:
Running
Running
Nico Zahniser commited on
Commit Β·
a5112d7
1
Parent(s): ecb06f1
Landing page + README for create-agent-gateway
Browse files- README.md +48 -5
- index.html +70 -18
README.md
CHANGED
|
@@ -1,10 +1,53 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: create-agent-gateway
|
| 3 |
+
emoji: π‘οΈ
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# create-agent-gateway
|
| 12 |
+
|
| 13 |
+
A Cloudflare Worker template for pay-per-call agent gateways.
|
| 14 |
+
|
| 15 |
+
Bearer-key auth + mcent pricing + x402 signup + scoped keys + XP leaderboard + MCP server β packaged as a scaffolder so anyone can stand up their own agent API in ~2 minutes.
|
| 16 |
+
|
| 17 |
+
**Repo:** [github.com/walter-grace/create-agent-gateway](https://github.com/walter-grace/create-agent-gateway)
|
| 18 |
+
|
| 19 |
+
**Reference implementation:** [data-label-factory](https://github.com/walter-grace/data-label-factory) β the live gateway using this stack at [data-label-factory.vercel.app/agents](https://data-label-factory.vercel.app/agents).
|
| 20 |
+
|
| 21 |
+
## Quickstart
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
npx create-agent-gateway my-api
|
| 25 |
+
cd my-api
|
| 26 |
+
wrangler kv:namespace create KEYS
|
| 27 |
+
wrangler secret put ADMIN_KEY
|
| 28 |
+
wrangler deploy
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
Replace the `/v1/example` handler in `src/index.ts` with your actual paid tool.
|
| 32 |
+
|
| 33 |
+
## What's in the box
|
| 34 |
+
|
| 35 |
+
- **Bearer-token auth** backed by Workers KV
|
| 36 |
+
- **mcent pricing** (1/1000Β’) β sub-cent calls legible + storable as integers
|
| 37 |
+
- **x402 signup** β strangers pay USDC on Base via Coinbase CDP facilitator
|
| 38 |
+
- **Scoped keys** (`crawl`, `label`, `read`, `all`) for tiered access
|
| 39 |
+
- **XP + leaderboard + badges** via a Durable Object (race-free)
|
| 40 |
+
- **Refund policy** with rate cap to block refund-farming
|
| 41 |
+
- **Agent Readiness** well-known routes (`/llms.txt`, `/.well-known/mcp.json`, `/robots.txt` with Content Signals)
|
| 42 |
+
- **MCP server** at `/mcp` β Claude Desktop / Cursor / Zed install in one config block
|
| 43 |
+
|
| 44 |
+
## Why
|
| 45 |
+
|
| 46 |
+
Agents need:
|
| 47 |
+
1. A way to authenticate β bearer keys beat OAuth dashboards
|
| 48 |
+
2. A balance to draw down β mcents so $0.01 covers 100 calls
|
| 49 |
+
3. A self-serve onramp β x402 so strangers mint keys programmatically
|
| 50 |
+
4. Reputation primitives β XP, levels, badges so markets reward quality
|
| 51 |
+
5. Discoverability β Agent Readiness + MCP so agents find you
|
| 52 |
+
|
| 53 |
+
Stripe, OAuth, and dashboards add friction agents can't traverse. This stack skips all of that.
|
index.html
CHANGED
|
@@ -1,19 +1,71 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>create-agent-gateway</title>
|
| 7 |
+
<style>
|
| 8 |
+
:root { color-scheme: dark; }
|
| 9 |
+
body { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; background: #0b0b0c; color: #e5e5e5; margin: 0; padding: 0; line-height: 1.5; }
|
| 10 |
+
main { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem; }
|
| 11 |
+
h1 { font-size: 2.25rem; letter-spacing: -0.02em; margin: 0 0 .25rem; }
|
| 12 |
+
.tag { color: #a78bfa; font-size: .9rem; text-transform: uppercase; letter-spacing: .12em; }
|
| 13 |
+
.sub { color: #a1a1aa; margin: .5rem 0 2rem; max-width: 60ch; }
|
| 14 |
+
.cmd { background: #18181b; border: 1px solid #27272a; border-radius: 10px; padding: 1rem; font-family: ui-monospace, monospace; font-size: .95rem; white-space: pre; overflow-x: auto; }
|
| 15 |
+
.row { display: flex; gap: .75rem; margin: 1.5rem 0; flex-wrap: wrap; }
|
| 16 |
+
.btn { display: inline-block; padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; font-weight: 600; text-decoration: none; }
|
| 17 |
+
.btn-primary { background: #a855f7; color: #fafafa; }
|
| 18 |
+
.btn-primary:hover { background: #9333ea; }
|
| 19 |
+
.btn-ghost { background: transparent; border: 1px solid #3f3f46; color: #e5e5e5; }
|
| 20 |
+
.btn-ghost:hover { border-color: #71717a; }
|
| 21 |
+
h2 { margin-top: 2.5rem; font-size: 1.25rem; }
|
| 22 |
+
ul { color: #d4d4d8; padding-left: 1.25rem; }
|
| 23 |
+
li { margin: .3rem 0; }
|
| 24 |
+
code { background: #18181b; border: 1px solid #27272a; padding: 1px 6px; border-radius: 4px; font-size: .88em; }
|
| 25 |
+
.why { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 1.25rem 1.5rem; margin-top: 1.25rem; }
|
| 26 |
+
.why p { color: #a1a1aa; }
|
| 27 |
+
footer { margin: 3rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid #27272a; color: #71717a; font-size: .85rem; }
|
| 28 |
+
a { color: #c4b5fd; }
|
| 29 |
+
</style>
|
| 30 |
+
</head>
|
| 31 |
+
<body>
|
| 32 |
+
<main>
|
| 33 |
+
<div class="tag">Cloudflare Worker template</div>
|
| 34 |
+
<h1>create-agent-gateway</h1>
|
| 35 |
+
<p class="sub">Spin up a pay-per-call agent API in ~2 minutes. Bearer-key auth, mcent pricing, x402 crypto onramp, scoped keys, XP leaderboard, MCP server β all packaged as a scaffolder.</p>
|
| 36 |
+
|
| 37 |
+
<div class="cmd">npx create-agent-gateway my-api
|
| 38 |
+
cd my-api
|
| 39 |
+
wrangler kv:namespace create KEYS
|
| 40 |
+
wrangler secret put ADMIN_KEY
|
| 41 |
+
wrangler deploy</div>
|
| 42 |
+
|
| 43 |
+
<div class="row">
|
| 44 |
+
<a class="btn btn-primary" href="https://github.com/walter-grace/create-agent-gateway" target="_blank">View on GitHub β</a>
|
| 45 |
+
<a class="btn btn-ghost" href="https://data-label-factory.vercel.app/how-it-works" target="_blank">See a reference app</a>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<h2>What you get</h2>
|
| 49 |
+
<ul>
|
| 50 |
+
<li>Bearer-token auth backed by Workers KV</li>
|
| 51 |
+
<li>mcent pricing (1/1000Β’) β sub-cent calls stored as integers</li>
|
| 52 |
+
<li>x402 signup β strangers pay USDC on Base via Coinbase CDP facilitator</li>
|
| 53 |
+
<li>Scoped keys (<code>crawl</code>, <code>label</code>, <code>read</code>, <code>all</code>) for tiered access</li>
|
| 54 |
+
<li>XP + leaderboard + badges via a Durable Object (race-free)</li>
|
| 55 |
+
<li>Refund policy with rate cap (blocks refund-farming)</li>
|
| 56 |
+
<li>Agent Readiness well-known routes: <code>/llms.txt</code>, <code>/.well-known/mcp.json</code>, <code>/robots.txt</code> with Content Signals</li>
|
| 57 |
+
<li>MCP server at <code>/mcp</code> β Claude Desktop / Cursor / Zed install with one config block</li>
|
| 58 |
+
</ul>
|
| 59 |
+
|
| 60 |
+
<div class="why">
|
| 61 |
+
<h2 style="margin-top:0;">Why this pattern</h2>
|
| 62 |
+
<p>Agents need (1) auth β bearer keys beat OAuth dashboards, (2) a balance β mcents so $0.01 buys 100 calls, (3) self-serve onramp β x402 so strangers mint keys programmatically, (4) reputation β XP and badges so the market rewards quality, (5) discoverability β Agent Readiness + MCP so agents find you. Stripe and OAuth add friction agents can't traverse. This stack skips all of that.</p>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<h2>Reference implementation</h2>
|
| 66 |
+
<p>The full production version powers <a href="https://data-label-factory.vercel.app/agents" target="_blank">Data Label Factory</a> β a pay-per-call vision labeling + YOLO training API for agents. Source: <a href="https://github.com/walter-grace/data-label-factory/tree/main/agent-gateway" target="_blank">walter-grace/data-label-factory</a>.</p>
|
| 67 |
+
|
| 68 |
+
<footer>MIT licensed. Built with Cloudflare Workers, Durable Objects, KV, and Coinbase CDP.</footer>
|
| 69 |
+
</main>
|
| 70 |
+
</body>
|
| 71 |
</html>
|