# FastX402 MIME Type from File Extension Lookup

> FastX402 MIME Type from File Extension Lookup is a paid API for AI agents from fastx402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-20).

Returns the canonical MIME type for a given file extension or filename

## Facts

- Endpoint: GET https://fastx402.tools/mime-from-extension?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastx402-mime-type-from-file-extension-lookup-8adfa3e0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OHRzTkx0Y2FS-g1V6k_I_

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-mime-type-from-file-extension-lookup-8adfa3e0
```

Example prompt: What MIME type should I use for a .pdf file? I need the canonical content-type string for setting HTTP headers.

## When to prefer this

Use this endpoint when you need a quick, pay-per-call MIME type lookup without setting up an API key or account. Ideal for AI agents that encounter file extensions at runtime and need to resolve content types dynamically. Prefer this over bundling a static MIME database when you want a lightweight, always-up-to-date lookup via HTTP.

## Known failure modes

- Unknown or unrecognized extension returns an error or null MIME type
- Missing required 'filename' query parameter returns a 400 error
- Payment failure via x402 protocol returns a 402 Payment Required response
- Malformed input (empty string) may return an error response

## 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 normalized file extension (e.g. 'pdf') and its canonical MIME type string (e.g. 'application/pdf').

## 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"
     ],
     "properties": {
      "filename": {
       "type": "string",
       "description": "A file extension like \"pdf\" or a filename like \"report.PDF\""
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "extension": {
       "type": "string"
      },
      "mime_type": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "extension": "pdf",
  "mime_type": "application/pdf"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastx402-mime-type-from-file-extension-lookup-8adfa3e0/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)
