x402-verified-payment-fetch

x402-verified-payment-fetch is a skill for Claude Code, Codex from rezearcher/x402-data-api. It costs 147 tokens per session (1,260 once invoked), scanned A, original, MIT.

Make an agent that pays x402 (HTTP 402) endpoints verify every settlement on-chain, client-side, before it trusts the response it paid for. Drop-in wrapper around @x402/fetch that keeps the same call signature and adds a post-payment reconcile over two independent public RPCs on BOTH rails — Base (EVM USDC) and Solana…

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Install with agentmods
npx agentmods add skills/rezearcher/x402-data-api/x402-verified-fetch
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 rezearcher/x402-data-api --skill x402-verified-fetch
Clone the repo
git clone --depth 1 https://github.com/rezearcher/x402-data-api

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-verified-payment-fetch

README.md
[![agentmods](https://agentmods.dev/badge/skills/rezearcher/x402-data-api/x402-verified-fetch/github.svg)](https://agentmods.dev/skills/rezearcher/x402-data-api/x402-verified-fetch)
Your own site
<a href="https://agentmods.dev/skills/rezearcher/x402-data-api/x402-verified-fetch"><img src="https://agentmods.dev/badge/skills/rezearcher/x402-data-api/x402-verified-fetch/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-verified-payment-fetch

Your own site · 80×15
<a href="https://agentmods.dev/skills/rezearcher/x402-data-api/x402-verified-fetch"><img src="https://agentmods.dev/badge/skills/rezearcher/x402-data-api/x402-verified-fetch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 147 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,260 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00147 $0.01260
Opus 5.5 $0.00059 $0.00504
Sonnet 5.5 $0.00029 $0.00252
Haiku 4.5 $0.00015 $0.00126

Measured today against content hash 48fcf0a4407f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

x402-verified-payment-fetch 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 today.

The scan reads SKILL.md. This mod also ships 10 executable files (src/authz.ts, src/chain.ts, src/index.ts, …), 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.

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.

integrations/x402-verified-fetch/SKILL.md · 93 lines

How it starts

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

Verify every x402 payment on-chain, from the client

An agent with a wallet can auto-settle any HTTP 402 challenge. The x402 handshake tells it nothing about whether the money actually landed — at the recipient the endpoint advertised, for the amount it advertised, with a non-replayable authorization, for the resource it actually fetched. A facilitator that returns "settled": true is a claim, not a receipt. This skill makes the agent read the chain itself and decide.

Install

npm i github:rezearcher/x402-verified-fetch

(ESM, dependency-free beyond @x402/fetch + a wallet client; keyless public RPC, $0 COGS.)

Use

Same signature as @x402/fetch's wrapFetchWithPayment — it drops into an existing x402-paying agent with one line changed:

import { wrapFetchWithVerifiedPayment } from "@grey-ridge/x402-verified-fetch";

const fetchVerified = wrapFetchWithVerifiedPayment(fetch, walletClient, {
  onMismatch: "throw",        // abort the call if the money mis-settled
  onResourceMismatch: "strict" // abort if a different resource was substituted
});

const res = await fetchVerified("https://some-x402-api.example/paid");

// The verdict rides on a response header as JSON:
const s = JSON.parse(res.headers.get("x-grs-settlement") ?? "{}");
// s.verdict -> "SETTLED" | "UNDERPAID" | "WRONG_RECIPIENT" | "NO_TRANSFER" | "REVERTED" | "UNVERIFIED"
// s.rail    -> "evm" | "svm"
// (or pass { onSettlement: (s) => ... } to get the verdict object via callback)

After the payment settles, the wrapper decodes the PAYMENT-RESPONSE tx, reads it from two independent public RPCs (cross-confirmed, fails closed on disagreement), and reconciles the real on-chain transfer against the endpoint's advertised payTo + amount. SETTLED is the only verdict that means the money landed correctly; anything else is surfaced before the agent trusts the paid response. With onMismatch: "throw" a mis-settled call raises instead of returning a response the agent already paid for.

Read the full file on GitHub · 93 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. today First seen · 93 lines · 147 tokens per session scan A 48fcf0a4407f

Subscribe to this mod's changes

x402-verified-payment-fetch is a skill published in the GitHub repository rezearcher/x402-data-api (0 stars, last pushed today), licensed MIT. It adds 147 tokens to every session and 1,260 once invoked, about $0.0006 per session on Opus 5.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-11-06.

Related

x402-verified-payment-fetch compared with skills from other repositories

x402-verified-payment-fetch next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
x402-verified-payment-fetchrezearcher/x402-data-apiSkill0todayMITA147Claude Code, Codex
pantheon-stakingBankrBot/skillsSkill1.2k2d agononeA59Claude Code, Codex
delu-oracleBankrBot/skillsSkill1.2k2d agononeA87Claude Code, Codex
CTRLaaronjmars/aeon-agentSkill1222d agoMITA46Claude Code, Codex
ct-alphasendaifun/skillsSkill1313mo agoApache-2.0A71Claude Code, Codex
aero-vote-radararaxis33/aero-vote-radarSkill3yesterdayMITA84Claude Code, Codex
base-agent-treasurygblinproject/gblin-treasury-risk-regimeSkill1yesterdayMITA62Claude Code, Codex