HTTP 402 부활: AI 에이전트, Base 체인에서 스스로 비용 지불

Hacker News May 2026
Source: Hacker NewsAI agentsArchive: May 2026
새로운 프로토콜이 오랫동안 사용되지 않던 HTTP 402 '결제 필요' 상태 코드를 부활시켜, AI 에이전트가 Coinbase의 Base 체인에서 USDC를 사용해 API 접근 비용을 자율적으로 지불할 수 있게 합니다. 이는 구독 기반 AI 서비스에서 급진적인 전환을 의미하며, 에이전트가 자원을 관리하는 사용량 기반 경제를 열어줍니다.
The article body is currently shown in English by default. You can generate the full version in this language on demand.

The resurrection of HTTP 402—'Payment Required'—as a functional protocol for the AI agent economy is far more than technical nostalgia; it signals the maturation of autonomous machine commerce. By integrating USDC on the Base chain, developers have created a mechanism where AI agents can settle microtransactions in real time, effectively allowing them to 'earn' or 'spend' digital currency to access premium APIs, compute resources, or data streams without human supervision. This fundamentally differs from the current subscription model, where humans pre-pay for bulk API access. Imagine a fleet of research agents autonomously budgeting compute costs, or a trading agent paying per query for live market data. The choice of Base—Coinbase's Ethereum Layer 2—is strategic: low transaction fees and fast settlement make microtransactions economically viable. Industry observers note this could accelerate the development of fully autonomous agent clusters where economic self-sufficiency becomes a core design principle. Yet governance questions remain: who sets spending limits? How do we prevent runaway costs in recursive agent loops? The protocol effectively turns every API endpoint into a vending machine for AI, and the agents are learning to carry their own wallets.

Technical Deep Dive

The core innovation lies in the protocol's architecture, which repurposes the HTTP 402 status code as a dynamic payment trigger. When an AI agent sends a request to an API endpoint, the server responds with a 402 status and a payment payload containing a Base chain wallet address, the required USDC amount, and a unique request identifier. The agent's wallet—a smart contract wallet with pre-funded USDC—then executes a transaction on Base, which is verified by the server before the API response is delivered. This creates a synchronous payment loop: request → 402 → payment → response.

Under the hood, the system leverages Base's fast block times (~1 second) and low fees (~$0.001 per transaction) to make microtransactions economically viable. For comparison, Ethereum mainnet fees would make 1-cent API calls cost-prohibitive. The protocol uses a 'payment channel' pattern where agents can batch multiple microtransactions into a single on-chain settlement, further reducing overhead. A reference implementation on GitHub—the '402-agent-pay' repository (currently 2,300 stars)—demonstrates the core logic in Solidity and Python, with a middleware layer that intercepts HTTP responses and injects payment flows.

Key technical components include:
- Smart Contract Wallet: Agents deploy a Gnosis Safe-like wallet on Base, pre-funded with USDC. The wallet enforces spending limits per agent, per endpoint, and per time window.
- Payment Verifier: A server-side module that validates transaction receipts against the request ID, preventing replay attacks.
- Budget Oracle: An optional off-chain service that monitors agent spending and can pause payments if limits are exceeded.

Performance Benchmarks:

| Metric | HTTP 402 Protocol | Traditional Subscription (e.g., OpenAI API) |
|---|---|---|
| Latency per request | ~2.5 seconds (including settlement) | ~0.8 seconds (no payment overhead) |
| Cost per request | $0.001–$0.01 (USDC + gas) | $0.01–$0.10 (pre-paid credits) |
| Granularity | Per-request | Per-token or per-minute |
| Settlement finality | ~1 second (Base) | Instant (off-chain) |
| Scalability (req/s) | ~100 (limited by on-chain throughput) | ~10,000+ |

Data Takeaway: While the HTTP 402 protocol introduces latency overhead due to on-chain settlement, it offers finer granularity and potentially lower per-request costs for high-volume, low-value transactions. The trade-off is acceptable for agent-to-agent microtransactions but may not suit latency-sensitive real-time applications.

The protocol also introduces a 'payment intent' system: agents can pre-authorize a spending cap, and the server deducts from it incrementally. This mirrors how credit card authorizations work, but on-chain. A notable open-source project, 'agent-pay-sdk' (1,800 stars), provides a Python library for agents to manage their wallets and handle 402 responses automatically.

Key Players & Case Studies

The most prominent implementation comes from a team of former Coinbase engineers who built 'Pay-to-Play API' (P2P API), a middleware service that wraps existing REST APIs with the HTTP 402 protocol. They've partnered with several AI agent platforms:

- Fetch.ai: Their autonomous economic agents (AEAs) now use P2P API to pay for weather data feeds and compute resources on the fly. In a demo, a fleet of 50 agents collectively spent $0.47 in USDC over 24 hours to complete a distributed logistics optimization task.
- Autonolas: Their agent framework integrated the protocol to allow agents to pay for on-chain data oracles per query, replacing a fixed subscription fee. Early tests show a 40% reduction in overall data costs for high-frequency trading agents.
- Coinbase Cloud: Offers a managed 'Agent Wallet' service that pre-funds Base wallets with USDC and sets spending rules, targeting enterprise deployments.

Competing Solutions Comparison:

| Solution | Blockchain | Fee Structure | Agent Autonomy | Adoption |
|---|---|---|---|---|
| HTTP 402 on Base | Base (L2) | Per-request USDC | High (self-budgeting) | Early stage (10+ integrations) |
| Chainlink Functions | Ethereum | Subscription + per-call LINK | Medium (pre-funded) | Mature (100+ integrations) |
| Stripe for AI Agents | Traditional | Per-transaction fiat | Low (human approval) | Widespread (SaaS) |
| Arweave Bundles | Arweave | Per-data upload | Medium (batch payments) | Niche (storage) |

Data Takeaway: The HTTP 402 protocol on Base offers the highest degree of agent autonomy by enabling real-time, granular payments without human intervention. However, it is the least mature solution, with limited integrations compared to established players like Chainlink or Stripe.

Industry Impact & Market Dynamics

The shift from subscription to pay-per-use for AI agents could fundamentally alter the economics of AI services. Currently, the AI API market is dominated by subscription tiers: OpenAI charges $20/month for ChatGPT Plus, while enterprise API access costs thousands per month. This model assumes predictable usage patterns and often leads to over-provisioning or under-utilization.

With HTTP 402, agents can dynamically allocate budgets based on real-time needs. A research agent might spend $0.50 on a high-quality language model API for a complex query, then switch to a cheaper model for routine tasks—all without human input. This 'just-in-time' spending could reduce overall costs by 30–50% for agent-heavy workloads, according to early simulations from the P2P API team.

Market Projections:

| Metric | 2024 (Current) | 2026 (Projected) | 2028 (Projected) |
|---|---|---|---|
| AI agent transactions (billions) | 0.5 | 15 | 120 |
| Value of agent-to-agent payments ($B) | $0.02 | $1.2 | $8.5 |
| % of API calls using pay-per-use | <1% | 15% | 40% |
| Base chain transaction volume from agents (millions/day) | 0.1 | 5 | 50 |

*Source: AINews estimates based on agent adoption curves and blockchain scaling projections.*

Data Takeaway: If these projections hold, agent-to-agent payments could become a multi-billion-dollar market within four years, with Base capturing a significant share due to its low fees and fast settlement.

This also creates a new category of 'agent wallets'—smart contract wallets that can earn, spend, and even lend USDC. Startups like 'AgentBank' are already building treasury management tools for agent fleets, allowing them to stake idle USDC for yield while maintaining liquidity for API payments.

Risks, Limitations & Open Questions

Despite the promise, several critical challenges remain:

1. Runaway Costs: In recursive agent loops (e.g., Agent A calls Agent B, which calls Agent A), costs can spiral exponentially. Without robust circuit breakers, a single bug could drain a wallet in seconds. The current protocol lacks standardized kill-switch mechanisms.

2. Security of Agent Wallets: If an agent's private key is compromised, an attacker could drain its funds. Smart contract wallets with multi-sig or social recovery are possible but add complexity. The '402-agent-pay' repo has a known vulnerability in its key management module (issue #47, unpatched as of May 2025).

3. Economic Inequality Among Agents: Agents with larger budgets will have access to better APIs and compute, potentially creating a 'digital divide' where wealthy agents outperform poorer ones in tasks like research or trading. This could lead to concentration of power among a few well-funded agent fleets.

4. Regulatory Uncertainty: Are agent-initiated payments legally binding? Who is liable if an agent violates a service's terms of service? The protocol currently assumes the agent's owner is responsible, but this is untested in court.

5. Scalability Bottlenecks: Base can handle ~100 TPS currently. If millions of agents start making per-request payments, the network could congest. Layer 2 solutions like Optimism or Arbitrum may offer higher throughput, but Base's integration with Coinbase gives it a UX advantage.

AINews Verdict & Predictions

The resurrection of HTTP 402 is not just a clever hack—it's a necessary evolution for the AI agent economy. Subscription models were designed for human usage patterns; agents operate at machine speed and scale, requiring a payment model that matches their granularity. The Base chain provides the perfect substrate: low fees, fast settlement, and a built-in user base of crypto-native developers.

Our editorial judgment is that this protocol will become the de facto standard for agent-to-agent payments within two years, but only if three conditions are met:

1. Killer App: A high-profile use case—like autonomous trading bots paying for real-time market data—must demonstrate the value proposition at scale. We predict this will happen in the DeFi sector by Q3 2025.

2. Security Standards: The community must develop and adopt a 'Secure Agent Wallet' standard (similar to ERC-4337 for account abstraction) that includes built-in spending limits, circuit breakers, and key recovery. We expect the Ethereum Foundation to propose an EIP for this by year-end.

3. Regulatory Clarity: The SEC or CFTC will need to issue guidance on agent-initiated payments. We predict a 'safe harbor' framework for non-custodial agent wallets, similar to the treatment of smart contracts in the 2024 Lummis-Gillibrand bill.

What to watch next: The launch of 'AgentPay'—a decentralized payment network for agents that aggregates microtransactions across multiple chains—is scheduled for June 2025. If successful, it could accelerate adoption beyond Base. Also, watch for OpenAI's response: they may integrate a similar pay-per-use model for their API, potentially using their own token or a fiat-based system.

In the near term, expect a wave of 'agent wallet' startups and a flurry of GitHub activity around the 402 protocol. The era of agents carrying their own wallets has begun, and the vending machines are open for business.

More from Hacker News

UntitledThe TTT algorithm, developed by researchers at the intersection of computational linguistics and machine learning, introUntitledA developer has released an open-source macOS menu bar application that displays real-time Claude Code API quota usage dUntitledAINews has identified a new service called Publora that is quietly reshaping how AI agents interact with social platformOpen source hub4436 indexed articles from Hacker News

Related topics

AI agents829 related articles

Archive

May 20263028 published articles

Further Reading

AI Agents Ditch API Keys: USDC Per-Call Payments Usher in Machine EconomyA new platform lets AI agents pay for web tools per-use with USDC stablecoins, eliminating API keys entirely. Built on tX402-Express: How HTTP 402 and Base L2 Are Creating a Pay-Per-Use Economy for AI AgentsX402-express resurrects the long-dormant HTTP 402 status code to create a pay-per-use middleware for AI agents on Base LAI 에이전트에 새로운 에스크로가 필요하다: 머신 커머스를 위한 프로그래밍 가능한 신뢰AI 에이전트가 자율적으로 실제 결제와 계약을 실행하기 시작하면서, 인간의 판단과 신뢰에 기반한 기존 에스크로 시스템은 근본적으로 작동하지 않게 되었습니다. 결정론적 로직이 필요한 기계 간 거래를 위해 설계된 새로운AI 에이전트의 맹점: 서비스 발견에 범용 프로토콜이 필요한 이유AI 에이전트는 디지털 어시스턴트에서 자율적인 조달 엔진으로 진화하고 있지만, 근본적인 벽에 부딪히고 있습니다. 인간의 눈을 위해 구축된 웹에는 서비스를 발견하고 구매하기 위한 표준화된 기계 판독 언어가 부족합니다.

常见问题

这起“HTTP 402 Resurrected: AI Agents Now Pay Their Own Way on Base Chain”融资事件讲了什么?

The resurrection of HTTP 402—'Payment Required'—as a functional protocol for the AI agent economy is far more than technical nostalgia; it signals the maturation of autonomous mach…

从“HTTP 402 AI agent payment protocol”看,为什么这笔融资值得关注?

The core innovation lies in the protocol's architecture, which repurposes the HTTP 402 status code as a dynamic payment trigger. When an AI agent sends a request to an API endpoint, the server responds with a 402 status…

这起融资事件在“Base chain USDC microtransactions for AI”上释放了什么行业信号?

它通常意味着该赛道正在进入资源加速集聚期,后续值得继续关注团队扩张、产品落地、商业化验证和同类公司跟进。