# GZip Header Parser

> GZip Header Parser 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-29).

Parses the gzip file header from raw hex bytes, returning compression method, flags, modification time, original filename, OS identifier, and compression hint.

## Facts

- Endpoint: GET https://file-formats.x402tookit.com/gzip-header?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gzip-header-parser-877603d7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b23xzQ4duYwJqBycWUWw7

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 gzip-header-parser-877603d7
```

Example prompt: Can you parse the gzip header from this file? Here are the first 64 bytes in hex: 1f8b0800000000000003cb4855284e2d2e4e4c4f05000000ffff. I want to know the compression method, any flags set, the modification time, the original filename, and what OS created it.

## When to prefer this

Use this endpoint when you need to inspect or validate gzip file headers without fully decompressing the file — ideal for forensic analysis, upload validation pipelines, or audit workflows where you only have the raw bytes available. Prefer this over full decompression when you only need metadata (filename, OS, timestamps, flags) and want to avoid the cost of decoding the entire archive.

## Known failure modes

- Hex string too short (fewer than 10 bytes / 20 hex chars) — returns parse error or incomplete result
- Invalid hex encoding — returns error if non-hex characters are present
- File is not a gzip file (wrong magic bytes 1f8b) — returns failed verdict with reasons
- Truncated or corrupt header — returns degraded flag with partial results
- Missing required hex query parameter — returns 400 bad request

## How this service works

Parse a gzip header: method, flags, modification time, original file name, OS and compression hint.

## Output

Returns a structured breakdown of the gzip header including: compression method, flags object (text, name, extra, comment, headerCrc booleans), modification time (mtime as Unix timestamp and human-readable string), original filename, OS identifier, compression hint, number of bytes examined, a summary string, a verdict, any reasons or warnings, and flags for whether the parse was complete or degraded.

## 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": [
      "hex"
     ],
     "properties": {
      "hex": {
       "type": "string",
       "description": "First bytes of the gzip file as hex, at least 10 (up to 512 bytes)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "os": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "name": {
       "type": [
        "null",
        "string"
       ]
      },
      "flags": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "name": {
         "type": [
          "boolean",
          "null"
         ]
        },
        "text": {
         "type": [
          "boolean",
          "null"
         ]
        },
        "extra": {
         "type": [
          "boolean",
          "null"
         ]
        },
        "comment": {
         "type": [
          "boolean",
          "null"
         ]
        },
        "headerCrc": {
         "type": [
          "boolean",
          "null"
         ]
        }
       }
      },
      "mtime": {
       "type": [
        "null",
        "number"
       ]
      },
      "method": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "comment": {},
      "reasons": {
       "type": [
        "array",
        "null"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "complete": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "modified": {
       "type": [
        "null",
     
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gzip-header-parser-877603d7/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)
