# AgentDiet Semantic Distillation API

> AgentDiet Semantic Distillation API is a paid API for AI agents from agentdiet-72343955726.us-central1.run.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-13).

Fetches and distills a webpage URL or raw HTML into a compact, token-efficient representation (Markdown, structured JSON, skeleton outline, or BM25-pruned budget excerpt) to minimize LLM token consumption.

## Facts

- Endpoint: GET https://agentdiet-72343955726.us-central1.run.app/v1/distill?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-semantic-distillation-api-2c565fd5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cnUN35ysobTbXT7q7iYle

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 agentdiet-semantic-distillation-api-2c565fd5
```

Example prompt: Distill the webpage at https://stripe.com/docs/api into compact Markdown and tell me how many tokens you saved compared to the raw page.

## When to prefer this

Choose this endpoint when you need to feed webpage content into an LLM and want to minimize token usage and cost before doing so. It is especially valuable when processing long documentation pages, product pages, or any HTML-heavy URLs where raw content would exceed context limits or be wasteful. Prefer it over generic scrapers when you need token-budget control (BM25 pruning with max_tokens), structured extraction of tables and metadata, or a skeleton outline of page structure. The built-in ROI proof (tokens saved, cost saved) makes it easy to justify in cost-sensitive agent pipelines.

## Known failure modes

- URL is unreachable or returns a non-200 HTTP response, causing a fetch failure
- HTML is empty or too minimal to distill meaningfully, returning sparse output
- mode=budget used without providing a 'query' parameter, resulting in an error or fallback behavior
- max_tokens set too low relative to the content, producing a heavily truncated result
- Payment not provided or insufficient for L402/x402 micropayment, resulting in HTTP 402 rejection
- Rate limiting or timeout on the target URL causing a delayed or failed fetch

## How this service works

15-App Autonomous Business-to-Agent (B2A) API Hub & MCP Suite. Supports Web Distillation, On-Chain Risk, DEX Token Intelligence, B2B Lead Enrichment, Domain OSINT, Email Verification, SEC Filings, GitHub Audits, Prompt Firewall, and native HTTP 402 (x402 Base USDC).

## Output

Returns a 'data' object containing the distilled content in the requested format (Markdown text, structured JSON with tables and metadata, a skeleton outline, or a BM25-pruned excerpt), plus an 'roi_proof' object showing raw token count, distilled token count, tokens saved, compression ratio percentage, and estimated LLM cost saved in USD. Optionally includes cache status (HIT/MISS) and billing details.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "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",
   "description": "Distillation mode"
  },
  "query": {
   "type": "string",
   "description": "BM25 focus query when mode=budget"
  },
  "max_tokens": {
   "type": "integer",
   "description": "Strict token budget ceiling when mode=budget"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "mode": "markdown",
   "title": "Example Documentation",
   "content": "# Example Documentation\nClean agent-ready markdown..."
  },
  "status": "ok",
  "roi_proof": {
   "raw_tokens": 14200,
   "tokens_saved": 13520,
   "roi_multiplier": 67.6,
   "distilled_tokens": 680,
   "compression_ratio_pct": 95.2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-semantic-distillation-api-2c565fd5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentdiet-72343955726.us-central1.run.app](https://www.zero.xyz/host/agentdiet-72343955726.us-central1.run.app/llms.txt)
