# Web URL / HTML BM25 Budget Distiller

> Web URL / HTML BM25 Budget Distiller is a paid API for AI agents from cve-intel.agentdiet.dev, paid per call via MPP, $0.001/call, status unknown.

Fetches and distills a URL or raw HTML into compact, query-focused tokens using BM25 budget control with a strict token ceiling

## Facts

- Endpoint: POST https://cve-intel.agentdiet.dev/v1/context-diet?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Activations on Zero: 0
- Provider: cve-intel.agentdiet.dev
- Website: https://cve-intel.agentdiet.dev
- Canonical page: https://www.zero.xyz/c/cve-intel-agentdiet-dev-web-url-html-bm25-budget-distiller-407c2174
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jZxP3jbgU403_7xSm8bqH

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 cve-intel-agentdiet-dev-web-url-html-bm25-budget-distiller-407c2174 -d '<json body>'
```

Example prompt: Distill https://stripe.com/docs/api into compact markdown using budget mode, focused on the query 'payment intents', and keep it under 500 tokens.

## When to prefer this

Choose this endpoint when an AI agent needs to load web content into a limited context window and wants to minimize token cost and LLM spend. Especially valuable when the agent has a specific query focus (use budget mode with BM25) or needs structured/outline views of complex pages. Prefer over generic scrapers when ROI metrics and token compression guarantees matter, or when working within strict token budgets for cost-sensitive pipelines.

## Known failure modes

- URL unreachable or returns non-200 — fetch failure with error status
- Token budget too small for meaningful content — may return truncated or empty excerpt
- Invalid mode enum value — schema validation error
- Both url and html omitted — missing required field error
- BM25 query missing when mode=budget — may fall back to full content or return error
- Malformed HTML input — distillation may produce garbled output
- Payment failure via x402 — 402 response before processing

## How this service works

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

## Output

Returns a distilled payload containing the content in the requested mode (markdown, structured JSON, skeleton outline, or BM25 budget excerpt), plus ROI proof fields showing raw token count, distilled token count, tokens saved, compression ratio percentage, estimated LLM cost saved in USD, and a ROI multiplier. 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/cve-intel-agentdiet-dev-web-url-html-bm25-budget-distiller-407c2174/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cve-intel.agentdiet.dev](https://www.zero.xyz/host/cve-intel.agentdiet.dev/llms.txt)
