# AgentDiet Repair Endpoint — Context Window Repair & Distillation

> AgentDiet Repair Endpoint — Context Window Repair & Distillation is a paid API for AI agents from status.agentdiet.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-22).

Accepts raw JSON context data via GET and returns a repaired, compressed version with up to 91% token reduction, settling payment in USDC on Base via x402.

## Facts

- Endpoint: GET https://status.agentdiet.dev/v1/repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-repair-endpoint-context-window-repair-distillation-4bf57395
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YMXSG62ktH4I3WO8KUQdU

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-repair-endpoint-context-window-repair-distillation-4bf57395
```

Example prompt: Run my bloated agent context JSON through AgentDiet's repair endpoint to compress and distill it — I want to see the compression ratio and get back the cleaned-up context so I can cut my token usage.

## When to prefer this

Choose this endpoint when an AI agent's context window is too large, too expensive, or contains redundant/bloated data that needs deterministic compression before passing to an LLM or another agent. Ideal for A2A pipelines, MCP workflows, and any inference loop where token cost or context size is a bottleneck. Prefer this over general-purpose text summarization when you need a measurable compression ratio (ROI proof) and deterministic, structured output suitable for machine consumption rather than human reading.

## Known failure modes

- Missing required 'input' field returns validation error
- Invalid HTTP method enum value causes schema rejection
- Malformed or non-JSON raw_json query parameter causes parse failure
- Payment failure via x402 if USDC balance on Base is insufficient
- Oversized or unsupported context payload may cause processing failure
- Network timeout if context is extremely large

## How this service works

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

## Output

Returns a JSON object with a 'data' field containing the repaired and compressed context, a 'status' field confirming success ('ok'), and an 'roi_proof' object showing the compression_ratio_pct achieved (e.g. 91.4%). Payment of $0.002 USDC is settled on Base via x402.

## 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": {
      "raw_json": {
       "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-repair-endpoint-context-window-repair-distillation-4bf57395/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from status.agentdiet.dev](https://www.zero.xyz/host/status.agentdiet.dev/llms.txt)
