{"slug":"context-relay-contextrelay-workers-dev-api-v1-context-a11ed6","title":"URL-to-Markdown web extraction and context compression for AI agents","host":"context-relay.contextrelay.workers.dev","method":"POST","resource":"https://context-relay.contextrelay.workers.dev/api/v1/context","category":"code","description":"URL-to-Markdown web extraction and context compression for AI agents. Fetch a public web page and return clean, task-relevant, citation-verifiable LLM context with exact excerpts, locators, hashes, and estimated tokens saved. Use before an agent summarizes, answers questions from, or cites a long or","price_listed":0.005,"price_asked":0.005,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":407,"reported_calls_30d":2,"reported_payers_30d":2,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"max_price_usd":0.005,"max_tokens":2000,"question":"What is x402 designed to enable for agents and APIs?","url":"https://docs.cdp.coinbase.com/x402/welcome"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"freshness_seconds":{"default":3600,"maximum":86400,"minimum":60,"type":"integer"},"max_price_usd":{"description":"Abort before retrieval if the fixed service price exceeds this amount.","minimum":0,"type":"number"},"max_tokens":{"default":4000,"maximum":12000,"minimum":250,"type":"integer"},"question":{"description":"Optional task or question used to rank relevant passages.","maxLength":2000,"type":"string"},"url":{"description":"Public HTTP or HTTPS page to retrieve.","format":"uri","maxLength":4096,"type":"string"}},"required":["url"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"additionalProperties":false,"properties":{"context":{"additionalProperties":false,"properties":{"citations":{"items":{"additionalProperties":false,"properties":{"excerpt":{"type":"string"},"excerpt_sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"id":{"type":"string"},"locator":{"type":"string"}},"required":["id","locator","excerpt","excerpt_sha256"],"type":"object"},"minItems":1,"type":"array"},"estimated_tokens_saved":{"minimum":0,"type":"integer"},"markdown":{"type":"string"},"raw_token_estimate":{"minimum":1,"type":"integer"},"returned_token_estimate":{"minimum":1,"type":"integer"},"token_estimate_method":{"const":"characters_divided_by_4"}},"required":["markdown","citations","raw_token_estimate","returned_token_estimate","estimated_tokens_saved","token_estimate_method"],"type":"object"},"context_id":{"type":"string"},"delivery":{"additionalProperties":false,"properties":{"cache_status":{"enum":["hit","miss"]},"cost_class":{"enum":["cached","fresh_static"]},"currency":{"const":"USDC"},"economics":{"additionalProperties":false,"properties":{"estimate_basis":{"const":"configured_route_estimate"},"estimated_gross_margin":{"type":"number"},"estimated_gross_profit_usd":{"type":"number"},"estimated_variable_cost_usd":{"minimum":0,"type":"number"}},"required":["estimate_basis","estimated_variable_cost_usd","estimated_gross_profit_usd","estimated_gross_margin"],"type":"object"},"generated_at":{"format":"date-time","type":"string"},"latency_ms":{"minimum":0,"type":"integer"},"network":{"type":"string"},"payment":{"additionalProperties":false,"properties":{"failed_delivery_charge_policy":{"const":"not_settled_when_handler_status_is_400_or_higher"},"protocol":{"const":"x402"},"settlement_receipt_header":{"enum":["PAYMENT-RESPONSE","x402/payment-response",null]},"settlement_status":{"enum":["reported_in_response_header","reported_in_mcp_meta","not_applicable"]},"verification_status":{"enum":["verified","internal_unverified"]}},"required":["protocol","verification_status","settlement_status","settlement_receipt_header","failed_delivery_charge_policy"],"type":"object"},"price_usd":{"minimum":0,"type":"number"},"route":{"enum":["cache","public_html_direct"]},"status":{"const":"delivered"}},"required":["status","route","cache_status","price_usd","currency","network","cost_class","economics","latency_ms","generated_at","payment"],"type":"object"},"receipt_id":{"type":"string"},"safety":{"additionalProperties":false,"properties":{"prompt_injection_signals":{"items":{"type":"string"},"type":"array"},"public_source_only":{"const":true},"robots_policy":{"enum":["allowed","not_present","unavailable_4xx"]},"shared_cache_eligible":{"type":"boolean"},"source_directives":{"items":{"type":"string"},"type":"array"}},"required":["public_source_only","shared_cache_eligible","source_directives","robots_policy","prompt_injection_signals"],"type":"object"},"schema_version":{"const":"context-receipt.v1"},"source":{"additionalProperties":false,"properties":{"canonical_url":{"format":"uri","type":"string"},"content_sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"content_type":{"type":"string"},"fetched_at":{"format":"date-time","type":"string"},"final_url":{"format":"uri","type":"string"},"requested_url":{"format":"uri","type":"string"},"title":{"type":"string"}},"required":["requested_url","canonical_url","final_url","title","fetched_at","content_type","content_sha256"],"type":"object"},"transformation":{"additionalProperties":false,"properties":{"max_tokens":{"maximum":12000,"minimum":250,"type":"integer"},"method":{"const":"deterministic_extract"},"model_used":{"const":false},"pipeline_version":{"const":"html-deterministic.v1"},"question":{"type":["string","null"]}},"required":["pipeline_version","method","question","max_tokens","model_used"],"type":"object"}},"required":["schema_version","receipt_id","context_id","source","transformation","context","delivery","safety"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.005,"price_match":true,"latency_ms":407,"error":null}],"description_full":"URL-to-Markdown web extraction and context compression for AI agents. Fetch a public web page and return clean, task-relevant, citation-verifiable LLM context with exact excerpts, locators, hashes, and estimated tokens saved. Use before an agent summarizes, answers questions from, or cites a long or noisy URL. Deterministic and model-free. Public HTML only; no PDFs, logins, or JavaScript-only pages.","last_updated":"2026-09-14T19:49:34.504Z","schemes":["exact"]}