# MoneyTools: MIME Type Sniffer

> MoneyTools: MIME Type Sniffer is a paid API for AI agents from tools.moneytools.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Detect the MIME type of a file or content by inspecting its filename extension, raw bytes, or text content

## Facts

- Endpoint: GET https://tools.moneytools.dev/v1/mime-sniff?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/moneytools-mime-type-sniffer-0a844215
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oyqrmy14Hro8hI10v16cQ

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 moneytools-mime-type-sniffer-0a844215
```

Example prompt: What MIME type is this file — the filename is 'report.pdf' and I can give you the first few bytes in base64 if needed?

## When to prefer this

Use this endpoint when you need lightweight, serverless MIME type detection without running a local magic-byte library. Ideal for AI agents that receive files as base64 blobs, filenames, or text snippets and need to determine content type before routing, validating, or serving them. Preferred over OS-level tools when operating in sandboxed or cloud environments.

## Known failure modes

- Ambiguous or missing inputs (no filename, bytes, or text provided) may result in a generic 'application/octet-stream' fallback
- Invalid base64 encoding in bytesBase64 will cause a parse error
- Extremely rare or proprietary file formats may not be recognized
- File bytes truncated below magic-byte threshold may yield incorrect results
- Rate limit exceeded on free tier returns 402 Payment Required until x402 payment is provided

## How this service works

Catalog of MoneyTools: 116 cheap, read-only tools for AI agents. Free daily tier, then x402 USDC micropayments or prepaid credits. Token safety, approvals, tx decoding, EIP-712 risk, gas, ENS, x402 validation, DNS, RDAP, JSON Schema, time, FX.

## Output

A JSON object containing the detected MIME type (e.g. 'application/pdf', 'text/csv') inferred from the provided filename extension, base64-encoded bytes, or text snippet. Also includes payment metadata (charged flag, network, amount in USD, transaction hash) and optional MoneyTools plan hints.

## 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": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "text": {
       "type": "string",
       "examples": [
        "<?xml version=\"1.0\"?><root/>"
       ],
       "description": "optional text body to peek"
      },
      "filename": {
       "type": "string",
       "examples": [
        "report.pdf"
       ],
       "description": "optional filename with extension"
      },
      "bytesBase64": {
       "type": "string",
       "examples": [
        ""
       ],
       "description": "optional base64 of the first bytes (≤64 KB decoded)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "properties": {
      "payment": {
       "type": "object",
       "properties": {
        "charged": {
         "type": "boolean"
        },
        "network": {
         "type": "string"
        },
        "amountUsd": {
         "type": "string"
        },
        "transaction": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      },
      "freeTier": {
       "type": "object"
      },
      "_moneytools": {
       "type": "object",
       "description": "optional plan / partner hints"
      }
     },
     "description": "Tool-specific JSON result (see llms.txt / openapi.json). Always includes payment info.",
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "note": "Heuristic only (extension + magic bytes + text peek). No file is stored.",
  "filename": "report.pdf",
  "fromText": "application/xml",
  "fromMagic": null,
  "confidence": "medium",
  "contentType": "application/xml",
  "fromExtension": "application/pdf",
  "bytesInspected": 28
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/moneytools-mime-type-sniffer-0a844215/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tools.moneytools.dev](https://www.zero.xyz/host/tools.moneytools.dev/llms.txt)
