# AgentDiet x402 Broker — Context Window Distiller

> AgentDiet x402 Broker — Context Window Distiller 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 an x402-gated broker endpoint, reducing token usage by up to 91% for A2A/MCP workflows, settled in USDC on Base.

## Facts

- Endpoint: GET https://rag-diet.agentdiet.dev/v1/x402-broker?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-x402-broker-context-window-distiller-c5828635
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_smFI4Ji-e1CtfZVlJHNLg

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-x402-broker-context-window-distiller-c5828635
```

Example prompt: Can you compress this context payload to reduce my token usage — use the AgentDiet distiller with a GET query so I can see the compression ratio proof before feeding it to my main model?

## When to prefer this

Choose this endpoint when you need to reduce context window size in an A2A, MCP, or RAG pipeline and want a verifiable compression ratio proof. It is particularly well-suited for agents running on x402 micropayment rails on Base/USDC, needing deterministic, cheap-per-call ($0.01) context distillation without a subscription. Prefer this over generic summarization APIs when you need structured ROI proof of compression and interoperability with B2A/A2A/MCP protocols.

## Known failure modes

- Missing or malformed `input` object — returns validation error
- Payment not settled in USDC on Base — x402 payment required before response
- Invalid `type` field (must be 'http') — schema const violation
- Unsupported HTTP method in `method` field — only GET and POST accepted
- Empty or missing `query` in queryParams — may return empty or null data
- Service node unavailable — deterministic execution node may be offline

## 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/compressed context, a `status` field confirming success, and an `roi_proof` object that includes a `compression_ratio_pct` value (e.g. 91.4%) quantifying how much the context was reduced.

## 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-x402-broker-context-window-distiller-c5828635/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)
