{"uid":"cap_3DUFlv0j3RMQPxCeoikoR","slug":"preflight-agentdiet-dev-web-url-context-compressor-edac279c","name":"Web URL Context Compressor","description":"Distill a web URL into compact agent-ready tokens (Live x402 v2, IETF MPP & MCP endpoint at https://preflight.agentdiet.dev/v1/context-compress)","url":"https://preflight.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 distill (or builtin://stripe-docs)"},"mode":{"enum":["markdown","structured","skeleton","budget"],"type":"string","default":"markdown","description":"Extraction mode: markdown, structured, skeleton, or budget"},"query":{"type":"string","description":"BM25 focus query when mode=budget"},"max_tokens":{"type":"integer","minimum":20,"description":"Strict token 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_FZz6En36dlFn9puvo84kH","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"preflight.agentdiet.dev","brandSlug":"preflight-agentdiet-dev-mpp","brandBaseUrl":"https://preflight.agentdiet.dev","brandDocsUrl":null,"whatItDoes":"Fetches a web page and distills it into compact, token-efficient agent-ready content using multiple extraction modes (markdown, structured, skeleton, or BM25-budget)","exampleAgentPrompt":"Distill https://stripe.com/docs/payments into compact markdown so I can fit it in my context window — use budget mode focused on 'webhooks' and keep it under 500 tokens.","exampleUseCases":[{"title":"Fit long docs into context window","prompt":"Grab https://docs.openai.com/guides/function-calling and compress it into skeleton mode so I can load the outline into my context window without blowing my token budget."},{"title":"Focused keyword extraction from a webpage","prompt":"Pull https://news.ycombinator.com and give me a budget excerpt focused on 'AI agents', capped at 300 tokens."},{"title":"Structured data extraction from a product page","prompt":"Distill https://www.stripe.com/pricing into structured mode so I can get the pricing tiers and feature tables in a clean JSON format."}],"resultDescription":"Returns a data object containing the distilled content (markdown, structured JSON, skeleton outline, or BM25 excerpt depending on mode), plus an roi_proof block showing raw vs distilled token counts, tokens saved, compression ratio percentage, and estimated LLM cost saved in USD. Also includes cache hit/miss status and billing details.","failureModes":["URL is unreachable or returns a non-200 response — endpoint may return an error status","URL content is empty or has no extractable text — distilled output may be minimal","BM25 query provided without mode=budget — query parameter ignored silently","max_tokens too low to fit any meaningful content — may return truncated or empty excerpt","Payment failure via x402 — request not fulfilled if USDC payment not completed","Invalid URL format — validation error on required url parameter"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to ingest web page content but must stay within a token budget or minimize LLM inference costs. It is especially useful when the raw HTML or full markdown of a page would be too large to fit in a context window. Prefer it over raw web scraping tools when you need token-count guarantees (budget mode with max_tokens), keyword-focused excerpts (BM25 mode), or clean structured tables from a page. Also prefer it when cost efficiency matters — the roi_proof field lets agents verify the compression ROI before deciding how to use the output.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:25:36.023Z","isFirstParty":false,"canonicalSlug":"preflight-agentdiet-dev-web-url-context-compressor-edac279c"}