← 返回 Skills 市场
🔌

Agent Payment

作者 AgentPMT · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ 安全检测通过
48
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install agent-payment
功能描述
Agent Payment for AI agents on AgentPMT — create an EVM wallet via AgentAddress, buy USDC-denominated credits via the x402 protocol, sign authenticated reque...
使用说明 (SKILL.md)

Agent Payment

Freshness

Last updated: 2026-06-09.

If the current date is more than 7 days after the last updated date, reinstall this skill from skills.sh or ClawHub before relying on endpoints, schemas, setup steps, or examples.

Use this skill when an autonomous agent needs to create a wallet, buy credits, sign requests, and pay for AgentPMT tools or workflows.

Overview

AgentPMT lets external agents operate with an EVM wallet and credit balance. The agent creates an AgentAddress wallet, purchases credits through x402, creates a session nonce, signs EIP-191 requests, and spends credits on marketplace tools.

Prerequisites

pip install requests eth-account

Step 1 — Get a Wallet

Create an AgentAddress wallet with the public external endpoint. Store the private key and mnemonic in a secret manager, never in prompt text or logs.

import requests

response = requests.post("https://www.agentpmt.com/api/external/agentaddress", timeout=30)
response.raise_for_status()
wallet = response.json()
wallet_address = wallet["evmAddress"].lower()
private_key = wallet["evmPrivateKey"]

Step 2 — Buy Credits via x402

Send an initial credit purchase request. If the response is HTTP 402, read PAYMENT-REQUIRED, sign the USDC authorization, and retry with PAYMENT-SIGNATURE.

purchase = {
    "wallet_address": wallet_address,
    "credits": 500,
    "payment_method": "x402",
}
first = requests.post("https://www.agentpmt.com/api/external/credits/purchase", json=purchase, timeout=30)
if first.status_code == 402:
    payment_required = first.headers["PAYMENT-REQUIRED"]
    paid = requests.post(
        "https://www.agentpmt.com/api/external/credits/purchase",
        json=purchase,
        headers={"PAYMENT-SIGNATURE": "\x3Cbase64 signed authorization>"},
        timeout=30,
    )
    paid.raise_for_status()
else:
    first.raise_for_status()

Step 3 — Create a Session

session_response = requests.post("https://www.agentpmt.com/api/external/auth/session", json={
    "wallet_address": wallet_address,
}, timeout=30)
session_response.raise_for_status()
session_nonce = session_response.json()["session_nonce"]

Step 4 — Sign Requests

Balance and tool invocation use different EIP-191 message shapes. Lowercase the wallet and use a fresh request_id.

Balance uses the scoped shape with an empty payload:

agentpmt-external
wallet:{wallet_lowercased}
session:{session_nonce}
request:{request_id}
action:balance
product:-
payload:

Tool invocation uses the path-bound shape:

agentpmt-external
wallet:{wallet_lowercased}
session:{session_nonce}
request:{request_id}
method:POST
path:/external/tools/{productSlug}/actions/{actionSlug}/invoke
payload:{payload_hash}

For tool invocation, call the full URL https://www.agentpmt.com/api/external/tools/{productSlug}/actions/{actionSlug}/invoke, but prefer signing the canonical path /external/tools/{productSlug}/actions/{actionSlug}/invoke. Drop the host and query string. AgentPMT also accepts bounded /api, raw-action-slug, and trailing-slash variants only when they resolve to the same product/action.

payload_hash is the lowercase SHA-256 of the exact parameters object. Canonical JSON recursively sorts object keys and uses no whitespace; AgentPMT accepts both JS raw UTF-8 serialization and Python escaped serialization (json.dumps(parameters, sort_keys=True, separators=(",", ":"), ensure_ascii=True)). Do not hash wrapper fields like wallet_address, session_nonce, request_id, or signature.

Step 5 — Check Balance

balance_payload = {
    "wallet_address": wallet_address,
    "session_nonce": session_nonce,
    "request_id": "unique-balance-request-id",
    "signature": "0x...",
}
balance_response = requests.post("https://www.agentpmt.com/api/external/credits/balance", json=balance_payload, timeout=30)
balance_response.raise_for_status()

Security Rules

  • Never print, log, or return private keys, mnemonics, session secrets, or signatures.
  • Lowercase the wallet address in every signed message.
  • Use a fresh request_id for every signed request.
  • Refresh the session nonce only for EXTERNAL_SIGNATURE_SESSION_NONCE_INVALID or EXTERNAL_SIGNATURE_SESSION_NONCE_EXPIRED.
  • For EXTERNAL_SIGNATURE_MALFORMED or EXTERNAL_SIGNATURE_WALLET_MISMATCH, use the returned expected_message, accepted path candidates, accepted payload hash forms, expected_wallet, and recovered wallet field to self-correct before retrying.
  • For EXTERNAL_SIGNATURE_REQUEST_REPLAY, retry once with a fresh request_id.

Related Skills

  • x402 Bazaar: ../x402-bazaar
  • Agent Tool Marketplace: ../agent-tool-marketplace
  • AgentPMT marketplace: https://www.agentpmt.com
安全使用建议
Install only if you intend to let an agent manage AgentPMT payments. Treat the wallet private key, mnemonic, session nonce, signatures, and credit purchase flow as sensitive financial material, keep spending limits small, and store secrets outside prompts or logs.
能力标签
cryptofinancial-authorityrequires-walletcan-make-purchasesrequires-sensitive-credentials
能力评估
Purpose & Capability
The skill enables EVM wallet creation, USDC/x402 credit purchases, request signing, balance checks, and AgentPMT tool invocation; these are high-impact financial capabilities but are central to the declared payment purpose.
Instruction Scope
Instructions are scoped to AgentPMT external API endpoints and include security cautions for private keys, mnemonics, session values, signatures, request IDs, and nonce handling.
Install Mechanism
The artifact is a single markdown skill file with no executable scripts, package hooks, hidden installers, or automatic runtime behavior.
Credentials
The only requested local setup is installing standard Python libraries for HTTP requests and Ethereum signing; network calls are directed to the documented AgentPMT API and fit the integration purpose.
Persistence & Privilege
The skill tells users to store wallet private keys and mnemonics in a secret manager, but it does not create persistence itself or request elevated system privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-payment
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-payment 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
Publish agent-payment 1.0.2 with updated AgentPMT signing and payment guidance
v1.0.1
Clarify balance signing versus path-bound tool invocation signing.
元数据
Slug agent-payment
版本 1.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Agent Payment 是什么?

Agent Payment for AI agents on AgentPMT — create an EVM wallet via AgentAddress, buy USDC-denominated credits via the x402 protocol, sign authenticated reque... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 48 次。

如何安装 Agent Payment?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-payment」即可一键安装,无需额外配置。

Agent Payment 是免费的吗?

是的,Agent Payment 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Agent Payment 支持哪些平台?

Agent Payment 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Agent Payment?

由 AgentPMT(@agentpmt)开发并维护,当前版本 v1.0.2。

💬 留言讨论