pay

A guided command for creating ACTP escrow payments or x402 instant payments, with support for resolving agent IDs through ERC-8004.

In plain words
What is it for?
Use it to collect and validate payment details, calculate fees, choose payment routing, and generate ready-to-use code.
Why use it?
It reduces mistakes when choosing a payment type, entering recipient and amount details, and preparing payment code.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/agirails/claude-plugin/pay
Clone the repo
git clone --depth 1 https://github.com/agirails/claude-plugin
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,978 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.01978
Opus 5 $0.00017 $0.00989
Sonnet 5 $0.00007 $0.00396
Haiku 4.5 $0.00003 $0.00198

Measured yesterday against content hash 4a2ee75f38fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pay scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/pay.md · 256 lines

How it starts

The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/agirails:pay

Create an ACTP or x402 payment with interactive guidance.

What This Command Does

  1. Check if SDK is installed
  2. Detect project language
  3. Collect payment details (recipient, amount, deadline)
  4. Detect payment type from recipient format (address, URL, or agent ID)
  5. Validate inputs
  6. Show payment summary with fee calculation
  7. Generate ready-to-use code

Payment Routing

How payment routing works based on recipient format:

Recipient Format     -> Payment Type
--------------------------------------------
Address (0x...)      -> ACTP escrow (multi-step, refundable)
URL (https://...)    -> x402 instant (single-step, non-refundable)
Agent ID (number)    -> Resolves via ERC-8004 -> ACTP escrow

Step-by-Step Instructions

Step 1: Check Prerequisites

Verify SDK is installed:

Check for node_modules/@agirails/sdk

If not installed:

"AGIRAILS SDK not found. Run /agirails:init first to install."

Step 2: Collect Payment Details

If arguments provided, parse them. Otherwise, ask interactively:

Recipient:

"Enter the recipient (address, URL, or agent ID):"

Detect pattern:

  • 0x... (40 hex chars) -> ACTP escrow payment
  • https://... -> x402 instant payment (requires X402Adapter)
  • Number -> ERC-8004 agent ID resolution -> ACTP escrow

For ACTP (0x... address):

Validate:

  • Is valid Ethereum address (0x + 40 hex chars)
  • Is checksummed (or offer to checksum)
  • Is not the same as requester address

For x402 (https://... URL):

Validate:

  • Must be HTTPS (HTTP rejected for security)
  • URL must be well-formed
  • Warn user that x402 payments are instant and non-refundable

For ERC-8004 (agent ID):

Validate:

  • Must be a positive integer
  • Will be resolved to an address via ERC-8004 Identity Registry

Amount:

"Enter payment amount in USDC:"

Validate:

  • Is a positive number
  • Is >= $0.05 (minimum)
  • Calculate and show fee: max(amount * 1%, $0.05)

Deadline (ACTP only):

"When should this payment expire?"
Options: [1 hour] [6 hours] [24 hours (Recommended)] [7 days] [Custom]

Read the full file on GitHub · 256 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 256 lines · 35 tokens per session scan A 4a2ee75f38fd

Subscribe to this mod's changes

pay is a command published in the GitHub repository agirails/claude-plugin (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 35 tokens to every session and 1,978 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.