# Delx Commerce PDF Header Sniff

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

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

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/pdf-header-sniff?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-pdf-header-sniff-a09652c3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4KEWEXECtieVT2SDmkQ3Y

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-commerce-pdf-header-sniff-a09652c3 -d '<json body>'
```

Example prompt: Can you check if this base64 snippet I have is actually a PDF file? Here's the prefix: 'JVBERi0xLjQgJeL...'

## When to prefer this

Use this endpoint when you need a fast, cheap ($0.001 USDC) programmatic check to confirm a file is a PDF before committing to heavier processing like full PDF parsing or extraction. Ideal for agent pipelines that receive arbitrary file uploads and need to gate on file type without downloading or parsing the full file.

## 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 full PDF magic bytes signature may return false negatives
- Payment failure via x402 protocol blocks the request

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object with a boolean 'is_pdf' indicating whether the file header matches PDF format, the length of the decoded prefix examined, and a schema version 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-commerce-pdf-header-sniff-a09652c3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
