본문으로 건너뛰기
Skillpedia
에이전트280k · #258

agent-payment-x402

하는 일

이 도구는 AI 에이전트가 서비스나 API 비용을 지불하도록 합니다. 에이전트가 직접 관리하는 디지털 지갑을 사용해, 작업이나 세션마다 쓸 수 있는 금액을 통제합니다.

사용하는 경우

  • ✓에이전트가 API 비용을 지불해야 할 때.
  • ✓에이전트가 서비스를 구매해야 할 때.
  • ✓에이전트의 작업마다 지출 한도를 정해야 할 때.

스킬 링크

https://github.com/affaan-m/ECC/blob/main/skills/agent-payment-x402/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/skills/agent-payment-x402/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“컴퓨터 비전 API를 사용해 이 이미지 분석 비용을 결제해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 결제해야 할 때는 특별한 프로토콜(x402)을 사용해 가격을 협상하고 잔액이 충분한지 확인합니다. 그다음 에이전트가 직접 관리하는 안전한 디지털 지갑으로 결제합니다. 누군가 대신 돈을 보관할 필요가 없습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Agent Payment Execution (x402)

Enable AI agents to make policy-gated payments with built-in spending controls. Uses the x402 HTTP payment protocol and MCP tools so agents can pay for external services, APIs, or other agents without custodial risk.

When to Use

Use when: your agent needs to pay for an API call, purchase a service, settle with another agent, enforce per-task spending limits, or manage a non-custodial wallet. Pairs naturally with cost-aware-llm-pipeline and security-review skills.

Decision Tree

Choose the integration path based on whether your agent is buying access to a paid API or charging others for one:

Need Recommended path
Agent pays a 402-gated API on Base or another agentwallet-supported chain Use agentwallet-sdk as an MCP payment server with strict spending policy
Agent pays a 402-gated API on X Layer Use OKX Agent Payments Protocol from okx/onchainos-skills; okx-x402-payment is a deprecated legacy alias
Agent pays a 402-gated API on Solana or another x402 v2 network Wrap the agent's HTTP client with the upstream @x402/fetch or @x402/axios package and register the EVM/SVM schemes; the resource server's facilitator verifies and settles
API charges agents on Solana or multiple networks (TypeScript, Python, or Go) Use the upstream x402 middleware from x402-foundation/x402 — @x402/express, @x402/hono, @x402/next, or @x402/fastify for TypeScript, x402 for Python, github.com/x402-foundation/x402/go/v2 for Go
TypeScript API charges agents Use OKX Payments TypeScript seller SDK docs for Express, Hono, Fastify, or Next.js
Go API charges agents Use OKX Payments Go seller SDK docs for Gin, Echo, or net/http
Rust API charges agents Use OKX Payments Rust seller SDK docs for Axum
Java API charges agents Use OKX Payments Java seller SDK docs for Spring Boot 2/3, Java EE, or Jakarta
Python API charges agents Check the current OKX Payments repository before implementation; a Python seller guide may not be available

Supported Networks

  • agentwallet-sdk: use the package docs to confirm current network coverage before production. Base Sepolia is the safest development default; Base mainnet is the production path called out by the original skill.
  • OKX Payments / X Layer: current seller docs target X Layer (eip155:196) and USDT0 settlement. Fetch current SDK docs before generating production code because payment packages and facilitator behavior can change quickly.
  • Upstream x402 packages: multi-network by design — one route can advertise Base and Solana simultaneously and let the buyer pick. The packages default to the x402.org facilitator, which is testnet-only (Base Sepolia eip155:84532, Solana devnet solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1, plus Stellar, Aptos, Hedera, and XRPL testnets) and is not intended for mainnet routes. For mainnet (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana), either self-facilitate, run your own facilitator, or pick a hosted one from the upstream facilitator list — see the facilitator comparison under Option C. Confirm live coverage at the facilitator's /supported endpoint before production rather than hardcoding it here.

How It Works

x402 Protocol

x402 extends HTTP 402 (Payment Required) into a machine-negotiable flow. When a server returns 402, the agent's payment tool negotiates price, checks budget, signs a transaction, and retries only inside the policy and confirmation boundary set by the orchestrator.

Spending Controls

Every payment tool call enforces a SpendingPolicy:

  • Per-task budget — max spend for a single agent action
  • Per-session budget — cumulative limit across an entire session
  • Allowlisted recipients — restrict which addresses/services the agent can pay
  • Rate limits — max transactions per minute/hour

Non-Custodial Wallets

Agents hold their own keys via ERC-4337 smart accounts. The orchestrator sets policy before delegation; the agent can only spend within bounds. No pooled funds, no custodial risk.

MCP Integration

The payment layer exposes standard MCP tools that slot into any Claude Code or agent harness setup.

Security note: Always pin the package version. This tool manages private keys — unpinned npx installs introduce supply-chain risk.

Option A: agentwallet-sdk (Base / multi-chain)

{
  "mcpServers": {
    "agentpay": {
      "command": "npx",

…
자주 묻는 질문

‘비수탁형(non-custodial)’이란 무엇인가요?

에이전트(또는 사용자)가 지갑의 키와 자금을 완전히 통제하며, 돈을 대신 보관하는 제3자에 의존하지 않는다는 뜻입니다.

‘오케스트레이터’란 무엇인가요?

에이전트가 작업을 시작하기 전에 규칙과 지출 한도를 정하는 시스템 또는 사람입니다.

어떤 결제 네트워크를 지원하나요?

Base, X Layer, Solana 같은 네트워크와, 설정에 따라 기타 EVM 호환 네트워크를 지원합니다.

상세 정보

작성자의 원본 설명

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk, X Layer through OKX Payments / OKX Agent Payments Protocol, and Solana plus multi-network EVM through the upstream x402 packages with facilitator-based settlement. Use when an agent must pay for something itself and needs per-task budgets, spending con

repo: affaan-m/ECC

인기도

GitHub 스타
280k
순위
#258
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬