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

HTTP 402 is not reserved for future use anymore: I put a 1-cent paywall on a live API for AI agents

Description and use

The article details a 1‑cent paywall using HTTP 402 and the x402 protocol, enabling AI agents to pay for a single API call without onboarding, using stablecoin on Base.

Problem

Traditional API key models require onboarding and are unsuitable for one‑off AI agent requests, leading to missed payments and high friction.

Outcome

A live API now accepts 1‑cent payments via stablecoin, eliminating onboarding, chargebacks, and merchant identity requirements, making it viable for small operators and AI agents.

Workflow

  • 1. Agent sends request to endpoint without payment header.
  • 2. Server responds 402 with x402 challenge body (payment requirements).
  • 3. Agent signs EIP‑712 authorization for exact amount and retries with X‑PAYMENT header.
  • 4. Server verifies signature via facilitator, settles stablecoin transfer, and returns JSON result.

Evidence

The challenge is public, the paid call costs one cent, and the data behind it is a free CC BY 4.0 dataset.

Source

An agent reads accepts, signs an EIP‑712 authorization for exactly that amount, retries with an X‑PAYMENT header, and gets the JSON.

Source

  • Record date: 2026-09-22T07:45:25.801Z