# AgentDiet Markdown Distill — Context Window Compressor

> AgentDiet Markdown Distill — Context Window Compressor 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).

Fetches a URL and distills its content into compressed, token-efficient markdown, reducing context window usage by up to 91% for AI agents

## Facts

- Endpoint: GET https://rag-diet.agentdiet.dev/v1/markdown-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-markdown-distill-context-window-compressor-2906c4cd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kWAotI-XGTGx4kuvhBQNC

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-markdown-distill-context-window-compressor-2906c4cd
```

Example prompt: Can you fetch https://en.wikipedia.org/wiki/Large_language_model and distill it down to just the essential content in compressed markdown so it fits efficiently in my context window?

## When to prefer this

Choose this endpoint when your AI agent needs to ingest web content but is constrained by context window size or token costs. It is especially useful in RAG pipelines, multi-step agent workflows, or any scenario where you're fetching external URLs and want to minimize token consumption. Prefer this over raw HTML fetchers or generic markdown converters when you need deterministic compression with a measurable compression ratio.

## Known failure modes

- Invalid or unreachable URL returns an error status
- URL behind authentication or paywalls cannot be fetched
- Very large pages may time out or return partial distillation
- Malformed input schema (missing 'type' or 'method' fields) returns validation error
- Payment not settled in USDC on Base results in 402 response blocking access

## 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

Returns a JSON object with a 'data' field containing the distilled markdown content, a 'status' field ('ok' on success), and a 'roi_proof' object showing the compression_ratio_pct (e.g. 91.4%), allowing agents to verify how much token reduction was achieved.

## 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-markdown-distill-context-window-compressor-2906c4cd/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)
