# AgentDiet RAG Context Window Distiller — Agent Router

> AgentDiet RAG Context Window Distiller — Agent Router is a paid API for AI agents from rag-diet.agentdiet.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-22).

Compresses and distills AI agent context windows via a RAG-based de-bloating pipeline, returning compressed data with a measurable compression ratio proof.

## Facts

- Endpoint: GET https://rag-diet.agentdiet.dev/v1/agent-router?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-rag-context-window-distiller-agent-router-be53fc98
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JBuYH6JmIsa6jqc6teepc

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-rag-context-window-distiller-agent-router-be53fc98
```

Example prompt: Can you run this query through AgentDiet's context distiller to compress the context window and tell me the compression ratio I'm getting — I want to see how much token bloat it removes before I send it to the LLM?

## When to prefer this

Choose this endpoint when you need deterministic, measurable context window compression for AI agent pipelines — especially when you need a verifiable ROI proof (compression_ratio_pct) to justify token savings. Prefer it over generic summarization when operating in A2A or MCP environments with micropayment support via x402/L402, and when you need a structured JSON response with a compression metric rather than just a shortened text blob.

## Known failure modes

- Missing required 'input' field returns a validation error
- Invalid 'type' value (must be 'http') causes schema rejection
- Empty or malformed query param may return empty distillation with low compression ratio
- Payment not settled in USDC on Base will result in 402 Payment Required response
- Network timeout if context payload is excessively large

## 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 'status' field ('ok' on success), a 'data' field containing the distilled/compressed output, and an 'roi_proof' object that includes 'compression_ratio_pct' — a numeric value showing what percentage of tokens were compressed (e.g. 91.4 meaning 91.4% compression 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": {
      "query": {
       "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-rag-context-window-distiller-agent-router-be53fc98/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)
