# File Format Inspector – Extension vs Content Mismatch Detector

> File Format Inspector – Extension vs Content Mismatch Detector 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-30).

Compares a file's declared extension against its actual type inferred from the first bytes, flagging disguised executables or mismatched file types.

## Facts

- Endpoint: GET https://file-formats.x402tookit.com/extension-vs-content?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/file-format-inspector-extension-vs-content-mismatch-detector-c6eb9044
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LL5GguyTYTR99g4Q-J5Y6

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 file-format-inspector-extension-vs-content-mismatch-detector-c6eb9044
```

Example prompt: I just received a file called invoice.pdf — can you check if it's actually a PDF by comparing its extension to what its first bytes say it really is? Here's the hex: 4D5A9000...

## When to prefer this

Choose this endpoint when you need to cross-validate a file's declared extension against its actual binary signature — especially for security-sensitive upload pipelines, email attachment screening, or anti-phishing workflows. Prefer it over a generic MIME-type identifier when you specifically need to compare the claimed name against the true type and get a pass/fail verdict with reasons.

## Known failure modes

- Missing filename or hex query params — returns validation error
- Hex string too short to identify file type — may return inconclusive result
- Unrecognized magic bytes — detected type may be null or generic
- Degraded mode if signature database is partially unavailable — degraded flag set to true
- Non-hex characters in hex param — likely parse error

## How this service works

Compare a file name's extension with its real type from the first bytes; flags executables disguised as documents or images.

## Output

Returns a verdict on whether the file extension matches the detected content type, including the detected MIME type, detected type label, detected category, whether a double extension was found, a human-readable summary, a list of reasons supporting the verdict, and any disclaimers or caveats about the analysis.

## 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": [
      "filename",
      "hex"
     ],
     "properties": {
      "hex": {
       "type": "string",
       "description": "First bytes of the file as hex, up to 512 bytes"
      },
      "filename": {
       "type": "string",
       "description": "The file name as supplied, for example invoice.pdf or photo.jpg"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "filename": {
       "type": [
        "null",
        "string"
       ]
      },
      "extension": {
       "type": [
        "null",
        "string"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "detectedMime": {
       "type": [
        "null",
        "string"
       ]
      },
      "detectedType": {
       "type": [
        "null",
        "string"
       ]
      },
      "doubleExtension": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "detectedCategory": {
       "type": [
        "null",
        "string"
       ]
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/file-format-inspector-extension-vs-content-mismatch-detector-c6eb9044/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)
