# AgentDiet Context Diet — AI Context Window Distiller

> AgentDiet Context Diet — AI Context Window Distiller 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).

Compresses and distills AI context windows by fetching a URL and returning a token-reduced summary with compression ratio proof

## Facts

- Endpoint: GET https://rag-diet.agentdiet.dev/v1/context-diet?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-context-diet-ai-context-window-distiller-7018752a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_e_D0pdbrioobs2SZhnA9S

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-context-diet-ai-context-window-distiller-7018752a
```

Example prompt: Can you run this URL through AgentDiet and compress it down — I want the distilled version with as few tokens as possible before I pass it into my context window: https://example.com/long-article

## When to prefer this

Choose this endpoint when you need to aggressively reduce token count of fetched web content before passing it into an LLM context window or RAG pipeline. It is purpose-built for A2A and agent-to-browser workflows where token cost and context limits are a bottleneck. Prefer it over generic summarization when you want a deterministic compression ratio proof and micropayment-compatible (x402/L402) integration settled in USDC on Base.

## Known failure modes

- URL is unreachable or returns non-200 — distillation cannot proceed
- URL content is already minimal — low or zero compression ratio returned
- Payment not settled in USDC on Base — x402 payment failure blocks request
- Invalid or missing 'input' object with required 'type' and 'method' fields — schema validation error
- Mode parameter not recognized — fallback to default mode behavior

## 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 containing the distilled/compressed content data, an 'ok' status, and an roi_proof object showing the compression_ratio_pct achieved (e.g. 91.4%), demonstrating token savings.

## 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-context-diet-ai-context-window-distiller-7018752a/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)
