# Delx PDF Header Sniff

> Delx PDF Header Sniff is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-16).

Detects whether a base64-encoded file prefix represents a PDF by inspecting its binary header signature.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/pdf-header-sniff
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-pdf-header-sniff-65f695ce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XzLxme3vSYllrEHuZHBCb

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 delx-pdf-header-sniff-65f695ce -d '<json body>'
```

Example prompt: I have a base64-encoded snippet of the start of a file — can you check if it's actually a PDF by sniffing its header? The prefix is 'JVBERi0xLjQK...'

## When to prefer this

Use this endpoint when you need a lightweight, fast check to determine if a file is a PDF before committing to heavier parsing or download operations. It is ideal for agent pipelines that need to filter or route files by type without loading the full document. Prefer this over full PDF parsers when you only need a boolean type-check, not content extraction.

## Known failure modes

- Missing or empty base64_prefix field returns an error
- Invalid base64 encoding causes a decode failure
- Prefix too short to contain a recognizable PDF magic number may return is_pdf: false even for valid PDFs
- Malformed JSON body returns a 400-level error

## How this service works

Sniff PDF magic and approximate size from base64 prefix. Call when rejecting non-PDF uploads before heavy OCR. Returns is_pdf and decoded_prefix_len as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.

## Output

Returns a JSON object indicating whether the file is a PDF (is_pdf: boolean), the length of the decoded prefix in bytes, and a schema identifier string ('delx/util-pdf-header-sniff/v1').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "base64_prefix": {
   "type": "string",
   "description": "Base64 prefix of a file for sniffing"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "is_pdf": true,
  "schema": "delx/util-pdf-header-sniff/v1",
  "decoded_prefix_len": 8
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-pdf-header-sniff-65f695ce/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)
