x402協議:如何實現按需付費的網絡基礎設施




為何x402協議在PING熱潮後依然未消退,以及驅動第二波的因素

X402正超越PING的熱潮,隨著Coinbase和Cloudflare將「402 Payment Required」轉變為真正的按需付費基礎設施。

要點摘要:
– x402使互聯網上的按需付費功能成為可能。
– 當前的動力來自基礎設施,由Coinbase和Cloudflare推動。
– PING曾是催化劑,但真正的故事是協議的採用,而非代幣。
– 你可以通過快速設置端點來測試,並驗證402→支付→授予的流程。

x402是一種簡單的方式,讓互聯網上的按需付費成為現實。當你訪問一個付費的應用程式介面(API)或文件時,伺服器會回應網絡內建的「402 Payment Required」消息,並指定價格——通常只需幾美分的USDC,並告訴你支付的去處。

你從你的錢包發送鏈上支付,重複請求,伺服器便會交付結果。這裡沒有帳戶、密碼、API密鑰或月費計劃——只有與該特定請求相關的一次性支付。

x402的第二波浪潮

這個概念並不新鮮。402狀態碼在HTTP中已存在多年,但直到2025年,Coinbase才將其包裝成一個清晰的協議(x402)。該公司發佈了文檔和代碼,並為開發者提供了一個管理的網關。隨後,Cloudflare與Coinbase合作共同推出x402基金會,正式化標準並為主流開發者工具提供支持。

你可能第一次聽到x402是因為一個名為PING的代幣引起了關注。雖然代幣的熱度已經消退,但協議依然存在,因為它解決了一個普遍問題:如何在不要求用戶創建帳戶的情況下,按API調用、AI推理或下載收費。

這種實用性,加上新的AI代理工具,可以自動支付,正在推動一波以實際使用為重點的第二波浪潮。

什麼是PING,誰在背後,與x402有何關聯?

PING是一種在Base(Coinbase的第二層)上的迷因幣。它是通過x402流程執行的第一個公共代幣鑄造,因此引起了媒體的關注。早期買家並未在網站上註冊,而是訪問了一個統一資源定位符(URL),收到「402 Payment Required」消息,支付少量的USDC鏈上費用,然後重試請求並獲得PING。可以將其視為x402的按請求付費模型應用於鑄造的現場演示。

該代幣由X帳戶Ping.observer推出。公共報導和上市持續將PING歸因於該帳戶。除了這一點,並沒有官方團隊頁面或白皮書,也沒有針對PING代幣本身的可信風險投資披露。

x402提供了基礎設施,而PING則作為其首次大規模測試案例。該代幣的付費鑄造機制對協議進行了壓力測試,並突顯了x402的核心原則:按請求收取微小的鏈上費用。這包括API調用、AI推理、文件下載,或在這種情況下的鑄造,所有這些都不需要帳戶或API密鑰。

在最初的高峰和回落之後,持久的影響並不是代幣價格,而是開發者和端點湧入,開始實驗x402。

如何嘗試x402(開發者快速入門)

### 1) 理解要點

x402是一個簡單的握手。你調用一個付費的URL,伺服器回應「402 Payment Required」和價格(以USDC為單位)。你發送鏈上支付,然後再次調用URL以獲取結果。就這樣。

### 2) 選擇設置

– **管理式**:使用Coinbase的託管x402網關,配有儀表板和內建的交易識別(KYT)檢查。這對於快速概念驗證非常理想。
– **自我管理(DIY)/規範**:克隆開源x402參考實現,並在本地運行最小賣方和買方,如果你想要完全控制。

### 3) 暴露一個付費端點

選擇任何路徑(例如,「/inference」)。當有人在未付款的情況下訪問時,返回「402」響應以及支付詳情,包括金額、資產(USDC)、目的地址和到期時間。如果你能使用「curl」觸發該響應,那麼你就正確地在使用x402。

### 4) 完成一次付費請求

使用示例客戶端或管理網關檢測「402」,進行鏈上支付,然後重試請求。一旦支付確認,訪問應自動更新,無需帳戶、API密鑰或OAuth。

### 5) 可選:與AI代理測試

如果你與代理合作,啟動模型上下文協議(MCP)示例。攔截器將檢測「402」,從代理的錢包進行支付,並自動重新發出請求。這是一個快速確認代理到端點流程的方法。

風險、時間表及未來觀察重點

### 可能出現的問題

x402仍然相對較新。規範和參考代碼可能會繼續發展,而目前大多數現場設置使用USDC。過度依賴單一的託管網關或單一資產會引入供應商和資產集中風險。保持代幣敘事與協議進展分開也很重要。

### 監察治理

關注x402基金會的正式啟動細節,包括其章程、成員名單和路線圖。該事件將標誌著協議從產品轉變為標準。此外,留意Cloudflare的開發者生態系統(Agents SDK和MCP),因為主流工具通常在廣泛採用之前出現。

### 採用信號

你需要尋找能返回「402」響應的真實端點,並附上支付參數,然後在鏈上支付後解鎖訪問,期間不需要帳戶或API密鑰。更多的快速入門、文檔和GitHub活動是供應端的正面指標。

在雲服務、內容傳遞網絡(CDN)和代理框架中更廣泛的分佈,以及對額外資產和網絡的支持,將使x402越來越難以忽視。持續在「代理商務」整合中的進展也可能吸引那些通常不與加密貨幣合作的開發者。

### 如何保持更新

關注主要來源:Coinbase的產品頁面、文檔和GitHub以獲取協議更新,以及Cloudflare的博客和新聞稿以獲取基金會新聞和SDK支持。將任何來自這些渠道以外的內容,尤其是代幣討論,視為背景噪音。

這篇文章不包含投資建議或推薦。每項投資和交易行為都涉及風險,讀者應在做出決策時進行自己的研究。

以上文章由特價GPT API KEY所翻譯及撰寫。而圖片則由FLUX根據內容自動生成。

🎨 Nano Banana Pro 圖像生成器|打幾句說話就出圖

想畫人像、產品圖、插畫?SSFuture 圖像生成器支援 Flux Gemini Nano Banana Pro 改圖 / 合成, 打廣東話都得,仲可以沿用上一張圖繼續微調。

🆓 Flux 模型即玩,不用登入
🤖 登入後解鎖 Gemini 改圖
📷 支援上載參考圖再生成
⚡ 每天免費額度任你玩
✨ 即刻玩 AI 畫圖
An ultra-realistic photograph of an Asian woman in the reference image, faithfully replicating my face and maintaining it 100%. A woman with a perfectly sculpted hourglass figure stands on the sand at sunset. She wears a white string bikini, measuring,+++ accentuating her curves with a well-defined waist, hips, and toned figure. Her skin is fair, smooth, and radiant.

She stands next to a large, ornate gold-framed mirror, perched upright on the sand, fully revealing her reflection. The reflection clearly emphasizes her silhouette, curves, and body proportions.

The lighting is cinematic and stunning, creating soft highlights on her skin and sharp shadow contrasts that enhance the shape of her waist, hips, and legs.

The background features a dusk sky with sunset tones of deep blue, purple, and orange, gentle clouds, and the silhouettes of palm trees.

A natural beach atmosphere, realistic textures, sharp focus on the woman's body and reflections, high detail, Ultra HD, artistic aesthetic, warm lighting, and low angle. 一隻在香港茶餐廳喝奶茶的貓 Ultra-realistic cinematic photograph, 9:16 vertical.
Use my uploaded female subject as the ONLY face reference — her face, bone structure, proportions, and identity must remain 100% accurate. She is sitting low and relaxed on a worn vintage couch inside a messy 90s-era bedroom, dripping with grunge attitude and self-confidence. The entire room tells a story of obsession — the walls are completely covered in posters, photos, magazine clippings, and polaroids of HER, all different versions of her: glam looks, grungy looks, party looks, soft looks, edgy looks, all chaotic and layered, taped and pinned unevenly like a shrine to herself. Wardrobe: She wears an oversized, slouchy dark hoodie left open, revealing a white tube top underneath. The outfit is provocative but raw — lots of exposed skin at the waist, collarbones, shoulders, and legs. The vibe is unapologetically sexy, rebellious, and confident. Bare legs or very short bottoms, worn sneakers or socks, very lived-in 90s styling.
Hair & makeup: Hair is messy, slightly undone, effortlessly sexy. Makeup is grungy-glam — smoky eyes, dark liner, slightly smudged, natural but seductive skin texture. No over-polish.
Pose & expression:
She sits back into the couch with dominant, careless confidence — legs apart or casually stretched, shoulders relaxed. Her expression is sultry, knowing, and powerful, like she’s fully aware the entire room revolves around her. She looks down toward the camera, owning the frame.
Camera & composition:
The camera is placed very low on the floor, angled sharply upward toward her, creating dramatic depth perception. Her legs and body feel larger in the foreground, her face looming above, while the poster-covered walls stretch upward behind her, creating a warped, immersive perspective. Slight wide-angle distortion for intensity. Lighting: Moody, low-light bedroom lighting — a mix of cool blue tones and dirty warm highlights. Neon or lamp glow spills across the posters. Shadows fall unevenly across the room, adding grit and texture. Film grain, subtle motion blur energy, raw 90s music-video atmosphere. Overall vibe: Sexy, grungy, chaotic, self-obsessed

📣 即刻用 Google Workspace|唔使vpn都能享用 Google AI Pro

即使你只係一個人,都可以透過 Google Workspace 使用 官方Gemini AI Pro(原價 HK$160), 而在 Google Workspace 只要 HK$131 / 月

🔓 14 天免費試用
🔖 用呢條連結申請再有 額外 9 折
🇭🇰 香港可直接付款(香港信用卡)
🛡️ 不用 VPN,立即開用
🤖 可用 最新最紅Gemini 3 Pro & Nano Banana Pro
👉 立即登記 14 天免費試用 + 額外 9 折