x402 tools for checking http 402 headers and openapi.json
# Add to your Claude Code skills
git clone https://github.com/underscoredone/x402-tools-skillGuides for using ai agents skills like x402-tools-skill.
Last scanned: 8/18/2026
{
"issues": [
{
"file": "SKILL.md",
"line": 92,
"type": "prompt-injection",
"message": "Possible concealment directive: \"do\nnot tell the user\"",
"severity": "medium"
}
],
"status": "PASSED",
"scannedAt": "2026-08-18T04:34:35.675Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}x402-tools-skill is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by underscoredone. x402 tools for checking http 402 headers and openapi.json. It has 1 GitHub star.
Yes. x402-tools-skill passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/underscoredone/x402-tools-skill" and add it to your Claude Code skills directory (see the Installation section above). x402-tools-skill ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
x402-tools-skill is primarily written in JavaScript. It is open-source under underscoredone on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh x402-tools-skill against similar tools.
No comments yet. Be the first to share your thoughts!
Read-only inspection of x402 endpoints. Two things it does:
It never pays, signs, or needs a wallet. It also never grades an endpoint: it reports what is there and leaves the conclusions to the reader.
openapi.jsonDo not use it to pay for anything — it has no wallet and cannot. If the user wants to actually call a paid endpoint, that is a different tool.
node scripts/x402.mjs inspect <url> [--method POST] [--body '{}'] [--json]
node scripts/x402.mjs openapi <url> [--no-compare] [--spec-url <url>] [--json]
node scripts/x402.mjs decode <base64-value>
Requires only Node 18+. Nothing to install — the engine is bundled in lib/.
When someone points at an endpoint — "what does X cost?", "inspect X", "/x402-tools for
X" — run inspect and then openapi, and report both. The 402 challenge and the
spec answer different questions: the challenge is what the endpoint charges right now,
the spec is what it documents about itself — its full parameter list, response schema,
error codes, and agent-readable x-* metadata. Someone deciding whether to call an API
needs both, and openapi also produces the spec-vs-live comparison, which exists only if
you run it.
node scripts/x402.mjs inspect https://api.syraa.fun/bitcoin --method POST --body '{}'
node scripts/x402.mjs openapi https://api.syraa.fun/bitcoin
openapi takes the same URL as inspect — it walks up to the origin itself to search.
Skip the openapi run only when the question is narrowly about payment ("is it Solana?",
"just the price") or when the user asked for inspect alone. If no spec is found, say so
in one line and move on — a missing spec is a fact worth reporting, not a failure to hide.
node scripts/x402.mjs inspect https://hash-hmac.underscoredone.com/hash --method POST --body '{}'
Most x402 endpoints only answer POST. A GET often returns 404 or 405 with no
challenge at all. If a GET shows no x402, retry with --method POST --body '{}' before
concluding the endpoint is not x402.
Output covers: the price both as real money and as the raw atomic number, each accepted network and token, the pay-to address, the settlement timeout, an example request and response where the endpoint publishes one, and any base64 headers decoded.
node scripts/x402.mjs openapi https://hash-hmac.underscoredone.com
Accepts an origin, an endpoint URL, or a direct link to a spec. Given an origin it tries
/openapi.json, /.well-known/openapi.json, /openapi.yaml, /docs/openapi.json,
/swagger.json, and then the x-openapi-url in the live challenge.
By default it also probes the live endpoint and prints a side-by-side table. Pass
--no-compare to skip that.
node scripts/x402.mjs decode eyJ4NDAyVmVyc2lvbiI6Miw...
Price. x402 quotes prices in the token's smallest unit. 10000 of a 6-decimal token
is 0.01, not ten thousand. The tool shows both; quote the human figure to the user.
Version. v2 puts the challenge in the payment-required response header as base64,
with an empty body. v1 puts it in the 402 response body as plain JSON. The tool reads
both and says which it found.
Differences between spec and live. Shown as two columns with no "correct" side. A spec being older than the endpoint it describes is ordinary. Report the difference; do not tell the user their API is broken.
Unknown tokens. If the tool does not recognise a token, it first looks for a
decimals the endpoint declared in that option's extra block. If it finds one it
converts the price and says the figure is the endpoint's own claim rather than one checked
against the token contract — pass that caveat along. A decimals in extra is ignored for
tokens the tool does know, so a challenge cannot talk it into a wrong price.
With no table entry and no declared decimals, it shows the raw number and says why. Do not guess on its behalf — a wrong price is worse than no price. It never queries a blockchain.
Notes. The Notes section is observations, not faults. Pass them along in the same
neutral register.
Default to everything the tool returned. Report every field, not a summary of the interesting ones. The person running this is usually inspecting an endpoint precisely because they don't yet know which field matters — dropping one to be concise forces another round trip. So unless asked otherwise, pass along:
Notes section, and the HTTP statusAnd from openapi, in the same detail:
operationId, the request body schema with
each field's type, whether it is required, and its description, plus every documented
response code with its meaningx-* metadata key in full — x-402, x-pricing, x-ai-instructions,
x-guidance, x-keywords, x-category, x-provider, x-openapi-url,
x-payment-accepts and any others. These are written for agents specifically;
x-ai-instructions in particular often carries the calling rules that nothing else
states. Do not summarise them away.If no spec is found, report which paths were tried and that none resolved.
When a spec covers many operations. Some specs are gateway-wide — api.syraa.fun
documents 35 operations for one endpoint you asked about. There, give the operation the
user actually pointed at in full detail as above, then list every other operation compactly
as method, path and summary — one line each. List all of them; a compact line is not the
same as omitting it, and the reader needs to know what else the API offers. The x-*
metadata and the comparison table stay in full either way.
Narrow the output only when the prompt actually narrows it — "just the price", "which networks?", "is it Solana?", "one line". Then answer that and stop. A specific question is a request for a specific answer, not a cue to dump the rest alongside it.
Two things that are not reasons to trim: length, and your own sense that a field is uninteresting. If the full output is long, give it structure — group it under headings or a table — rather than cutting it.
When the tool errors or returns nothing, report the failure verbatim, including the exact message and status. Sandbox egress blocks, 404s on GET-only endpoints, and unrecognised tokens are all more useful quoted than paraphrased.
The tool refuses private, loopback, link-local, and internal addresses, and re-checks where a hostname actually resolves — including after every redirect. If a URL is refused, that is deliberate; do not try to work around it.
x402 Tools by _done — https://underscoredone.com/x402-tools
Inspect any x402 endpoint before you pay it.
A Claude skill that calls a paid API without paying, decodes its payment challenge, and tells you in plain terms what it costs, which chains and tokens it takes, and how to call it. Plus reads any API's openapi.json.
It never pays, never signs, and never needs a wallet.
An x402 endpoint answers an unpaid request with 402 and a base64 blob. Decode it and the price reads "amount": "10000" — that's one cent, not ten thousand dollars. x402 quotes prices in the token's smallest unit, and USDC has six decimals. Except on BNB Chain, where it has eighteen. And DAI has eighteen everywhere. This skill does that arithmetic for you, from a table where every value was read off the token contract itself.
No npm install in any of these.
Claude Desktop / Claude Code — both read the same folder:
git clone https://github.com/underscoredone/x402-tools-skill.git ~/.claude/skills/x402-tools
Restart Claude. To scope it to one project, clone into that project's .claude/skills/ instead. Update later with git pull.
Claude on the web (claude.ai) — upload a zip:
x402-tools-skill-main to x402-tools — the folder name becomes the skill name.SKILL.md; the tools live in lib/ and scripts/.⚠️ On the web the skill runs in a sandbox with no outbound network by default, so inspect fails with Host not in allowlist: .... Fix it in Settings → Capabilities: turn on network egress and add each exact host (e.g. cpi-report-us.underscoredone.com). Wildcards like *.underscoredone.com are rejected, and on a managed account this may be admin-controlled. The web sandbox also has no wallet and skips the DNS-resolution safety check — the desktop install behaves exactly as documented here.
Command line only — no Claude required; see below.
Once installed, just ask in plain language — you don't need to name the skill:
what does https://hash-hmac.underscoredone.com/hash cost?
can I pay for that API with Solana?
read the openapi for dns-whois.underscoredone.com
Or directly:
node scripts/x402.mjs inspect https://hash-hmac.underscoredone.com/hash --method POST --body '{}'
node scripts/x402.mjs openapi https://hash-hmac.underscoredone.com
node scripts/x402.mjs decode eyJ4NDAyVmVyc2lvbiI6Miw...
# https://hash-hmac.underscoredone.com/hash
POST -> 402 Payment Required (573ms)
## x402
- version: 2
- challenge found in: payment-required response header (base64)
## What this endpoint is
**Hashing, HMAC & Checksum Suite**
Returns: application/json
Tags: sha256 hash, hash, hmac, hmac signature, verify hmac signature
## Payment options
1. **0.01 USDC** on Base Mainnet
- scheme: exact
- token: USDC `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
- raw amount: 10000 (6 decimals)
- pay to: `0xE9740820225B3918b4ddd1292C7cA4Ca0e2C2F08`
- must settle within: 300s
2. **0.01 USDC** on Solana Mainnet
- token: USDC `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`
- pay to: `8ugAWAXDB8V18kiUrGZTq1oMvU3C6Fxs8hfC6rvzQT3b`
- extra: {"feePayer":"BENrLoUbndxoNMUS5JXApGMtNykLjFXXixMtpDwDR9SP"}
## How to call it
(from extensions.bazaar)
- method: POST
- body type: json
Full transcripts, including a 21-option challenge across nine chains: examples/
| Flag | Applies to | Meaning |
|---|---|---|
--method <M> |
inspect | HTTP method. Most x402 endpoints only answer POST |
--body <json> |
inspect | Request body, e.g. '{}' |
--header k:v |
inspect | Extra header, repeatable |
--follow |
inspect | Follow redirects, re-checking safety at each hop |
--spec-url <u> |
openapi | Use this exact spec instead of searching |
--no-compare |
openapi | Skip probing the live endpoint |
--json |
both | Full structured output |
Getting "no x402 challenge found"? Retry with
--method POST --body '{}'. Most x402 endpoints ignore GET entirely.
inspect calls an endpoint without paying and reports the price in real money and the raw atomic number, every accepted network and token with human names, where the payment goes, the settlement deadline, how to call the endpoint when it publishes a schema, and any base64 headers decoded. Reads both v2 (challenge in the payment-required header, body empty) and v1 (challenge in the body).
openapi finds an API's spec (trying /openapi.json, /.well-known/openapi.json, /swagger.json and others), lays out its endpoints and agent-readable x-* metadata, then shows a side-by-side table of where the spec and the live endpoint differ.
decimals the challenge declares in its extra block — labelling that price as the endpoint's own claim — and otherwise shows the raw number and says why rather than guessing. A declared decimals never overrides the table, so a challenge cannot talk it into a wrong price.192.168.x.x, localhost, 169.254.169.254, *.internal and friends; checks what a hostname actually resolves to, and checks again after every redirect.USDC, USDT and DAI across Ethereum, Base, Polygon, Arbitrum, Optimism, BNB Chain, Avalanche, X Layer and Solana, plus testnets — 30 networks, 40 tokens, every decimals read off the token contract. Anything not in the table still works; the amount is shown unconverted with an explanation. Open an issue with the chain and token address and it'll get added.
Node 18 or newer. Nothing else — no dependencies, no build step, no API keys. npm test runs 13 tests, all offline.
Adding a token or chain is the most useful contribution — see CONTRIBUTING.md. The rule: read decimals() off the contract, never assume.
MIT. Copyright (c) 2026 One Scales Inc. Fork it, self-host it, sell it. A visible "powered by x402 Tools by _done" credit is appreciated but not required — see NOTICE.
Built by _done — pay-per-call APIs for AI agents.