{"uid":"cap_v_nD__xFJ5QKS9TgBzD-I","slug":"json-repair-agentdiet-dev-web-url-context-compressor-bm25-budget-mode-1f37188d","name":"Web URL Context Compressor (BM25 Budget Mode)","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://json-repair.agentdiet.dev/v1/context-compress)","url":"https://json-repair.agentdiet.dev/v1/context-compress?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","minLength":1,"description":"Target webpage URL to fetch and distill (or builtin://stripe-docs)"},"html":{"type":"string","description":"Optional raw HTML string to distill directly without fetching"},"mode":{"enum":["markdown","structured","skeleton","budget"],"type":"string","default":"markdown","description":"Distillation mode"},"query":{"type":"string","description":"BM25 focus query when mode=budget"},"max_tokens":{"type":"integer","minimum":20,"description":"Strict token budget ceiling when mode=budget"}}},"responseSchema":{"type":"object","required":["status","roi_proof","data"],"properties":{"data":{"type":"object","description":"Distilled Markdown, structured JSON tables/metadata, skeleton outline, or BM25 budget excerpt."},"cache":{"type":"object","properties":{"status":{"enum":["HIT","MISS"],"type":"string"},"cache_key":{"type":"string"},"latency_ms":{"type":"number"}}},"status":{"type":"string","description":"Execution status ('ok')"},"billing":{"type":"object","properties":{"agent_id":{"type":"string"},"payment_method":{"type":"string"},"fee_charged_usd":{"type":"number"}}},"roi_proof":{"type":"object","properties":{"raw_tokens":{"type":"integer"},"tokens_saved":{"type":"integer"},"roi_multiplier":{"type":"number"},"distilled_tokens":{"type":"integer"},"llm_cost_saved_usd":{"type":"number"},"compression_ratio_pct":{"type":"number"}}}}},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.001","displayCostAsset":"USD","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fEK2jRMNW8qOCUgpQbMOx","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"json-repair.agentdiet.dev","brandSlug":"json-repair-agentdiet-dev-mpp","brandBaseUrl":"https://json-repair.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a webpage or raw HTML and distills it into compact, agent-ready tokens using markdown, structured, skeleton, or BM25 budget modes with token-ceiling control.","exampleAgentPrompt":"Can you distill this URL into compact markdown for my context window — https://docs.stripe.com/api — use budget mode with a BM25 query of 'payment intents' and cap it at 500 tokens?","exampleUseCases":[{"title":"Summarize docs page for agent context","prompt":"Distill the React documentation page at https://react.dev/reference/react/useState into structured markdown so I can fit it in my prompt without blowing my token budget."},{"title":"BM25 budget excerpt from long article","prompt":"I need just the sections about 'transformer attention mechanisms' from this long ML paper page at https://arxiv.org/abs/1706.03762 — use budget mode with that query and keep it under 300 tokens."},{"title":"Extract skeleton outline of competitor landing page","prompt":"Give me a skeleton outline of https://openai.com/pricing so I can quickly understand the page structure without pulling in all the content."}],"resultDescription":"Returns a JSON object with a 'data' field containing the distilled content (markdown, structured tables, skeleton, or BM25 excerpt), an 'roi_proof' block showing raw vs. distilled token counts, compression ratio, and estimated LLM cost saved, plus optional cache hit/miss status and billing details.","failureModes":["Invalid or unreachable URL returns an error status","HTML too large or malformed may produce incomplete distillation","max_tokens set below minimum (20) returns a validation error","mode=budget without a query may yield unfiltered results","Paywalled or bot-blocked pages may return empty or partial content","Payment failure (x402) if USDC balance is insufficient"],"whenToPreferThis":"Choose this endpoint when you need to fetch and compress a live webpage into agent-friendly tokens while staying within a strict token budget, especially when BM25 query-focused extraction is needed. It is preferable over generic scrapers when you want both compression ratio metrics and structured/markdown output optimized for LLM context windows. Best suited for single-URL distillation with cost-conscious token management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:18.931Z","isFirstParty":false,"canonicalSlug":"json-repair-agentdiet-dev-web-url-context-compressor-bm25-budget-mode-1f37188d"}