Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I built an MCP server where AI agents pay for their own compute in USDC

Описание и применение

Создан сервер MCP, где AI‑агенты оплачивают вычисления в USDC через один HTTP‑запрос, устраняя необходимость в API‑ключах и OAuth.

Задача

Agents can browse docs and call APIs but cannot perform checkout; need a way for AI agents to pay for compute without traditional payment flows.

Результат

Implemented a payment flow where AI agents pay for compute in USDC via a single HTTP round-trip, eliminating the need for API keys or OAuth, and ensuring idempotent fulfillment and privacy compliance.

Рабочий процесс

  • 1. Agent POST /v1/agent/generate with model and prompt
  • 2. Server responds 402 Payment Required with x-payment-requirements header (amount, currency, chain, payTo)
  • 3. Agent signs USDC transfer to payTo address
  • 4. Agent retries request with X-PAYMENT header containing signature
  • 5. Server verifies payment, fulfills request, returns 200 with result URL (hosted 48h)

Доказательства

Agents can browse docs and call APIs, but they can't do checkout. No credit card form, no OAuth dance, no "verify your email".

Источник

POST /v1/agent/generate {model, prompt} ← 402 Payment Required

Источник

x-payment-requirements: {amount: "400000", currency: USDC, chain: base, payTo} → agent signs USDC transfer, retries with X-PAYMENT header ← 200 + result URL (hosted 48h, auto-deleted)

Источник

  • Дата записи: 2026-10-09T05:41:19.272Z