x402-buyer

x402-buyer is a skill for Claude Code, Codex from OpenLinkSoftware/ai-agent-skills. It costs 226 tokens per session (5,418 once invoked), scanned A, original, MIT.

A buyer-side client for x402 version 2, a web payment protocol that lets a server require payment before returning a resource.

In plain words
What is it for?
It helps probe a URL, sign an x402 payment request, retry the request, settle the payment through a facilitator, and report the result.
Why use it?
It handles the payment challenge and follow-up request needed to access an x402-protected URL.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps probe a URL, sign an x402 payment request, retry the request, settle the payment through a facilitator, and report the result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/openlinksoftware/ai-agent-skills/x402-buyer
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.

Any agent
npx skills add OpenLinkSoftware/ai-agent-skills --skill x402-buyer
Clone the repo
git clone --depth 1 https://github.com/OpenLinkSoftware/ai-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for x402-buyer

README.md
[![agentmods](https://agentmods.dev/badge/skills/openlinksoftware/ai-agent-skills/x402-buyer/github.svg)](https://agentmods.dev/skills/openlinksoftware/ai-agent-skills/x402-buyer)
Your own site
<a href="https://agentmods.dev/skills/openlinksoftware/ai-agent-skills/x402-buyer"><img src="https://agentmods.dev/badge/skills/openlinksoftware/ai-agent-skills/x402-buyer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for x402-buyer

Your own site · 80×15
<a href="https://agentmods.dev/skills/openlinksoftware/ai-agent-skills/x402-buyer"><img src="https://agentmods.dev/badge/skills/openlinksoftware/ai-agent-skills/x402-buyer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 226 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,418 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 7 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 138
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 167
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Privilege Escalation · line 343
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 361
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • medium Data Exfiltration · line 138
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 167
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Excessive Agency · line 192
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.1 $0.00226 $0.05418
Opus 5 $0.00113 $0.02709
Sonnet 5 $0.00045 $0.01084
Haiku 4.5 $0.00023 $0.00542

Measured 12d ago against content hash a9d1273433ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

x402-buyer scanned grade A with 1 finding 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 12d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (examples/circle-testnet-funding.sh, examples/local-dav.sh, examples/probe-challenge.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sS -o /dev/null -D - -k "<target-url>"
x402-buyer/SKILL.md · 420 lines

How it starts

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

x402 Buyer Skill

Buyer-side client for the x402 payment protocol (v2). Given a URL, it performs the full challenge → sign → retry → settle loop and reports what the facilitator did.

When to Use

  • "Pay for {url} with x402"
  • "Fetch this 402-protected resource"
  • "Run the x402 buyer against {url}"
  • "Settle this 402 challenge" / "What does the facilitator say about {url}?"
  • "Test OPL Shop's x402 support on DAV / SPARQL / OPAL"
  • Any request naming x402, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, PAYMENT-RESPONSE, EIP-3009, or a Base Sepolia facilitator.

Not this skill: a 402 carrying a Stripe/MPP challenge rather than an x402 PAYMENT-REQUIRED header — use mpp-stripe-client or acp-client. If you are unsure which protocol a URL speaks, run the probe in Step 1 before committing.

Prerequisites

Python 3, plus the buyer-side SDK stack:

python3 -m venv .venv && source .venv/bin/activate && pip install eth_account requests jsonschema "x402[requests,evm,extensions]"

jsonschema / the extensions extra is required even for a plain fetch — the SDK validates any extension the server's challenge advertises (e.g. eip2612GasSponsoring) before it will create a payment payload at all. Missing it fails deep inside signing, after the challenge already decoded successfully — see references/setup.md.

macOS: pip install keyring is optional — without it the script shells out to /usr/bin/security for the same Keychain item.

Linux / Windows: pip install keyring is required for credential-store access. There is no fallback binary on those platforms; without it, the key resolver skips straight to the interactive prompt on every run. See Cross-Platform Notes for the Linux caveat.

A funded buyer wallet private key. It is spent from, so it must hold testnet USDC on whatever network the server's PAYMENT-REQUIRED accepts[] advertises — Base Sepolia (eip155:84532) by default. Two testnet funding paths:

Read the full file on GitHub · 420 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 420 lines · 226 tokens per session scan A a9d1273433ca

Subscribe to this mod's changes

x402-buyer is a skill published in the GitHub repository OpenLinkSoftware/ai-agent-skills (38 stars, last pushed today), licensed MIT. It adds 226 tokens to every session and 5,418 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.