{
  "markdown": "# Wintergreen x402 Content Broker\n\nThe Wintergreen x402 Content Broker is production payment infrastructure for the agent economy: a machine-facing storefront where AI agents discover resources, pay per-request on-chain, and receive verified delivery. It is the merchant side of the x402 micro-payment protocol. Where Cloudflare's Kitesurf is a machine-facing browser, this is a machine-facing storefront — built for crawlers and clients, not eyeballs: discovery through `/.well-known/x402` and `agent-card.json`, priced invoices instead of shopping carts, on-chain settlement instead of checkout, a signed response instead of a rendered page.\n\nThe flow is end to end and machine-native: an agent requests an endpoint, receives a priced invoice in USDC, pays on-chain on Base (`eip155:8453`) through Coinbase Developer Platform facilitators, and receives the resource — with every transaction appended to the append-only `receipts/` log. Payer, amount, endpoint, latency, and settlement hash are recorded per accepted outcome, and the on-chain settlement record is the independent verifier. The `x402_trust` submodule publishes independent, verifiable trust scores so agents can assess an endpoint before they spend.\n\nLive at [x402.wintergreen.uk](https://x402.wintergreen.uk) (health check: `{\"status\":\"healthy\",\"x402_enabled\":true,\"network\":\"eip155:8453\"}`), brokered under the [x402scan](https://x402scan.com) Bazaar listing. Status is honest and measured: one accepted paid outcome to date — $0.02 USDC on 2026-08-07, delivered in 1,625 ms with HTTP 200 — against 6,722 discovery events from agent crawlers. Payments are real, and adoption is in progress; every number above traces to the receipt log.\n\n> Payments are real. The broker accepts live x402 payments (ETH/USDC via Coinbase Developer Platform facilitators), serves paid content, and appends every transaction to an immutable receipt log.\n\n## What it does\n\nx402 is a payment protocol for AI agents: an agent requests an endpoint, gets a priced invoice, pays on-chain, and receives the resource. This broker is a full reference implementation of the **merchant side**:\n\n1. **Discovery** — free catalog + `/.well-known/x402` fan-out so agent crawlers find the storefront.\n2. **Pricing** — per-endpoint invoices ($0.01–$0.25) enforced at the protocol layer.\n3. **Settlement** — CDP facilitator JWT auth, on-chain payment verification, idempotent fulfillment.\n4. **Content** — quant methodologies, AI prompt packs, and live edge-data endpoints.\n5. **Receipts** — every paid interaction appended to `receipts/` (append-only, probe history + settlement log).\n6. **Trust** — the `x402_trust` submodule computes independent, verifiable trust scores for endpoints.\n\n## Architecture\n\n```mermaid\nflowchart LR\n    A[Agent / client] -->|1. GET /api/v1/...| B[x402 Server<br/>server/x402_server.py]\n    B -->|2. invoice: price + pay-to| A\n    A -->|3. on-chain payment| C[(EVM chain)]\n    C -->|4. facilitator verify| B\n    B -->|5. signed response| A\n    B --> R[(receipts/ append-only)]\n    B --> T[x402_trust submodule<br/>trust scores]\n```\n\n**Live endpoint surface** (see module docstring for full list):\n\n| Endpoint | Price | Type |\n|----------|-------|------|\n| `/` `/api/v1/catalog` `/health` | free | Discovery / ops |\n| `/.well-known/x402` | free | Bazaar fan-out |\n| `/api/v1/search` | $0.01 | Search |\n| `/api/v1/prompts/{id}` | $0.05 | Single prompt |\n| `/api/v1/prompts/category/{c}` | $0.10 | Category bundle |\n| `/api/v1/prompts/pack` | $0.25 | Full methodology pack |\n| `/api/v1/quant/*` | $0.01–$0.02 | Live edge-data endpoints |\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|-----------|\n| Payment protocol | [x402](https://github.com/BuildersGuild/x402) (`x402[fastapi,evm]`) |\n| Server | Python FastAPI + uvicorn |\n| Settlement | Coinbase Developer Platform facilitators (JWT auth, per-endpoint keys) |\n| Storage | JSON receipt logs + trust score store |\n| Submodule | [x402-trust](https://github.com/wintergreen-ventures/x402-trust) (PyPI-published trust scoring) |\n\n## Setup\n\n### Prerequisites\n\n- Python 3.11+\n- An EVM wallet with funds for gas (merchant)\n- CDP facilitator credentials (optional — graceful fallback to free mode)\n\n### Run locally\n\n```bash\ngit clone --recurse-submodules https://github.com/wintergreen-ventures/x402-content-broker.git\ncd x402-content-broker\n\npip install \"x402[fastapi,evm]\" uvicorn\n\n# Configure (never commit these)\ncp .env.example .env\n#   X402_PAY_TO=0x<your_wallet>\n#   X402_PUBLIC_URL=http://localhost:8000\n#   CDP_API_KEY_NAME=...\n#   CDP_API_KEY_PRIVATE_KEY=...\n\npython server/x402_server.py\n```\n\nVerify:\n\n```bash\ncurl http://localhost:8000/health\ncurl http://localhost:8000/.well-known/x402\n```\n\n## Repository Layout\n\n```\n├── server/\n│   ├── x402_server.py       # FastAPI app: catalog, payment flow, fulfillment\n│   ├── quant_handlers/      # paid quant edge-data endpoints\n│   ├── quant_live.py        # live edge computation\n│   ├── weather_edge.py      # weather forecast edge endpoints\n│   ├── polymarket_edge.py   # Polymarket signal endpoints\n│   ├── mcp_server.py        # MCP adapter (agent tools)\n│   ├── trust_endpoints.py   # trust score API\n│   └── static/              # landing, pay, trust, agent-card, llms.txt\n├── scripts/\n│   ├── start_x402.py        # production launcher\n│   ├── payment_simulator.py # offline payment simulation\n│   ├── probe_harness.py     # end-to-end agent probe\n│   └── restart_x402.py      # watchdog restart\n├── receipts/                # append-only settlement + probe history\n├── content/                 # prompt packs + methodology catalog\n├── telemetry/               # usage metrics\n├── marketing/               # storefront assets\n└── x402_trust/              # submodule → x402-trust\n```\n\n## Receipt Discipline\n\nEvery paid interaction is appended to `receipts/probe_history.jsonl` and the\nsettlement log — timestamps, endpoint, price, and payment IDs. The repo\ntreats receipts as append-only evidence; `receipts/settle-log.jsonl` is\ngitignored (contains live payment data).\n\n## License\n\nMIT — see [LICENSE](LICENSE). The `x402_trust` submodule has its own MIT\nlicense ([x402-trust](https://github.com/wintergreen-ventures/x402-trust)).\n",
  "bytes": 6201,
  "sha": "c59622a15a6cd9d1546c0c2b974316eda54b0d20307173dd173843c5f6e7a353",
  "repo_slug": "wintergreen-ventures/x402-content-broker",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_uk_wintergreen_financial_data_38b8269c/readme"
}