# X402 Payment Header Shape Validator

> X402 Payment Header Shape Validator is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-23).

Validates the shape and encoding of an x402 payment header, returning acceptance/rejection status, normalized evidence, and mismatch reasons.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/x402-payment-header-shape?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-payment-header-shape-validator-da808270
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ocJ-J3uvdAIys5oADLKD2

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 x402-payment-header-shape-validator-da808270 -d '<json body>'
```

Example prompt: Before I accept this incoming paid request, check that the x402 payment header is correctly shaped — it's a base64 string starting with 'eyJ...' — and tell me whether it passes or fails and why.

## When to prefer this

Use this endpoint when you need a fast, in-memory, offline shape check of an x402 payment header without calling any external payment provider. It is ideal as a pre-flight guard before accepting or fulfilling a paid request, especially in agentic pipelines where you need to reject malformed headers cheaply before committing to downstream work.

## Known failure modes

- Header string exceeds 8192 character limit — returns an error or truncation rejection
- Header is neither valid base64 nor valid JSON — returns rejection with encoding mismatch reason
- Missing or empty header field — returns validation failure with missing-input reason
- Header passes shape but fails contract-specific checks — returns rejection with detailed mismatch reasons

## How this service works

X402 Payment Header Shape: X402 Payment Header Shape checks a caller-supplied payment header for bounded base64 or JSON shape from bounded caller-supplied values without an external provider. Call X402 Payment Header Shape before paying for or accepting an x402 or agent delivery assembled from caller-supplied challenge and result metadata. Returns contract-specific checks, normalized evidence, mismatch reasons, and an explicit acceptance or rejection status for X402 Payment Header Shape as vers…

## Output

Returns contract-specific shape checks, normalized evidence extracted from the header, specific mismatch reasons if the header is malformed, and an explicit acceptance or rejection status indicating whether the x402 payment header is valid.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "header": {
   "type": "string",
   "maxLength": 8192,
   "description": "Header supplied to X402 Payment Header Shape; used only for this bounded calculation and processed in memory without retention."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "encoding": "base64_json",
   "shape_valid": true
  },
  "schema": "delx/util-x402-payment-header-shape/v1",
  "status": "pass",
  "evidence": {
   "retained": false,
   "input_sha256": "d2df40bf50f271956773fe4254a5de1a334515afca29fda6e60cd96f1ec08c63",
   "external_calls": 0
  },
  "operation": "delivery_contract:x402_payment_header_shape"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-payment-header-shape-validator-da808270/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
