# PDF Header Inspector

> PDF Header Inspector is a paid API for AI agents from file-formats.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Reads PDF version and header position from the first bytes of a file, flagging junk before %PDF- and invalid version strings.

## Facts

- Endpoint: GET https://file-formats.x402tookit.com/pdf-header?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pdf-header-inspector-441781ff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_L1bvbtXQnX9ZW3LRRh8Ek

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 pdf-header-inspector-441781ff
```

Example prompt: Check the PDF header from these first bytes and tell me the version, where the %PDF- marker starts, and whether the header is valid: 255044462d312e340a...

## When to prefer this

Choose this endpoint when you need to quickly inspect the first bytes of a PDF to verify its header structure, determine the PDF specification version, or detect whether junk bytes precede the %PDF- marker — without fully parsing or rendering the document. Ideal for file upload validation pipelines, forensic document triage, or pre-processing checks before passing files to a PDF parser.

## Known failure modes

- Hex string is too short to contain a recognizable PDF header — partial or missing data returned
- Non-hex characters in the hex query parameter — malformed input error
- File bytes do not contain %PDF- at all — invalid verdict with reasons
- Version string present but unrecognized — validVersion returned as false
- Service unavailable or payment not processed — HTTP 402 or 5xx error

## How this service works

Read a PDF's version and header position from its first bytes; flags junk before %PDF- and an invalid version.

## Output

Returns a structured object containing the PDF major and minor version numbers, the version string, header offset (bytes before %PDF-), whether the version is valid, whether a binary marker is present, the number of bytes examined, a verdict (valid/invalid), a summary, and a list of reasons for any flags raised.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "hex"
     ],
     "properties": {
      "hex": {
       "type": "string",
       "description": "First bytes of the PDF as hex, up to 512 bytes"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "major": {
       "type": [
        "null",
        "number"
       ]
      },
      "minor": {
       "type": [
        "null",
        "number"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "version": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "binaryMarker": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "headerOffset": {
       "type": [
        "null",
        "number"
       ]
      },
      "validVersion": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "bytesExamined": {
       "type": [
        "null",
        "number"
       ]
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pdf-header-inspector-441781ff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from file-formats.x402tookit.com](https://www.zero.xyz/host/file-formats.x402tookit.com/llms.txt)
