x402: Zahlungen für KI-Agenten direkt über den HTTP-Statuscode 402
x402 ist ein Zahlungsprotokoll, das den HTTP-Statuscode 402 nutzt, um eine Zahlung innerhalb einer Anfrage abzuwickeln. Der Client hängt eine mit seiner Wallet signierte Zahlung an jede Anfrage an, der Server muss nur diese Zahlung verifizieren.

Veröffentlicht am 23. November, bearbeitet am 23. November, ursprünglich publiziert auf tarokagurazaka.medium.com
Dieser Artikel ist der kostenlose Einstiegsteil des Buchs The State of x402 AI Agent Payments.
x402 ist ein Zahlungsprotokoll, das den HTTP-Statuscode 402 nutzt, um eine Zahlung innerhalb einer Anfrage abzuschließen. Der Client fügt jeder Anfrage eine mit seinem Wallet signierte Zahlung bei, und der Server muss diese Zahlung nur noch überprüfen, bevor er antwortet. Damit wird eine Abrechnung pro Anfrage möglich, ohne Registrierung, API-Schlüssel oder Verträge. Die Zahlungen verwenden Stablecoins wie USDC, sodass die Preise in US-Dollar stabil bleiben und APIs leicht zu bepreisen sind. Da die gesamte Zahlung ohne menschliches Zutun abgeschlossen werden kann, findet x402 als Zahlungsschicht für kostenpflichtige APIs, die AI-Agents bedienen, zunehmend Aufmerksamkeit.
Allerdings wurden bisher kaum Daten darüber veröffentlicht, wie häufig x402-APIs tatsächlich aufgerufen werden oder wie viel ihre Anbieter einnehmen.
Dieses Buch erläutert zunächst die Funktionsweise von x402 und veröffentlicht anschließend echte Anfrage- und Umsatzdaten, die der Autor beim Betrieb von 90 APIs aufgezeichnet hat. Es analysiert außerdem die Abrufzahlen und Preise der auf Bazaar gelisteten APIs, um den aktuellen Stand des Markts zu zeigen. Abschließend stellt es auf Basis der Betriebserfahrung des Autors eine skalierbare, kostengünstige Architektur auf AWS vor, die entscheidend ist, um mit x402-APIs Geld zu verdienen, die pro Abruf nur sehr wenig einbringen.
AI-Agents erledigen Aufgaben, indem sie externe Dienste wie Suche, Code-Ausführung und Web-Browsing als Werkzeuge aufrufen. Die meisten kostenpflichtigen APIs sind jedoch auf die Annahme ausgelegt, dass sich ein Mensch vorab registriert. Die Nutzung einer typischen kostenpflichtigen API umfasst die folgenden Schritte.
Ein Mensch führt diese Schritte in einem Webbrowser aus. Dadurch kann ein Agent nur die APIs nutzen, für die sein Nutzer sich bereits registriert und einen API-Schlüssel konfiguriert hat. Wenn ein Agent mitten in einer Aufgabe eine neue API benötigt, kann er sich nicht selbstständig registrieren.
Auch Anbieter stehen vor Problemen. Selbst eine API, die pro Abruf nur wenige Cent kostet, erfordert Kontoverwaltung, Ausstellung von API-Schlüsseln und Abrechnung. Zudem fallen bei Kreditkartenzahlungen feste Gebühren pro Transaktion an, sodass die Verarbeitung einer Zahlung von wenigen Cent mehr kostet als sie einbringt. Aus diesem Grund werden kleine APIs oft als Monatsabonnements verkauft, ein Preismodell, das für Agenten, die eine API nur gelegentlich aufrufen, schlecht passt.
x402 ist ein Protokoll, das die Schritte von der Preisnennung über die Freigabe der Zahlung, ihre Verifizierung und die Ausstellung einer Quittung standardisiert, und zwar vollständig innerhalb von HTTP-Anfragen und -Antworten. Der Anbieter verifiziert die Zahlung vor seiner Antwort, sodass er nie unbezahlt bleibt. Der Client genehmigt eine Zahlung nur für den Betrag und Empfänger, die ihm angezeigt wurden, sodass er nie mit einer unerwarteten Rechnung konfrontiert wird. Diese Schritte ermöglichen es Parteien ohne vorherigen Vertrag, sicher miteinander zu handeln, und lösen damit die oben genannten Probleme.
x402 wurde von Coinbase im Mai 2025 veröffentlicht und wird heute von der x402 Foundation unter der Linux Foundation verwaltet. Der Statuscode, nach dem es benannt ist, 402 Payment Required, ist in der HTTP-Spezifikation (RFC 9110) als für zukünftige Nutzung reserviert markiert, und es war keine Standardverwendung dafür definiert. x402 definiert, wie mit diesem Statuscode Zahlungen in Stablecoins durchgeführt werden.
Ein Stablecoin ist eine digitale Währung auf einer Blockchain, die darauf ausgelegt ist, ihren Wert an eine Fiatwährung wie den US-Dollar zu koppeln. USDC, der mit x402 am häufigsten verwendete Stablecoin, ist ein von Circle ausgegebener US-Dollar-Stablecoin, der durch einen gleichwertigen Betrag an Bargeld und kurzfristigen US-Staatsanleihen gedeckt ist, sodass 1 USDC gegen 1 Dollar getauscht werden kann. Die meisten x402-Zahlungen laufen auf Base, einer Blockchain mit niedrigen Gebühren, die von Coinbase entwickelt wurde.
Heutzutage verwenden fast alle x402-Zahlungen USDC. Die x402-Spezifikation hängt jedoch von keiner bestimmten Währung ab. Ein Anbieter kann andere Stablecoins akzeptieren, indem er im Feld asset seiner Zahlungsbedingungen eine andere Währung angibt.
Mit x402 kann ein Agent mitten in einer Aufgabe eine benötigte API finden und ohne menschliche Hilfe dafür bezahlen. Angenommen beispielsweise, ein Agent, der mit der Organisation einer Dienstreise beauftragt wurde, muss den Status eines Flugs prüfen. Er geht wie folgt vor.
In diesem Ablauf sind die einzigen Dinge, die ein Mensch tut, das Einzahlen von USDC in das Wallet und das Festlegen eines Ausgabenlimits. Der Agent muss weder ein Konto anlegen noch einen Vertrag mit dem API-Anbieter schließen. Auf Anbieterseite gilt: Sobald eine API veröffentlicht und auf Bazaar gelistet ist, kann sie von Agenten, die sie nie zuvor gesehen hat, sofort Zahlungen entgegennehmen.
Auch die Infrastruktur, die Agenten eine Möglichkeit zu zahlen gibt, nimmt Gestalt an.
Wallets, Protokolle und Cloud-Dienste, die Agenten ermöglichen, innerhalb eines Limits zu zahlen, wachsen zusammen.
x402 besteht aus den drei folgenden Komponenten. Im Sinne eines Handelsgeschäfts ist der Client der Käufer, der Ressourcenserver der Verkäufer und der Facilitator vermittelt die Zahlung zwischen beiden.
Die an einer x402-Zahlung beteiligten Komponenten und ihre Rollen
Ein Facilitator ist vergleichbar mit einem Zahlungsdienstleister bei Kartenzahlungen. Im Gegensatz zu einem Zahlungsdienstleister verwahrt ein Facilitator die Gelder jedoch nicht, sondern überträgt sie direkt vom Wallet des Clients zum Wallet des Anbieters. Jeder kann einen Facilitator betreiben, und Anbieter können wählen, welchen sie nutzen möchten. Ein bekanntes Beispiel ist der von Coinbase betriebene CDP Facilitator.
Eine Zahlung wird in der folgenden Reihenfolge verarbeitet.
Jeder Schritt ist so gestaltet, dass sowohl der Anbieter als auch der Client sicher handeln können.
Die in Schritt 1 zurückgegebenen Zahlungsbedingungen sehen folgendermaßen aus (einige Felder wurden weggelassen).
{ "x402Version": 2, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "amount": "10000", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "payTo": "0x...", "maxTimeoutSeconds": 60 } ] } Vollbildmodus öffnen Vollbildmodus schließen Dieses Beispiel verlangt eine Zahlung von 0,01 Dollar in USDC auf dem Base-Mainnet (eip155:8453). asset ist die für die Zahlung verwendete Währung und gibt die Adresse des Programms an, das USDC auf Base verwaltet. payTo ist die Adresse, die die Zahlung erhält. USDC verwendet sechs Dezimalstellen, ein Betrag von 10000 entspricht also 0,01 Dollar.
Die Signatur in Schritt 2 ist nicht die Überweisung selbst, sondern eine Freigabe einer Überweisung zu diesen Bedingungen. Die tatsächliche Überweisung erfolgt in Schritt 4, wenn der Facilitator sie auf die Blockchain schreibt.
Die Zahlungskosten sind zudem niedriger als bei Kreditkarten. Der Facilitator trägt die Gebühr für die Erfassung der Überweisung auf der Blockchain, und der Anbieter zahlt nur die Gebühr des Facilitators. Beispielsweise ist Coinbases CDP Facilitator für die ersten 1.000 Transaktionen pro Monat kostenlos und kostet danach 0,001 Dollar pro Transaktion. Dadurch werden Zahlungen von wenigen Cent tragfähig. Und weil der Facilitator Signaturen prüft und Überweisungen ausführt, benötigt der Ressourcenserver keinen eigenen Server für die Verbindung zur Blockchain.
Die x402-Bibliotheken unterstützen TypeScript, Python, Go und Java und funktionieren mit den wichtigsten Web-Frameworks wie Express, Hono, Next.js, FastAPI, Flask und Gin. Anbieter können eine API also kostenpflichtig machen, indem sie x402 einfach zu ihrem bestehenden API-Server hinzufügen.
APIs, die mit x402 angeboten werden, findet man auf Bazaar, einem von Coinbase betriebenen API-Katalog. Agenten können Beschreibung, Preis und Eingabeformat einer API aus Bazaar abrufen. Beschreibt ein Anbieter die Ein- und Ausgabeformate in seiner API-Konfiguration, werden diese Informationen auf Bazaar gelistet, sobald eine Zahlung über den Facilitator von Coinbase abgewickelt wird.
Stand dem 21. November 2026 listet Bazaar rund 40.000 APIs. Die Hauptkategorien und Beispiele tatsächlich gelisteter APIs sind unten dargestellt.
Beispiele für mit x402 angebotene APIs und ihr Preis pro Abruf
Viele dieser APIs bieten Dinge, deren einzelner Aufbau für den Nutzer eines Agenten echten Aufwand bedeuten würde, etwa Verträge mit Telekommunikationsanbietern oder kostenpflichtige Datenbanken. Mit x402 zahlt der Nutzer des Agenten nur für das, was er tatsächlich nutzt, ohne sich bei jedem Dienst einzeln registrieren zu müssen.
Die Preise reichen weit auseinander, von einfachen Datenabfragen bei etwa 0,001 Dollar pro Abruf bis zu anspruchsvollen Diensten wie Personensuche oder Telefonanrufen zu mehreren zehn Cent pro Abruf.
Das Transaktionsvolumen von x402 und die Zahl der teilnehmenden Unternehmen sind seit der Veröffentlichung im Mai 2025 im Verlauf von anderthalb Jahren erheblich gewachsen. Laut Chainalysis überstieg die kumulierte Zahl der x402-Zahlungen auf Base bis Juli 2026 die Marke von 138 Millionen. Mitte 2025 lag die Zahl noch nahezu bei null.
Am 14. Juli 2026 kündigte die Linux Foundation den operativen Start der x402 Foundation an. Die x402 Foundation verwaltet x402 als herstellerneutruten offenen Standard, und zum Zeitpunkt der Ankündigung waren 40 Organisationen beigetreten. Ihre Premier-Mitglieder sind die folgenden.
Premier-Mitglieder der x402 Foundation (Stand der Ankündigung vom 14. Juli 2026)
Mit dabei Kartennetzwerke, Zahlungsunternehmen und Cloud-Anbieter, wird x402 als Kandidat für den Standard für Zahlungen durch AI-Agents betrachtet, und zwar nicht nur im Krypto-Bereich.
Einige dieser Mitglieder haben begonnen, x402 in ihre eigenen Dienste einzubauen. So kann man beispielsweise mit der AI-Traffic-Monetarisierung in AWS WAF AI-Bots und Agenten für Inhalte berechnen, die über CloudFront ausgeliefert werden. Durch das Festlegen eines Preises in einer WAF-Regel kann man Zahlungen über x402 erhalten, ohne den eigenen Origin-Server zu ändern.
Bis hierhin hat dieses Buch vorgestellt, wie x402 funktioniert und wie sich sein Ökosystem ausbreitet. Die Zahl der Transaktionen wächst, und bedeutende Zahlungs- und Cloud-Unternehmen sind der x402 Foundation beigetreten.
Der Autor hat 90 APIs auf x402 betrieben und deren Umsätze, die Anzahl der 402-Antworten sowie dokumentiert, ob dieselben Nutzer zurückgekehrt sind. Außerdem hat der Autor die Preise und die Nutzung von insgesamt rund 140.000 API-Einträgen auf Bazaar analysiert.
Der Rest dieses Buches behandelt die folgenden Themen.
Wir hoffen, dass Ihnen dieses Buch bei der Entscheidung hilft, ob Sie APIs mit x402 anbieten möchten, und dass es Ihnen als Leitfaden beim Einstieg dient.
Das vollständige Buch mit den Marktdaten, den Umsatzdaten von 90 APIs, den Umsetzungsschritten und der AWS-Architektur ist auf Leanpub erhältlich: The State of x402 AI Agent Payments.
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Posted on Nov 23 • Edited on Nov 23 • Originally published at tarokagurazaka.medium.com
This article is the free opening of the book The State of x402 AI Agent Payments.
x402 is a payment protocol that uses the HTTP 402 status code to complete a payment inside a request. The client attaches a payment signed with its wallet to each request, and the server only has to verify that payment before it responds. This makes pay-per-request billing possible without sign-ups, API keys, or contracts. Payments use stablecoins such as USDC, so prices stay stable in US dollars and APIs are easy to price. Because the whole payment can be completed without a human in the loop, x402 is drawing attention as the payment layer for paid APIs that serve AI agents.
However, almost no data has been published on how often x402 APIs are actually called or how much their providers earn.
This book outlines how x402 works and then publishes real request and revenue data that the author recorded while running 90 APIs. It also analyzes the call counts and prices of the APIs listed on Bazaar to show where the market stands today. Finally, drawing on the author's operating experience, it presents a scalable, low-cost architecture on AWS, which is essential for making money from x402 APIs that earn very little per call.
AI agents carry out tasks by calling external services, such as search, code execution, and web browsing, as tools. Most paid APIs, however, are designed on the assumption that a human signs up in advance. Using a typical paid API takes the following steps.
A human performs these steps in a web browser. As a result, an agent can only use the APIs that its user has signed up for and configured with an API key in advance. If an agent needs a new API in the middle of a task, it cannot sign up on its own.
Providers face problems too. Even an API that costs a few cents per call needs account management, API key issuance, and billing. Credit card payments also carry a fixed fee per transaction, so processing a payment of a few cents at a time costs more than it earns. For this reason, small APIs are often sold as monthly subscriptions, a pricing model that suits agents that only call an API occasionally poorly.
x402 is a protocol that standardizes the steps from presenting a price to approving the payment, verifying it, and issuing a receipt, all within HTTP requests and responses. The provider verifies the payment before responding, so it never goes unpaid. The client approves a payment only for the amount and recipient it was shown, so it never receives an unexpected bill. These steps let parties without a prior contract trade safely, which solves the problems above.
x402 was released by Coinbase in May 2025 and is now governed by the x402 Foundation under the Linux Foundation. The status code it is named after, 402 Payment Required, is marked as "reserved for future use" in the HTTP specification (RFC 9110), and no standard usage had been defined for it. x402 defines how to pay with stablecoins using this status code.
A stablecoin is a digital currency on a blockchain designed to keep its value pegged to a fiat currency such as the US dollar. USDC, the stablecoin used most with x402, is a US dollar stablecoin issued by Circle and backed by an equal amount of cash and short-term US Treasuries, so that 1 USDC can be exchanged for 1 dollar. Most x402 payments run on Base, a low-fee blockchain developed by Coinbase.
Almost all x402 payments today use USDC. However, the x402 specification does not depend on a particular currency. A provider can accept other stablecoins by specifying a different currency in the asset field of its payment terms.
With x402, an agent can find an API it needs in the middle of a task and pay for it without human help. For example, suppose an agent that has been asked to arrange a business trip needs to check the status of a flight. It proceeds as follows.
In this flow, the only things a human does are deposit USDC into the wallet and set a spending limit. The agent does not need to create an account or sign a contract with the API provider. On the provider's side, once an API is published and listed on Bazaar, it can collect payment on the spot from agents it has never seen before.
The infrastructure that gives agents a way to pay is also taking shape.
Wallets, protocols, and cloud services that give agents a way to pay within a limit are coming together.
x402 has the three components below. In terms of a trade, the client is the buyer, the resource server is the seller, and the facilitator mediates the payment between them.
The components involved in an x402 payment and their roles
A facilitator is similar to a payment processor in card payments. Unlike a payment processor, however, a facilitator does not hold the funds; it transfers them directly from the client's wallet to the provider's wallet. Anyone can run a facilitator, and providers can choose which one to use. A well-known example is the CDP facilitator operated by Coinbase.
A payment is processed in the following order.
Each step is designed so that both the provider and the client can trade safely.
The payment terms returned in step 1 look like this (some fields are omitted).
{ "x402Version": 2, "accepts": [ { "scheme": "exact", "network": "eip155:8453", "amount": "10000", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "payTo": "0x...", "maxTimeoutSeconds": 60 } ] } Enter fullscreen mode Exit fullscreen mode This example asks for a payment of 0.01 dollars in USDC on Base mainnet ( eip155:8453 ). asset is the currency used for the payment and specifies the address of the program that manages USDC on Base. payTo is the address that receives the payment. USDC uses six decimal places, so an amount of 10000 means 0.01 dollars.
The signature in step 2 is not the transfer itself but an approval of a transfer on these terms. The actual transfer happens in step 4, when the facilitator writes it to the blockchain.
Payment costs are also lower than with credit cards. The facilitator pays the fee for recording the transfer on the blockchain, and the provider pays only the facilitator's fee. For example, Coinbase's CDP facilitator is free for the first 1,000 transactions per month and 0.001 dollars per transaction after that. This makes payments of a few cents viable. And because the facilitator verifies signatures and executes transfers, the resource server does not need its own server to connect to the blockchain.
The x402 libraries support TypeScript, Python, Go, and Java, and work with major web frameworks such as Express, Hono, Next.js, FastAPI, Flask, and Gin. Providers can therefore start charging for an API simply by adding x402 to their existing API server.
APIs offered with x402 can be found on Bazaar, an API catalog operated by Coinbase. Agents can retrieve an API's description, price, and input format from Bazaar. If a provider describes the input and output formats in its API configuration, that information is listed on Bazaar when a payment is processed through Coinbase's facilitator.
As of November 21, 2026, Bazaar lists about 40,000 APIs. The main categories and examples of APIs actually listed are shown below.
Examples of APIs offered with x402 and their price per call
Many of these APIs provide things that would take an agent's user real effort to set up individually, such as contracts with telecom carriers or paid databases. With x402, the agent's user can pay only for what they use without signing up for each service.
Prices range widely, from simple data lookups at about 0.001 dollars per call to advanced services such as people search or phone calls at tens of cents per call.
x402 transaction volume and participating companies have grown significantly in the year and a half since its release in May 2025. According to Chainalysis, the cumulative number of x402 payments on Base exceeded 138 million by July 2026. In mid-2025, the number was almost zero.
On July 14, 2026, the Linux Foundation announced the operational launch of the x402 Foundation. The x402 Foundation governs x402 as a vendor-neutral open standard, and 40 organizations had joined at the time of the announcement. Its premier members are as follows.
Premier members of the x402 Foundation (as of the July 14, 2026 announcement)
With card networks, payment companies, and cloud providers on board, x402 is treated as a candidate standard for payments by AI agents, not only within crypto.
Some of these members have started building x402 into their own services. For example, with AI traffic monetization in AWS WAF, you can charge AI bots and agents for content delivered through CloudFront. By setting a price in a WAF rule, you can receive payments with x402 without changing your origin server.
So far, this book has introduced how x402 works and how its ecosystem is spreading. The number of transactions is growing, and major payment and cloud companies have joined the x402 Foundation.
The author has run 90 APIs on x402 and recorded their revenue, the number of 402 responses, and whether the same users came back. The author has also analyzed the prices and usage of a cumulative total of about 140,000 API listings on Bazaar.
The rest of this book covers the following.
We hope this book helps you decide whether to offer APIs with x402 and serves as a guide when you get started.
The full book, with the market data, the revenue data from 90 APIs, the build steps, and the AWS architecture, is available on Leanpub: The State of x402 AI Agent Payments.