# AgentDiet JSON Repair & Web Distillation Endpoint

> AgentDiet JSON Repair & Web Distillation Endpoint is a paid API for AI agents from onchain-risk-72343955726.us-central1.run.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-18).

Fetches a URL and returns a compressed, agent-ready markdown distillation of web content with token-reduction metrics, paid per-call via HTTP 402 USDC micropayment.

## Facts

- Endpoint: GET https://onchain-risk-72343955726.us-central1.run.app/v1/json-repair?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentdiet-json-repair-web-distillation-endpoint-d82429ae
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mIYAeh4dPzVOAQA-9ALuq

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-json-repair-web-distillation-endpoint-d82429ae
```

Example prompt: Distill the content at https://docs.example.com/api-reference into clean agent-ready markdown and tell me how many tokens it saves compared to the raw page.

## When to prefer this

Choose this endpoint when an AI agent needs to ingest web content but must minimize token usage — especially for documentation pages, API references, or data-heavy URLs. Prefer this over raw fetch/scrape when you need structured markdown output and measurable compression metrics. Best suited for agents operating under tight context window budgets or when paying per-token to an LLM.

## Known failure modes

- URL unreachable or returns non-200 status — distillation fails with an error
- Malformed or unparseable source content may result in partial or empty distillation
- Payment via HTTP 402/x402 not completed — request blocked before processing
- Rate limiting or quota exhaustion on the Cloud Run backend
- Source page is dynamic/JavaScript-rendered and cannot be fetched server-side
- Response truncated if source content is extremely large

## How this service works

15-App Autonomous Business-to-Agent (B2A) API Hub & MCP Suite. Supports Web Distillation, On-Chain Risk, DEX Token Intelligence, B2B Lead Enrichment, Domain OSINT, Email Verification, SEC Filings, GitHub Audits, Prompt Firewall, and native HTTP 402 (x402 Base USDC).

## Output

Returns a JSON object with a 'data' field containing the distilled content in markdown format along with a title and mode, plus an 'roi_proof' object showing raw token count, distilled token count, tokens saved, compression ratio percentage, and an ROI multiplier — all indicating how much context was saved relative to the original source.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "raw_json"
   ],
   "properties": {
    "raw_json": {
     "type": "string",
     "minLength": 1,
     "description": "Malformed, truncated, or markdown-wrapped JSON string to deterministically repair"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "status",
    "roi_proof",
    "data"
   ],
   "properties": {
    "data": {
     "type": "object"
    },
    "status": {
     "type": "string"
    },
    "roi_proof": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "mode": "markdown",
   "title": "Example Documentation",
   "content": "# Example Documentation\nClean agent-ready markdown..."
  },
  "status": "ok",
  "roi_proof": {
   "raw_tokens": 14200,
   "tokens_saved": 13520,
   "roi_multiplier": 67.6,
   "distilled_tokens": 680,
   "compression_ratio_pct": 95.2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentdiet-json-repair-web-distillation-endpoint-d82429ae/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchain-risk-72343955726.us-central1.run.app](https://www.zero.xyz/host/onchain-risk-72343955726.us-central1.run.app/llms.txt)
