Chuyển đến nội dung
Skillpedia
Agent7.0k · #13623

x402

Skill này làm gì

Skill này bao gồm x402, một cách để các dịch vụ web tính phí cho mỗi yêu cầu bằng phản hồi thanh toán HTTP 402 chuẩn. Agent có thể giải mã yêu cầu thanh toán, chuẩn bị một khoản thanh toán chưa ký, và dùng facilitator (dịch vụ trung gian) để xác minh hoặc quyết toán.

Khi nào nên dùng

  • ✓Khi một dịch vụ trực tuyến trả về yêu cầu thanh toán và agent của bạn cần trả.
  • ✓Khi bạn muốn tính phí các agent khác theo từng yêu cầu cho API của mình.
  • ✓Khi bạn cần kiểm tra yêu cầu thanh toán trước khi chấp thuận.

Liên kết skill

https://github.com/internet-court/internet-court-skill/blob/main/vendored/chaingpt/x402/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/internet-court/internet-court-skill/blob/main/vendored/chaingpt/x402/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn agent của mình trả tiền cho một API đã yêu cầu thanh toán, nhưng trước hết hãy giải thích nó muốn tôi trả bao nhiêu.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc yêu cầu thanh toán và giải thích số tiền, đồng tiền và người nhận bằng lời đơn giản. Nó chuẩn bị một khoản thanh toán chưa ký, ví của bạn ký, và agent gửi lại cùng yêu cầu. Facilitator không thể thay đổi số tiền hoặc người nhận mà bạn đã ký.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

x402 Payments skill

x402 turns HTTP 402 Payment Required into a real payment rail for agents: a server replies 402 with what it wants paid; the client signs an off-chain authorization and retries with an X-PAYMENT header; a facilitator broadcasts it. Settlement uses EIP-3009 transferWithAuthorization (e.g. USDC on Base) — the facilitator can only broadcast the signed authorization, never alter the amount or destination.

Custody-free: the plugin builds the EIP-712 the payer signs and assembles the header; it never holds a key.

Tools

Tool Purpose
chaingpt_x402_decode Decode a 402 body or X-PAYMENT header into human terms (amount/token/recipient/expiry) before paying.
chaingpt_x402_build_payment Build the UNSIGNED EIP-3009 typed data; pass a signature back to get the final X-PAYMENT header.
chaingpt_x402_facilitator Call a facilitator: supported / verify / settle.
chaingpt_x402_create_requirements Server side: generate the PaymentRequirements + 402 body to monetize your endpoint.
chaingpt_x402_fetch The whole client loop in one tool: fetch a URL; on 402 it decodes the challenge and (given from) emits the unsigned typed data; re-call with xPaymentHeader to complete the paid request.

Pay an endpoint (client flow)

Fast path — one tool drives the loop:

  1. chaingpt_x402_fetch url=<resource> from=<payer> → on 402 you get the decoded price/payee AND the unsigned EIP-3009 typed data.
  2. Sign the typed data in the payer's wallet.
  3. chaingpt_x402_build_payment from=<payer> requirements=<from step 1> signature=0x… → the X-PAYMENT header.
  4. chaingpt_x402_fetch url=<resource> xPaymentHeader=<header> → the paid response.

Manual path (same primitives, finer control): _decode → _build_payment → sign → _build_payment +signature → retry yourself.

Monetize your endpoint (server flow)

chaingpt_x402_create_requirements network=base amount=0.01 payTo=<you> → serve the returned JSON with HTTP 402. Verify/settle incoming payments via a facilitator (chaingpt_x402_facilitator).

Known EIP-3009 tokens: USDC on base and base-sepolia. For other tokens pass full PaymentRequirements (with asset + extra.name/extra.version). 0 ChainGPT credits.

Câu hỏi thường gặp

Agent có giữ khóa ví của tôi không?

Không. Skill nói agent không bao giờ giữ khóa, và ví của bạn thực hiện việc ký.

Facilitator là gì?

Đó là một dịch vụ kiểm tra khoản thanh toán đã ký và gửi nó lên blockchain.

Skill dùng đồng coin nào?

Các ví dụ trong skill dùng USDC trên mạng Base.

Chi tiết

Mô tả gốc của tác giả

x402 agentic payments (Coinbase's HTTP 402 protocol). Custody-free tools to pay x402-protected endpoints (build the EIP-3009 transferWithAuthorization the payer signs, assemble the X-PAYMENT header), call a facilitator (verify/settle/supported), and monetize your own API by generating PaymentRequirements. USDC on Base. Triggers: x402, HTTP 402, pay per request, agentic payment, machine payment, X-PAYMENT, transferWithAuthorization, EIP-3009, facilitator, monetize API, pay for API, agent pays.

repo: internet-court/internet-court-skill

Độ phổ biến

Sao GitHub
7.0k
Vị trí xếp hạng
#13623
Giấy phép
—
Cập nhật
26/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự