{"uid":"cap_bBHkjsyBjzRGM-jh5xxV9","slug":"x402broker-prompt-compress-agentdiet-v1-distill-55aefbc4","name":"x402broker Prompt Compress (AgentDiet /v1/distill)","description":"Distill a URL or raw HTML payload with BM25 budget control (Live x402 v2, IETF MPP & MCP endpoint at https://x402broker.com/v1/prompt-compress)","url":"https://x402broker.com/v1/prompt-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":["x402"],"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":"unknown","protocol":"x402","network":"base","amountUsd":null,"per":"call","confidence":"unknown"},{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_kkxh1RaCY0VACxuLy1CX3","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_Mspbqw-M1pPH1tsVTRnX7","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a URL and compresses its HTML content by stripping 85-97% of token bloat, returning a semantically distilled, agent-ready version of the page.","exampleAgentPrompt":"Can you fetch https://example.com/article and compress it down using AgentDiet distillation so I get a clean, token-efficient version I can actually use in my prompt?","exampleUseCases":[{"title":"Token-efficient research pipeline","prompt":"I need you to grab this long documentation page at https://docs.someproject.io/overview and strip out all the HTML junk so I only get the meaningful text — I want to use it in my context window without blowing my token budget."},{"title":"Agent reading a news article","prompt":"Fetch https://techcrunch.com/2024/05/01/some-article and distill it down to just the core content — I want the cleanest, most compressed version possible for my AI to read."},{"title":"Product page content extraction","prompt":"Pull the content from https://shop.example.com/product/widget-pro and compress the HTML so I can process the product description and specs without all the navigation, ads, and footer noise."}],"resultDescription":"Returns a semantically distilled version of the requested web page with 85-97% of HTML token bloat removed, leaving only the meaningful textual content suitable for injection into an LLM context window.","failureModes":["URL is unreachable or returns a non-200 status — distillation fails with an error","Paywalled or login-required pages return partial or no content","Highly JavaScript-rendered SPAs may not yield meaningful static content","Invalid or malformed URL input results in a validation error","Rate limiting or upstream timeout causes request failure"],"whenToPreferThis":"Choose this endpoint when you need to fetch a URL and dramatically reduce its token footprint before using the content in an LLM prompt. It is ideal for agent pipelines where context window budget is a constraint and raw HTML is too noisy. Prefer it over generic scrapers when token efficiency and semantic fidelity are both important, especially for documentation pages, articles, and product pages.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T12:44:08.995Z","isFirstParty":false,"canonicalSlug":"x402broker-prompt-compress-agentdiet-v1-distill-55aefbc4"}