How AI Agents Use MPP for Automatic ChatGPT Payments Without Credit Cards or OpenAI Accounts
This article documents the author's complete process and reflections on using the Machine Payable Protocol (MPP) on the Tempo public chain to enable an AI Agent to automatically pay with stablecoins and call the ChatGPT service.
Without a credit card or an OpenAI account, I pressed Enter for MPP in the terminal, and the AI Agent autonomously used stablecoins to purchase a ChatGPT response in less than a second.
Author: Sanqing, Foresight News
On March 18th, the stablecoin payment blockchain @tempo, backed by @stripe and @paradigm, announced the official launch of its mainnet. Simultaneously, Tempo and Stripe jointly introduced the Machine Payments Protocol (MPP), designed to provide AI Agents with a native, programmable payment standard. The protocol supports microtransactions and recurring payments, allowing Agents to directly settle service fees using stablecoins or fiat currency. Currently, over 50 services on Stripe, including Browserbase, Postalform, and even the offline New York restaurant Prospect Butcher, have already integrated MPP.
Tempo: An L1 Designed Specifically for Stablecoin Payments
Unlike most public blockchains in the market that pursue general-purpose computation or transaction matching, Tempo's positioning is very clear: a Layer 1 designed specifically for stablecoin payment scenarios.
On Tempo, on-chain transaction fees are paid directly with compliant stablecoins (like USDC); developers and users do not need to hold any additional volatile Gas Token. Blocks achieve finality in approximately 0.6 seconds, with no risk of reorganization.
At the protocol level, dedicated payment channels are established, ensuring that fees remain low and stable even during peak network activity. Furthermore, Tempo features a native DEX optimized for stablecoins and compliant tokenized deposits, and supports Passkey-based (fingerprint/facial) seamless wallet signatures, minimizing the barrier to entry for end-users.
In simple terms, Tempo is a "decentralized clearing engine" for enterprise applications, high-frequency microtransactions, AI Agent payments, and similar scenarios.
MPP: More Than Just Enabling Stablecoin Settlements Between Machines
Built on top of Tempo's infrastructure, the MPP (Machine Payments Protocol) defines an open standard that allows machines to perform pay-per-use, subscription, and other payments directly with stablecoins—without API keys, credit cards, or human intervention.
Its working principle is not complicated.
When an AI client makes a request to a paid API, the server returns an HTTP 402 Payment Required response, accompanied by a standardized bill (Challenge) detailing the price, currency, payment address, and other information.
The client's MPP SDK (e.g., mppx) automatically intercepts this 402, locally signs an on-chain voucher using a private key, attaches it to the request headers, and resubmits the request. The server verifies the voucher's validity and then returns the normal data.
The entire process is almost transparent to the upper-layer application code. You still write fetch(url), but the underlying layer now includes an automatic payment logic.
Relationship with the x402 protocol: x402 is a signaling specification based on the HTTP transport layer. It addresses how clients and servers can standardize the exchange of bills and vouchers.
MPP builds upon x402's communication standard by further introducing state channels (Escrow Sessions). The client pre-deposits a sum into an on-chain smart contract; subsequent multiple requests are settled incrementally off-chain using signed vouchers, without requiring on-chain transactions for each request. This significantly reduces Gas costs for high-frequency calls.
It's worth emphasizing that MPP's ambition extends beyond the single action of "paying." In the traditional internet, API Keys serve dual roles: identity authentication and billing credentials. MPP replaces the former with on-chain wallet addresses and the latter with cryptographically signed Vouchers, redefining how trust is established between machines.
Additionally, MPP provides a standardized service directory interface, allowing Agents to programmatically discover which services support pay-per-use purchases with stablecoins. This constitutes a machine-readable commercial index.
Moreover, since state channels maintain an ongoing billing relationship rather than a one-time transaction, MPP is more accurately positioned as a protocol for economic interaction between machines. Service discovery, identity authentication, continuous billing, and incremental settlement are all packaged within the same framework.
Hands-on Test Record: Complete Process from Deployment to Pitfalls
The following is a complete deployment test conducted in collaboration with the AI programming tool Antigravity, documenting the actual steps taken and issues encountered.
My environment is Windows 11, with Node.js v24 and TypeScript (ts-node/esm) as the runtime. Core dependencies include mppx (MPP client SDK), viem (Ethereum interaction library), and dotenv.
The deployment was completed in four steps:
- Use viem's
privateKeyToAccountmethod to generate an on-chain wallet address locally. The private key is encrypted and saved locally, serving as the AI Agent's dedicated account. - Use Tempo's Passkey wallet (based on facial/fingerprint verification) to transfer USDC into this address as seed funding. The AI's "first pot of gold" requires human injection.
- Initialize the MPP client in the code with a few lines of configuration, setting the maximum deposit limit for a single payment channel. The SDK automatically takes over the global
fetchfunction, executing the payment flow when encountering a 402 response. - The final step is testing. I actually called ChatGPT. I made a standard OpenAI-format request to
https://openai.mpp.tempo.xyz/v1/chat/completions. During the first request, the SDK opens a "state channel" on-chain, staking funds up to themaxDepositlimit. All subsequent requests are settled incrementally off-chain using increasing Vouchers, incurring no additional on-chain transaction fees.
The entire process seemed smooth, but there were quite a few pitfalls in practice.
- Platform compatibility of official CLI tools. Tempo's CLI tool currently only supports macOS and Linux; Windows users fail to install it directly. The solution Antigravity provided was to bypass the CLI and use the Node.js SDK to perform all operations at the code level.
- The precision trap of authorization. When setting the maximum deposit for a single channel, I entered
5000000, thinking it authorized 5 USDC. However, the SDK automatically adds precision, appending six zeros to this number. In other words, I actually requested the smart contract to stake 5 million US dollars. The correct approach is to enter a human-readable amount directly, e.g.,0.1represents 0.1 USDC. - Configuration conflicts in module formats. The MPP client SDK adopts a newer JavaScript module standard. If several key fields in the project configuration file are not aligned, the program will fail to start with an error. Such issues are not difficult for experienced developers to resolve but can be an invisible barrier for newcomers.
- The "amnesia" of payment channels. This was the issue I spent the most time troubleshooting and is key to understanding MPP's design philosophy. Every time I reran the test script, the system would open a brand new payment channel on-chain, deducting another deposit, even though the previous channel still had a significant unspent balance.
The reason is that the MPP client is completely stateless. Once the program closes, it "forgets" which channel it previously opened and how much it has already spent. To achieve channel reuse across sessions, it's essential to save the two key pieces of information—channelId and cumulativeAmount—before program shutdown and feed them back to the client upon the next startup.
After understanding this mechanism, I successfully completed over 10 consecutive ChatGPT calls. The entire process triggered only one on-chain operation during the first call (Gas fee approximately $0.03), while the subsequent 9 calls were completely silent on-chain, with zero additional overhead.
If the technical details mentioned above feel unfamiliar, there's no need to worry at all. In fact, most of the code for this deployment was generated step-by-step by Antigravity based on my natural language prompts. I only needed to provide it with Tempo's documentation and Github links, then describe my intent in natural language. It would generate the corresponding code, explain the meaning of each step, and help me pinpoint the cause when errors occurred. Similar tools include Claude Code, Cursor, etc.
MPP's Next Stop: Cross-Chain Expansion and the Agent Economy
From a technical perspective, the MPP protocol itself is not deeply coupled with the Tempo chain. Its core logic (HTTP 402 signaling exchange, off-chain Voucher signature incrementation, on-chain Escrow contract custody) can theoretically be ported to any network supporting EVM smart contracts.
This leads to a natural question: What if MPP is not limited to Tempo?
If MPP's Escrow contracts are deployed on Base, Arbitrum, or even Solana in the future, AI Agents will gain the ability to have payment accounts on multiple chains simultaneously, dynamically selecting the optimal route for payment based on Gas costs and settlement speed. This means "machine payments" may no longer be bound to a specific public chain but could evolve into a cross-chain, protocol-level infrastructure layer.
But the payment pathway is just the first layer.
As mentioned earlier, MPP simultaneously handles service discovery, identity authentication, and continuous billing. Once this protocol is deployed across multiple chains, an Agent's on-chain wallet address will become a cross-network universal "commercial identity." Its transaction reputation accumulated on Tempo, service channels opened on Base, and consumption records on Arbitrum all point to the same cryptographic identity. This provides a native data foundation for building a decentralized "credit profile" for Agents and enables service providers to offer differentiated pricing or credit lines based on an Agent's historical behavior.
Once this expansion occurs, its impact on AI Agent payments will be structural. Currently, an Agent's spending power is limited by single-chain balances and the liquidity of a single stablecoin. If MPP achieves multi-chain deployment, Agents can perform high-frequency microtransactions on Tempo with extremely low Gas (e.g., per-call LLM usage in the test, costing about $0.00006 per call), while simultaneously conducting large-scale data purchases or contract interactions on Base or Ethereum Mainnet, and even automatically transferring funds between different networks using cross-chain bridges.
Risk control models will also evolve accordingly. Smart contract-level maxDeposit limits can be finely configured per chain, per service provider, and per time window, forming a multi-dimensional budgeting system that is more flexible and tamper-proof than traditional credit card risk controls.
At this point, let's push the imagination a step further.
When machines possess independent, cross-chain payment capabilities, "Agent-as-a-Service" will no longer be just a concept. A research report Agent deployed in the cloud can autonomously procure computing power, scrape data, call translation models, generate multilingual content, and finally deliver the finished product to paying users. The entire chain involves no human approval per transaction, with profits automatically accumulating in the Agent's on-chain address.
Going further, Agents can even hire each other. An Agent skilled in data cleaning pays another Agent skilled in financial modeling per use for analytical results, forming a genuine "machine-to-machine" labor market. When these Agents' income reaches a certain scale, they could even convert stablecoins to fiat through compliant on/off-ramp channels like Bridge's MPP service, automatically transferring funds back to the operator's bank account.
Of course, there are still shortcomings at this stage. Persisting channel state (channelId and cumulativeAmount) is a necessity in production environments; otherwise, each process restart causes unnecessary duplicate staking. But these issues are more about engineering refinement than fundamental protocol flaws.
When MPP expands from the Tempo chain to the entire EVM ecosystem and even broader blockchain networks, the ceiling for the scale of the "agent economy" will be completely shattered.
Appendix: Overview of MPP Ecosystem Services
See the original post (X) for the accompanying image: Original Post (X).