1. Abstract
Expose x402 V2 payment requirements on payable HTTP resources so agents can recognize and satisfy payment requirements programmatically.
x402 lets agents discover paid HTTP resources through ordinary 402 responses, understand accepted schemes and networks, and retry with a signed payment payload without scraping checkout flows.
2. Classification
- Check ID
- x402
- Check version
- 1.0.0
- Package path
- lib/checks/x402/versions/1.0.0
- Category
- Agent Ease of Use
- Subcategory
- Agent Commerce
- Check group
- Commerce Protocols
- Check group ID
- commerce-protocols
- Maturity
- Emerging recommendation
- Scope
- site
- Check weight
- 1
3. Input And Output Contracts
- Input
- [email protected]
- Output
- [email protected]
- Resources inspected
- HTTP 402 response, PAYMENT-REQUIRED response header, PAYMENT-SIGNATURE request header, PAYMENT-RESPONSE response header, /.well-known/x402, /openapi.json
4. Scoring Semantics
| Step ID | Title | Weight | Description |
|---|---|---|---|
applicability | Decide whether x402 applies | 0.1 | Detect programmable paid-resource, HTTP 402, x402 header, OpenAPI, or community discovery signals. |
discover-candidates | Discover x402 candidate routes | 0.15 | Find candidate payable resources from homepage signals, API docs, and community x402 metadata. |
runtime-402 | Probe x402 runtime response | 0.2 | Safely probe candidate GET routes and look for HTTP 402 responses. |
v2-headers | Validate x402 V2 headers | 0.15 | Prefer PAYMENT-REQUIRED on 402 responses and record V2 or legacy payment header evidence. |
payload-shape | Validate x402 payment requirement payload | 0.2 | Decode Base64 JSON payment requirements and validate current x402 version and accepted payment option shape. |
network-scheme | Validate x402 networks and schemes | 0.1 | Classify payment schemes and validate CAIP-2 network identifiers. |
metadata-consistency | Compare x402 metadata consistency | 0.05 | Compare OpenAPI and community discovery metadata with observed runtime behavior. |
security-review | Review x402 metadata safety | 0.05 | Flag unsafe URLs, private targets, credentials, and secret-like public metadata. |
5. Package Documentation
X402 Check v1.0.0
Status
- Version:
1.0.0 - Check identifier:
x402 - Input contract:
[email protected] - Output contract:
[email protected] - Scope: site
- Maturity: emerging recommendation
Abstract
This check validates x402 V2 discovery for origins that expose programmable paid HTTP resources. It looks for public x402 or paid-resource signals, discovers safe candidate GET routes, probes those routes without sending payment, and validates observable 402 Payment Required responses that carry a V2 PAYMENT-REQUIRED header.
The check does not execute payments, sign payloads, call facilitator settlement endpoints, or verify blockchain transactions.
Motivation
x402 lets agents discover payable HTTP resources through ordinary HTTP responses. A server can return 402 Payment Required with machine-readable payment requirements, allowing a capable client to understand price, network, scheme, and payee before retrying with a signed payment payload.
Without clear x402 runtime evidence or metadata, agents cannot reliably distinguish a paid programmable resource from a human checkout flow, generic pricing page, or unavailable endpoint.
Normative Model
This version follows:
- RFC 9110 for the
402 Payment Requiredstatus code. - The IANA HTTP field registry to distinguish registered fields from x402
ecosystem header conventions.
- The IANA well-known URI registry to distinguish registered well-known URIs
from community conventions.
- Current x402 V2 documentation for
PAYMENT-REQUIRED,
PAYMENT-SIGNATURE, PAYMENT-RESPONSE, Base64 JSON payloads, CAIP-2 network identifiers, and V1-to-V2 migration guidance.
- CAIP-2 for network identifier shape.
Normative expectations used by the check:
- A payable resource should return HTTP
402before payment. - A current x402 V2
402response should includePAYMENT-REQUIRED. PAYMENT-REQUIREDshould be Base64-encoded JSON.- The decoded requirement should identify current x402 behavior, preferably
x402Version: 2.
- Payment requirements should include accepted payment options with scheme,
CAIP-2 network, payee or destination, and price or amount.
- Legacy V1 headers such as
X-PAYMENTandX-PAYMENT-RESPONSEare
compatibility evidence, not current pass criteria by themselves.
/.well-known/x402is treated as a community discovery signal, not as a
registered well-known URI requirement.
Applicability
The check applies when public evidence suggests the origin exposes programmable paid resources or x402 support:
- A sampled route or homepage returns
402 Payment Required. - A response contains
PAYMENT-REQUIRED,PAYMENT-SIGNATURE,
PAYMENT-RESPONSE, or legacy x402 payment headers.
- OpenAPI, Swagger, community metadata, or page content mentions x402, HTTP 402,
machine payments, paid API calls, paid endpoints, pay-per-use resources, or payment headers and also exposes a payable-looking machine route to probe.
/.well-known/x402exists.
The check is not applicable when:
- No programmable paid-resource or x402 signal is visible.
- The site only offers ordinary human ecommerce checkout with no paid
machine-readable HTTP resource evidence.
- The scanned origin is a marketing site for a payment product but does not
expose payable resources itself.
- The scanned origin merely describes x402, scanner capabilities, or generic
APIs without exposing an x402 payment header, HTTP 402, /.well-known/x402, or a payable-looking route.
Pass Criteria
The check passes when applicability is established and the strongest observable runtime evidence is valid:
- A discovered or sampled payable resource returns HTTP
402. - The response includes
PAYMENT-REQUIRED. PAYMENT-REQUIREDdecodes as Base64 JSON.- The decoded payment requirement indicates current x402 behavior, preferably
x402Version: 2.
- At least one accepted payment option includes:
- scheme
- CAIP-2 network identifier
- payee or destination
- price or amount
- OpenAPI or community metadata, when present, is consistent with observed
runtime behavior.
- No unsafe public metadata is detected.
Warning Criteria
Warnings include:
- x402 or paid-resource signals exist, but no safe payable candidate route is
discoverable.
- Candidate route probing is inconclusive because one or more routes are
unreachable.
- x402 metadata exists, but no probed candidate returns HTTP
402. - Only legacy or adjacent payment headers are visible.
/.well-known/x402is absent while other valid x402 signals exist.- A payment requirement is mostly valid but omits optional helpful metadata such
as resource description or MIME type.
- An unknown payment scheme is present with otherwise well-formed requirements.
Failure Criteria
Failures include:
- The origin clearly claims x402 support, but discovered candidate routes do not
return HTTP 402.
- A payable candidate returns
402withoutPAYMENT-REQUIRED. PAYMENT-REQUIREDis not Base64 JSON.- The decoded payment requirement omits accepted payment options.
- Accepted payment options omit scheme, network, payee or destination, or
price or amount.
- Network identifiers are not CAIP-2 formatted.
- Public metadata exposes localhost, private-network, credential-bearing, or
secret-like values.
Evidence Model
The check emits step-level evidence:
- Applicability signals from homepage status, homepage headers, homepage HTML,
OpenAPI/Swagger, and /.well-known/x402.
- Applicability gating details showing whether the signal came from runtime
status/headers, a payable homepage candidate, or metadata discovery.
- Candidate resources discovered from public metadata.
- Safe candidate probe results:
- path
- source
- status code
- content type
- final URL
- payment header names with redacted values
- bounded text sample where useful
PAYMENT-REQUIREDvalidation summary:- Base64 decode status
- JSON parse status
- version marker
- accepted option count
- schemes
- networks
- invalid network identifiers
- payee/destination presence
- amount presence
- description or MIME type presence
- Metadata consistency summary.
- Safety flags for private/internal URLs, credential-bearing URLs, and concrete
secret-like values. Ordinary OpenAPI authorization descriptions, OAuth authorization endpoints, and placeholder examples such as Authorization: Bearer <key> are not secret exposure by themselves.
Detailed logs must not include full payment payloads, signatures, credentials, cookies, API keys, private keys, full payment addresses, or full fetched metadata bodies.
Validation/Scoring Steps
The check uses these validation steps:
applicability(0.10): decide whether the origin exposes programmable paid
resources or x402 evidence.
discover-candidates(0.15): discover safe candidate payable routes from
homepage signals, API docs, and community x402 metadata.
runtime-402(0.20): probe candidate GET routes and look for HTTP402.v2-headers(0.15): validatePAYMENT-REQUIREDon402responses and
record V2 or legacy payment header evidence.
payload-shape(0.20): Base64-decode and JSON-parse payment requirements;
validate version and accepted payment option shape.
network-scheme(0.10): classify schemes and validate CAIP-2 network
identifiers.
metadata-consistency(0.05): compare OpenAPI and community metadata with
observed runtime behavior.
security-review(0.05): flag unsafe URLs, credentials, internal targets,
and secret-like public metadata.
Standard Behavior
If no programmable paid-resource signal is visible, the result is not_applicable.
If x402 or paid-resource signals are visible but no safe candidate payable route is discoverable, the result is warning.
If a payable candidate returns valid x402 V2 402 payment requirements, the result is pass.
If a site claims x402 support but emits malformed V2 headers, malformed payment requirements, non-CAIP-2 networks, or unsafe public metadata, the result is fail.
Non-Standard and Real-World Behavior
x402 implementations often protect API routes, MCP tool routes, download URLs, or content resources rather than the homepage. This check therefore uses public metadata to discover candidate routes, but it only sends safe unauthenticated GET probes.
OpenAPI descriptions and community /.well-known/x402 documents can help agents find payable routes. This version treats those as discovery evidence, not as substitutes for a valid runtime 402 response.
Some deployments still expose V1 headers, older package names, or legacy network aliases. This version records those signals as compatibility evidence, but V2 behavior is the preferred pass path.
Non-Goals and Limitations
This check does not:
- Execute payments.
- Sign payloads.
- Send
PAYMENT-SIGNATURE. - Call facilitator
/verifyor/settleendpoints. - Verify blockchain settlement, token balances, token decimals, nonces,
deadlines, replay protection, or signatures.
- Crawl every API route looking for paid resources.
- Treat ordinary human checkout ecommerce as x402 support.
- Treat
/.well-known/x402as an IANA-registered well-known URI.
References
- www.rfc-editor.org/rfc/rfc9110#status.402
- www.iana.org/assignments/http-fields/http-fields.xhtml
- www.iana.org/assignments/well-known-uris/well-known-uris.xhtml
- docs.x402.org/
- docs.x402.org/core-concepts/http-402
- docs.x402.org/guides/migration-v1-to-v2
- docs.x402.org/schemes/overview
- docs.x402.org/core-concepts/network-and-token-support
- github.com/x402-foundation/x402
- chainagnostic.org/CAIPs/caip-2
- www.rfc-editor.org/rfc/rfc9110
Source: lib/checks/x402/versions/1.0.0/docs.md
6. Version Changelog
x402 v1.0.0 Changelog
- Validates observable
402responses withPAYMENT-REQUIREDBase64 JSON payloads, x402 version markers, accepted payment options, and CAIP-2 network identifiers. - Treats
/.well-known/x402as community discovery evidence rather than a registered well-known URI requirement. - Records legacy V1 payment headers as compatibility signals instead of current pass criteria.
- Tightens applicability so generic x402/scanner copy and ordinary API routes do not make the check applicable without runtime payment signals, discovery metadata, or payable-looking machine routes.
- Avoids flagging ordinary OpenAPI authorization descriptions as secret exposure unless concrete secret-like values are published.
Source: lib/checks/x402/versions/1.0.0/changelog.md