# Context Bloat Eliminator — URL & HTML Distiller with BM25 Budget Control

> Context Bloat Eliminator — URL & HTML Distiller with BM25 Budget Control is a paid API for AI agents from mesh.agentdiet.dev, paid per call via MPP, $0.001/call, status unknown (last checked 2026-11-21).

Fetches and distills a URL or raw HTML into clean Markdown, structured JSON, skeleton outline, or a BM25-focused token-budget excerpt to reduce LLM context bloat

## Facts

- Endpoint: POST https://mesh.agentdiet.dev/v1/context-bloat-eliminator?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Provider: mesh.agentdiet.dev
- Website: https://mesh.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/mesh-agentdiet-dev-context-bloat-eliminator-url-html-distiller-with-8be44f0d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wBqdAFmSUnsNyFMU0cfdm

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 mesh-agentdiet-dev-context-bloat-eliminator-url-html-distiller-with-8be44f0d -d '<json body>'
```

Example prompt: Fetch https://stripe.com/docs/payments and distill it into clean markdown, keeping only the most relevant parts about payment intents — use budget mode with my query 'payment intents' and a 500 token ceiling so it fits in my prompt without blowing up the context.

## When to prefer this

Use this endpoint when an AI agent needs to inject web content into an LLM prompt but the raw page is too large or noisy. It is especially valuable when you need token-budget control via BM25 relevance filtering, or when you want structured extraction (tables, metadata, skeleton) rather than raw HTML. Prefer it over generic scrapers when LLM cost savings and compression ratio reporting matter, or when you want a single endpoint that handles both URL fetching and raw HTML distillation with multiple output modes.

## Known failure modes

- URL unreachable or returns non-200 — distillation cannot proceed
- Token budget too small (max_tokens < 20) — rejected by schema validation
- Empty or unparseable HTML payload — may return minimal or empty distilled output
- BM25 query missing when mode=budget — query field required for budget mode
- Rate limit or payment failure — x402 payment not processed correctly
- Malformed URL string — validation error on the url field

## How this service works

Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://mesh.agentdiet.dev/v1/context-bloat-eliminator)

## Output

Returns a 'data' object containing the distilled output (Markdown text, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt depending on mode), plus an 'roi_proof' block showing raw_tokens, distilled_tokens, tokens_saved, compression_ratio_pct, and llm_cost_saved_usd. Also includes cache status (HIT/MISS) and billing details.

## 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/mesh-agentdiet-dev-context-bloat-eliminator-url-html-distiller-with-8be44f0d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mesh.agentdiet.dev](https://www.zero.xyz/host/mesh.agentdiet.dev/llms.txt)
