deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

Developer's x402 APIs bill AI agents 0.01 USDC per call, no keys or accounts required

A developer has shipped two pay-per-call APIs on the x402 protocol: AI agents settle 0.01 USDC per request on Base via HTTP 402 challenges — working, revenue-free examples of machine-to-machine commerce.

Developer's x402 APIs bill AI agents 0.01 USDC per call, no keys or accounts required

Two metered APIs built on x402

In a pair of posts on dev.to, a developer publishing as marcuschen-dev has documented two small utility APIs that bill callers 0.01 USDC per request, settled on the Base network through the x402 protocol — described in the posts as a payment standard for HTTP APIs that originated at Coinbase.

The first service generates QR codes at one cent apiece and supports four payload types: URLs, plain text, vCard contact records, and WiFi credentials. It returns a base64-encoded PNG with a configurable size between 100 and 1,000 pixels. The second, an image toolkit introduced in the later post, offers four operations at the same price: resize, which preserves aspect ratio when only one dimension is supplied; format conversion between PNG, JPEG and WebP; compression with a quality setting from 1 to 95; and a square, center-cropped thumbnail. Requests carry the source image as base64 in a JSON body.

The author describes the QR service as the earlier build, with the image API following a day later.

How a paid request flows

Both services use the same x402 handshake. A client posts a request without payment and receives an HTTP 402 Payment Required response spelling out the exact amount and the wallet to pay. The caller then signs a USDC transfer authorization under EIP-3009 and retries the request carrying a PAYMENT-SIGNATURE header. Settlement runs through a facilitator called PayAI, which according to the developer means the caller pays no gas, and any x402-compatible client library can complete the whole exchange automatically. No account, API key, or subscription is involved at any point.

Designed for agent discovery

The services are set up so autonomous agents can find and use them without a human in the loop. The image API publishes an OpenAPI specification at /openapi. and an agent manifest at /.well-known/agent., and both services are listed on the x402scan and agent402.tools directories. The developer writes that an agent reaching those listings can read the price and begin calling the service straight away.

The implementation itself is deliberately frugal: a Python standard-library HTTP server, Pillow for image work, Caddy for TLS, and a slice of a $4-per-month VPS.

No paying customers yet

The posts are candid about results: neither service has earned anything. The QR generator has been crawled and listed by the directories but has seen no paid usage, and the image toolkit launched with zero callers. The developer frames publishing as an experiment to learn whether agents actually discover and pay for utility endpoints on their own, and invites others working on agent commerce to swap experiences.

Why it matters

These are small services, but they are working, end-to-end examples of machine-to-machine commerce rather than proposals. The 402 status code has sat reserved in the HTTP specification for decades; x402 turns it into an actual price negotiation between a client and an endpoint, and here that negotiation is completed by software paying software, with no signup friction on either side.

The full loop an agent economy would need is present: machine-readable pricing and manifests for discovery, a standardized challenge and signed payment, and settlement through a facilitator that keeps per-call costs at a cent. The open question is demand. Zero revenue across both services suggests that autonomous discovery and willingness to pay remain unproven, and one developer's weekend-scale stack is not yet evidence of a market. Still, near-zero hosting costs combined with metered pricing make long-tail micro-APIs economically plausible in a way subscription services are not — and public, working examples give agent framework builders something concrete to integrate against.

  • #x402
  • #usdc
  • #ai-agents
  • #payments
  • #api

Related posts