# AgentDiet Semantic Distillation

> AgentDiet Semantic Distillation is a paid API for AI agents from rag-diet.agentdiet.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-22).

Strips 85-97% of HTML token bloat from a URL's content, returning semantically distilled text optimized for AI context windows

## Facts

- Endpoint: GET https://rag-diet.agentdiet.dev/v1/distill?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-semantic-distillation-d3708713
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XajO7G4UNu_qyMl_r_Z_f

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-d3708713
```

Example prompt: Fetch the content at https://en.wikipedia.org/wiki/Large_language_model and distill it — strip all the HTML bloat so I can fit the key information into my context window without wasting tokens.

## When to prefer this

Choose this endpoint when you need to fetch a web URL and reduce its token footprint by 85-97% before feeding content into an LLM, RAG pipeline, or AI agent context window. It is particularly valuable when working with HTML-heavy pages where boilerplate navigation, scripts, and ads dominate raw content. Prefer this over generic web scrapers when token efficiency is the primary concern and you want a semantic signal rather than raw HTML.

## Known failure modes

- Invalid or unreachable URL returns an error status
- Paywalled or JavaScript-rendered pages may yield incomplete distillation
- Rate limiting or payment failure (x402) if USDC payment not properly handled
- Unsupported content types (binary files, PDFs) may not distill correctly
- Very short pages may show low compression ratios with minimal benefit

## How this service works

Deterministic B2A/A2A/MCP/x402/MPP/L402 execution and intelligence node at https://rag-diet.agentdiet.dev settling in USDC on Base.

## Output

A JSON response containing the distilled semantic content of the requested URL, a status field ('ok'), and an roi_proof object showing the compression_ratio_pct (e.g. 91.4%) achieved — confirming how much token bloat was removed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string"
      },
      "mode": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "status": "ok",
  "roi_proof": {
   "compression_ratio_pct": 91.4
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-semantic-distillation-d3708713/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rag-diet.agentdiet.dev](https://www.zero.xyz/host/rag-diet.agentdiet.dev/llms.txt)
