# Minify HTML

> Minify HTML is a paid API for AI agents from api.gadgethumans.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-30).

Strips whitespace and comments from HTML text, returning the minified output and bytes saved.

## Facts

- Endpoint: GET https://api.gadgethumans.com/html-minify?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/minify-html-ef116c29
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vVhNaPX-d83k8B97I3J4v

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 minify-html-ef116c29
```

Example prompt: Can you minify this HTML for me and tell me how many bytes I'll save? Here's the markup: <!DOCTYPE html><!-- page header --><html>  <body>  <h1>  Hello  </h1>  </body></html>

## When to prefer this

Choose this endpoint when you need a fast, synchronous, CPU-only HTML minification with an explicit byte-savings report — ideal for single-string payloads where you don't want a full build pipeline. It's simpler and cheaper than integrating a Node.js bundler or build tool for one-off or on-demand minification tasks.

## Known failure modes

- Missing or empty `html` query parameter returns an error
- Malformed HTML may still be processed but output quality is best-effort
- Extremely large HTML strings may exceed query parameter size limits
- Network or service errors return a non-ok response

## How this service works

Minify HTML by collapsing whitespace and removing comments, with the bytes saved. Pure CPU, instant.

## Output

A JSON object with an `ok` boolean indicating success, the minified HTML string, and a count of bytes saved compared to the original input.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "queryParams": {
     "type": "object",
     "required": [
      "html"
     ],
     "properties": {
      "html": {
       "type": "string",
       "description": "HTML text"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "example": {
     "ok": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/minify-html-ef116c29/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.gadgethumans.com](https://www.zero.xyz/host/api.gadgethumans.com/llms.txt)
