← Back to Skills Marketplace
🔌

Agent Payment

by AgentPMT · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ Security Clean
48
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install agent-payment
Description
Agent Payment for AI agents on AgentPMT — create an EVM wallet via AgentAddress, buy USDC-denominated credits via the x402 protocol, sign authenticated reque...
README (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
Usage Guidance
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.
Capability Tags
cryptofinancial-authorityrequires-walletcan-make-purchasesrequires-sensitive-credentials
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-payment
  3. After installation, invoke the skill by name or use /agent-payment
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug agent-payment
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 48 downloads so far.

How do I install Agent Payment?

Run "/install agent-payment" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Agent Payment free?

Yes, Agent Payment is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Agent Payment support?

Agent Payment is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Agent Payment?

It is built and maintained by AgentPMT (@agentpmt); the current version is v1.0.2.

💬 Comments