# Web URL Distillation & BM25 Token Compressor

> Web URL Distillation & BM25 Token Compressor is a paid API for AI agents from prompt-guard.agentdiet.dev, paid per call via MPP, $0.001/call, status unknown (last checked 2026-10-21).

Fetches a webpage URL (or accepts raw HTML) and distills it into compact, agent-ready tokens using configurable modes including BM25 budget-controlled extraction

## Facts

- Endpoint: GET https://prompt-guard.agentdiet.dev/v1/paywall-clean-extract?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Provider: prompt-guard.agentdiet.dev
- Website: https://prompt-guard.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/prompt-guard-agentdiet-dev-web-url-distillation-bm25-token-compressor-5f7568ec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bvlD4Cfin7reKdSSUVuSB

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 prompt-guard-agentdiet-dev-web-url-distillation-bm25-token-compressor-5f7568ec
```

Example prompt: Distill this URL into compact markdown for me — https://stripe.com/docs/payments — and keep it under 1000 tokens by focusing on the topic 'payment intents', using budget mode.

## When to prefer this

Choose this endpoint when an AI agent needs to ingest webpage content but must stay within LLM token budgets or minimize LLM inference costs. Especially valuable when you need BM25-ranked relevance-focused extraction (mode=budget with a query), not just naive truncation. Prefer over generic scrapers when you need ROI metrics (tokens saved, cost saved) or when you want structured JSON tables or skeleton outlines rather than raw HTML. Also useful for passing raw HTML you already have without an additional fetch.

## Known failure modes

- URL unreachable or returns non-200 — fetch failure with error status
- Paywalled content cannot be accessed without credentials — may return partial or empty content
- Token budget too small (max_tokens < 20) — validation error
- BM25 query provided without mode=budget — query ignored or error
- Raw HTML too large to process within limits — truncation or error
- Invalid URL format — schema validation error
- Rate limit or payment failure via x402 — 402 Payment Required response

## How this service works

Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://prompt-guard.agentdiet.dev/v1/paywall-clean-extract)

## Output

Returns a JSON object containing: distilled content (Markdown, structured JSON, skeleton outline, or BM25-focused excerpt depending on mode), ROI proof metrics (raw token count, distilled token count, tokens saved, compression ratio %, LLM cost saved in USD, ROI multiplier), cache status (HIT/MISS with latency), and billing info. The 'data' field holds the actual distilled content.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "minLength": 1,
   "description": "Target webpage URL to fetch and distill (or builtin://stripe-docs)"
  },
  "html": {
   "type": "string",
   "description": "Optional raw HTML string to distill directly without fetching"
  },
  "mode": {
   "enum": [
    "markdown",
    "structured",
    "skeleton",
    "budget"
   ],
   "type": "string",
   "default": "markdown",
   "description": "Distillation mode"
  },
  "query": {
   "type": "string",
   "description": "BM25 focus query when mode=budget"
  },
  "max_tokens": {
   "type": "integer",
   "minimum": 20,
   "description": "Strict token budget ceiling when mode=budget"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "status",
  "roi_proof",
  "data"
 ],
 "properties": {
  "data": {
   "type": "object",
   "description": "Distilled Markdown, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt."
  },
  "cache": {
   "type": "object",
   "properties": {
    "status": {
     "enum": [
      "HIT",
      "MISS"
     ],
     "type": "string"
    },
    "cache_key": {
     "type": "string"
    },
    "latency_ms": {
     "type": "number"
    }
   }
  },
  "status": {
   "type": "string",
   "description": "Execution status ('ok')"
  },
  "billing": {
   "type": "object",
   "properties": {
    "agent_id": {
     "type": "string"
    },
    "payment_method": {
     "type": "string"
    },
    "fee_charged_usd": {
     "type": "number"
    }
   }
  },
  "roi_proof": {
   "type": "object",
   "properties": {
    "raw_tokens": {
     "type": "integer"
    },
    "tokens_saved": {
     "type": "integer"
    },
    "roi_multiplier": {
     "type": "number"
    },
    "distilled_tokens": {
     "type": "integer"
    },
    "llm_cost_saved_usd": {
     "type": "number"
    },
    "compression_ratio_pct": {
     "type": "number"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/prompt-guard-agentdiet-dev-web-url-distillation-bm25-token-compressor-5f7568ec/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from prompt-guard.agentdiet.dev](https://www.zero.xyz/host/prompt-guard.agentdiet.dev/llms.txt)
