# FastX402 File Signature Detector

> FastX402 File Signature Detector is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-29).

Detects the MIME type and file extensions of a file by analyzing its magic byte prefix (hex or base64 encoded)

## Facts

- Endpoint: GET https://fastx402.tools/file-signature-detect?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-file-signature-detector-2bd19916
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YDd1rlK3Vuw-lbPGu-XG2

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 fastx402-file-signature-detector-2bd19916
```

Example prompt: I have a file whose first bytes are '89504e47' in hex — can you detect what MIME type and file extension that corresponds to?

## When to prefer this

Use this endpoint when you need lightweight, stateless file-type detection from raw bytes without uploading an entire file or relying on file extensions or content-type headers. It is ideal for agent pipelines that receive binary blobs, user uploads, or network streams and need to validate or route files by their true format. Prefer it over full-file parsing libraries when only the magic byte prefix is available or when cost-efficiency at $0.002/call matters.

## Known failure modes

- Unrecognized byte prefix returns no match or empty result
- Invalid encoding parameter (neither 'hex' nor 'base64') causes a bad request error
- Malformed or truncated hex/base64 string may produce incorrect detection or an error
- Byte prefix too short to match any magic signature returns ambiguous result
- Payment failure via x402 results in 402 response before the tool is invoked

## How this service works

200 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.

## Output

A JSON object containing the detected MIME type string (e.g. 'image/png') and an array of associated file extensions (e.g. ['png']). If the byte sequence matches a known format, both fields are populated; otherwise the response may indicate an unknown type.

## 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": [
      "data",
      "encoding"
     ],
     "properties": {
      "data": {
       "type": "string",
       "description": "A short byte prefix encoded as hexadecimal or base64"
      },
      "encoding": {
       "type": "string",
       "description": "The data encoding: hex or base64"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "mime": {
       "type": "string"
      },
      "extensions": {
       "type": "array",
       "items": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mime": "image/png",
  "extensions": [
   "png"
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-file-signature-detector-2bd19916/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fastx402.tools](https://www.zero.xyz/host/fastx402.tools/llms.txt)
