# AISkills402: x402 Payment Header Check

> AISkills402: x402 Payment Header Check is a paid API for AI agents from api.aiskills402.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-17).

Parses and validates an x402 PAYMENT-SIGNATURE header value — decoding, version, authorization fields, clock window, signer lane, and optional cross-check against a PAYMENT-REQUIRED header — without transmitting it anywhere.

## Facts

- Endpoint: POST https://api.aiskills402.com/v1/run/payment-header-check?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aiskills402-x402-payment-header-check-146c1fe0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_E_MkcBmrRgI6l9L6iL6d2

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability aiskills402-x402-payment-header-check-146c1fe0 -d '<json body>'
```

Example prompt: Before I send this payment request, can you check my x402 PAYMENT-SIGNATURE header value and tell me if it's correctly structured, what the clock window looks like, and whether there's any replay risk?

## When to prefer this

Use this endpoint when you need to validate or debug an x402 PAYMENT-SIGNATURE header before sending it, or when you want to cross-check it against a PAYMENT-REQUIRED header. It is the right choice for x402-protocol-specific header inspection, signer recovery, and clock/replay analysis. Prefer it over generic JWT or HTTP header validators when the header is specifically an x402 EIP-712 signed transfer authorization.

## Known failure modes

- Invalid or non-base64 payment_signature returns decoding errors with ok:false
- Missing required payment_signature field returns a 400-level error
- Malformed JSON inside the decoded header returns a parsing error
- Clock skew or expired authorization detected and reported in findings
- Signature recovery failure returns a null or invalid recovered address
- Payment not settled (insufficient USDC balance) returns a 402 before processing

## How this service works

Payment Header Check API: reads an x402 PAYMENT-SIGNATURE header before you send it - base64/UTF-8/JSON, version, authorization fields, clock window, who signed (lane a or b) and, with the seller PAYMENT-REQUIRED, payTo/amount/network/asset. Nothing is sent anywhere. $0.005 USDC per check. POST JSON {payment_signature, payment_required?}; free example at https://api.aiskills402.com/v1/run/payment-header-check/example

## Output

A JSON object indicating whether the header is valid, including: base64/UTF-8/JSON decoding results, x402 version, scheme, network, authorization fields (to, from, nonce, valid_after, valid_before, value_micro), clock state and skew, recovered signer address and lane (a or b), any findings with severity (e.g. long expiry window), and an optional cross-check against PAYMENT-REQUIRED fields (payTo, amount, network, asset).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "payment_required": {
   "type": [
    "string",
    "null"
   ],
   "maxLength": 16384,
   "description": "Optional: the seller PAYMENT-REQUIRED header value, for a cross-check of payTo, amount, network and asset."
  },
  "payment_signature": {
   "type": "string",
   "maxLength": 16384,
   "minLength": 1,
   "description": "The value of the PAYMENT-SIGNATURE (or X-PAYMENT) header you are about to send. It is only read here, never sent anywhere."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "skill": "payment-header-check",
  "engine": "1.0.0",
  "replay": false,
  "result": {
   "clock": {
    "now": 1792152000,
    "state": "valid",
    "skew_seconds": 120,
    "state_with_skew": "valid",
    "seconds_until_valid": 0,
    "seconds_until_expiry": 6609600
   },
   "scheme": "exact",
   "network": "eip155:8453",
   "decoding": {
    "json": true,
    "utf8": true,
    "base64": "standard",
    "non_ascii": false
   },
   "findings": [
    {
     "code": "expiry_window_long",
     "detail": "the authorization stays valid for another 6609600 seconds; a long window is replay exposure if the header leaks",
     "severity": "info"
    }
   ],
   "signature": {
    "lane": "a",
    "bytes": 65,
    "recovered": "0xa696565cfe3f65cdd0132a02e408c39418d8ce47",
    "domain_used": {
     "name": "USD Coin",
     "chainId": 8453,
     "version": "2",
     "verifyingContract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
    }
   },
   "x402_version": 2,
   "authorization": {
    "to": "0x0000000000000000000000000000000000000000",
    "from": "0xa696565cFe3f65cdD0132a02e408C39418D8cE47",
    "nonce": "0x5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e5e",
    "valid_after": 0,
    "value_micro": "1",
    "valid_before": 1798761600
   },
   "vs_requirements": null
  },
  "receipt": {
   "tx": "0x<settlement transaction>",
   "settled": true
  },
  "refusal": null,
  "input_sha256": "<sha256 of the request>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aiskills402-x402-payment-header-check-146c1fe0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.aiskills402.com](https://www.zero.xyz/host/api.aiskills402.com/llms.txt)
