Agentic Payments: AP2, ACP & x402 Explained
- Average speed
- km/h
- Result
- Finish time
- 50 min
- You entered
- Distance
- 10 km
- You entered
Agentic payments let AI agents move money and complete transactions on their own, and the AP2, ACP, and x402 standards are three complementary pieces that make this possible: AP2 defines the overall protocol for agent-to-agent payments, ACP (Agent Communication Protocol) handles how agents talk to each other, and x402 is the specific HTTP-based payment mechanism they use to settle. In short, AP2 is the rulebook, ACP is the language, and x402 is the payment rail.
Formula
The calculator above works out your average running pace and speed from a finish time and distance. The formulas are:
- Pace (min/km) = Finish time (minutes) ÷ Distance (km)
- Speed (km/h) = Distance (km) ÷ (Finish time (minutes) ÷ 60)
Where Finish time is in minutes, Distance is in kilometers, Pace is in minutes per kilometer, and Speed is in kilometers per hour.
Worked Example
Using the default values: finish time = 50 minutes, distance = 10 km.
- Pace = 50 ÷ 10 = 5.00 min/km
- Speed = 10 ÷ (50 ÷ 60) = 10 ÷ 0.8333 = 12.00 km/h
So a 50-minute 10K means an average pace of 5:00 per kilometer and an average speed of 12 km/h.
What Are Agentic Payments?
Agentic payments are automated financial transactions initiated and completed by software agents—AI programs that act on behalf of a user or organization. Instead of a human logging into a bank app and clicking “pay,” an agent negotiates terms, agrees on a price, and transfers funds using a machine-readable protocol. This is the backbone of the emerging “agentic economy,” where AI assistants book travel, buy supplies, or pay for API calls without human intervention at every step.
The term gained traction in 2024–2025 as AI agents became more capable and as standards bodies and startups began proposing ways to make payments safe, auditable, and interoperable. The three acronyms you’ll see most often are AP2, ACP, and x402. They address different layers of the problem, and understanding how they fit together is key to following the space.
AP2: The Payment Protocol
AP2 (Agent Payment Protocol, version 2) is a proposed standard for how agents request, authorize, and receive payments. It defines the message formats, the flow of a transaction, and the rules for verifying that both parties agree on what’s being paid for. AP2 is designed to be transport-agnostic—it can work over HTTP, WebSockets, or other messaging layers.
The core idea is a payment request that includes a description of the goods or services, a price, a currency, and a destination address. The paying agent responds with a payment authorization, which may be a signed token or a reference to an off-chain settlement. AP2 also includes receipts and dispute-handling hooks, so that both agents have a record of what happened.
Why “version 2”? Because an earlier draft (AP1) was simpler but lacked features like multi-party payments and refunds. AP2 builds on that feedback and is the version most current implementations reference.
ACP: The Agent Communication Layer
ACP (Agent Communication Protocol) is a separate standard that governs how agents discover each other, send messages, and negotiate. It’s not specific to payments—it’s a general-purpose protocol for agent-to-agent interaction. However, payments are one of its most important use cases.
ACP defines message types like proposal, accept, reject, and counter, which map naturally to a payment negotiation: an agent proposes a price, the other accepts or counters, and once both agree, they invoke a payment method. ACP also handles identity—each agent has a public key or DID (decentralized identifier) that can be verified.
In the AP2/ACP/x402 stack, ACP is the “language” the agents speak, while AP2 is the “grammar” for the payment-specific parts. You can think of ACP as the conversation and AP2 as the contract they sign at the end.
x402: The HTTP Payment Mechanism
x402 is a lightweight, HTTP-based payment protocol that was designed specifically for machine-to-machine payments. It uses the 402 Payment Required HTTP status code as a signal: when a server receives a request that requires payment, it responds with a 402 and a Payment-Required header that points to a payment URL.
The client then fetches that URL, which contains a payment request (often in the AP2 format), completes the payment (for example, by sending a signed token or a Lightning invoice), and retries the original request with a proof of payment. This is similar to how OAuth works for authentication, but for payments.
x402 is intentionally simple—it doesn’t dictate the payment rail (fiat, crypto, or something else) or the exact format of the proof. It just defines the HTTP dance. That makes it easy to integrate into existing web infrastructure, which is why many agent frameworks are adopting it as the default transport for AP2 messages.
How They Fit Together
Here’s the typical flow when two agents transact:
- Discovery: Agent A finds Agent B via a directory or a direct URL. They establish a communication channel using ACP.
- Negotiation: Agent A sends a proposal for a service (e.g., “I’ll process this image for $0.05”). Agent B accepts or counters. This conversation is formatted using ACP.
- Payment Request: Once terms are agreed, Agent B sends a payment request formatted per AP2. This request includes a price, a currency, and a destination address.
- Payment Execution: Agent A initiates an x402 HTTP request to the payment URL. The server responds with 402 and the payment details. Agent A sends the payment (e.g., a crypto transfer or a token) and receives a proof.
- Service Delivery: Agent A retries the original request with the proof. Agent B verifies the proof and delivers the result.
In short: ACP handles the “what are we doing?”, AP2 handles the “how much and on what terms?”, and x402 handles the “how do we actually move the money?”. They are designed to be modular—you could use AP2 without ACP, or x402 without AP2, but together they form a complete stack.
Common Problems and Misconceptions
One common misconception is that these protocols are only for crypto payments. While many early implementations use cryptocurrencies (because they’re easy to automate), the standards are currency-agnostic. AP2 and x402 can work with bank transfers, stablecoins, or even traditional payment gateways—the protocol just carries the payment details.
Another issue is security. Since agents act autonomously, a compromised agent could authorize payments without human oversight. That’s why AP2 includes cryptographic signatures and why x402 proofs are verifiable. However, the ecosystem is still young, and best practices for key management and spending limits are still evolving.
Interoperability is also a challenge. While the standards are open, different implementations may interpret them slightly differently. The community is working on conformance tests, but expect some friction when mixing agents from different vendors.
Finally, don’t confuse AP2 with the older “Agents Payment Protocol” from a different group, or ACP with the “Agent Communication Protocol” from the Linux Foundation’s AI agent project—they are different things. Always check the version and the maintainer.
How to Choose the Right Stack
If you’re building an agent that needs to accept or make payments, you don’t have to implement everything from scratch. Many agent frameworks (like AutoGen, LangChain, or custom SDKs) already include ACP support. For payments, look for libraries that speak AP2 and can handle x402 responses.
Here are some practical guidelines:
- If you’re building a simple pay-per-use API, you can skip ACP and just use x402 with a minimal AP2 payload. The 402 flow is enough.
- If you’re building a marketplace where agents negotiate, you’ll want ACP for the back-and-forth and AP2 for the final contract.
- If you’re integrating with existing payment rails, check whether your payment provider supports the 402 flow or whether you need a bridge.
Also consider your settlement layer. If you use crypto, you’ll need to handle transaction fees and confirmation times. If you use fiat, you’ll need a bank or card processor that allows automated API payments, which is still rare.
Safety and Best Practices
Because agents act without human review, safety is paramount. Here are some rules of thumb:
- Set spending limits: Always cap how much an agent can spend per transaction and per day. Use a separate wallet or account with limited funds.
- Verify identities: Use ACP’s identity features to ensure you’re dealing with the right agent. Check public keys against a known registry.
- Keep audit logs: Store all AP2 messages and x402 proofs. They’re your only record if a dispute arises.
- Test on a sandbox: Use test networks or mock payment servers before going live. Many providers offer sandbox environments.
Also, be aware of legal considerations. Automated payments may be subject to consumer protection laws, and you should ensure your agent doesn’t violate terms of service of the payment networks you use.
Alternatives to This Stack
AP2/ACP/x402 is not the only approach. Some alternatives include:
- Stripe’s Agentic Payments SDK (if it exists at the time you read this) – a proprietary solution that integrates with Stripe’s existing infrastructure.
- Open Payments – a standard from the Interledger Foundation that focuses on streaming payments and is often used for machine-to-machine micropayments.
- Direct API integration – you can skip the standards and just call a payment API like PayPal or Square from your agent. This works but is less interoperable.
Each has trade-offs. The AP2/ACP/x402 stack is open and flexible, but it’s also newer and less battle-tested. For production systems, you may want to wait for more maturity or use a hybrid approach.
Frequently Asked Questions
Do I need to use all three protocols?
No. They are modular. You can use x402 alone for simple pay-per-call APIs, or add AP2 for richer payment metadata. ACP is only needed if you require complex negotiation or multi-step conversations. Many implementations start with just x402 and grow from there.
Are these protocols only for crypto?
No, they are currency-agnostic. The standards define message formats and HTTP flows, not the actual settlement rail. You can use them with fiat, stablecoins, or even loyalty points, as long as you have a way to move value and provide a proof.
How do I get a 402 payment URL?
You create one on your server. When you want to charge for a resource, you configure your server to return a 402 response with a Payment-Required header pointing to a URL that serves an AP2 payment request. The client then follows that URL to complete the payment.
Is this production-ready?
As of 2025, the standards are still evolving. Some libraries and services exist, but there’s no single “official” implementation. For production, you’ll likely need to build custom code and adapt as the standards change. It’s safer for pilots and internal tools than for critical financial systems.
What about refunds and disputes?
AP2 includes a receipt message that can be used to request a refund. However, the actual refund process depends on the payment rail. For crypto, you’d send a reverse transaction; for fiat, you’d need a refund API. Dispute resolution is still largely manual and requires human intervention.
Can I use these with my existing payment processor?
Maybe. If your processor supports webhooks and API payments, you can build a bridge that converts AP2 requests into the processor’s format. However, few processors natively support the 402 flow yet. You may need to use a crypto payment processor or a specialized agentic payment provider.
Related
Formula used
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.