URL-to-Markdown web extraction and context compression for AI agents
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.
5000 (raw units)
price
2
calls / 30d
2
unique payers
2026-09-14
updated
Provider
context-relay.contextrelay.workers.dev · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0x08B11EA90aEb253eF0F954BE108A12E6783D8189",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "5000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"info": {
"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": {
"example": {
"context": {
"citations": [
{
"excerpt": "x402 enables HTTP-native payments for APIs and agents.",
"excerpt_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
"id": "c1",
"locator": "p[2]"
}
],
"estimated_tokens_saved": 1200,
"markdown": "# Welcome to x402\n\n## c1 · p[2]\n\nx402 enables HTTP-native payments for APIs and agents.",
"raw_token_estimate": 1250,
"returned_token_estimate": 50,
"token_estimate_method": "characters_divided_by_4"
},
"context_id": "ctx_0123456789abcdef",
"delivery": {
"cache_status": "miss",
"cost_class": "fresh_static",
"currency": "USDC",
"economics": {
"estimate_basis": "configured_route_estimate",
"estimated_gross_margin": 0.8,
"estimated_gross_profit_usd": 0.004,
"estimated_variable_cost_usd": 0.001
},
"generated_at": "2026-01-01T00:00:00.250Z",
"latency_ms": 250,
"network": "eip155:8453",
"payment": {
"failed_delivery_charge_policy": "not_settled_when_handler_status_is_400_or_higher",
"protocol": "x402",
"settlement_receipt_header": "PAYMENT-RESPONSE",
"settlement_status": "reported_in_response_header",
"verification_status": "verified"
},
"price_usd": 0.005,
"route": "public_html_direct",
"status": "delivered"
},
"receipt_id": "rcpt_01234567-89ab-cdef-0123-456789abcdef",
"safety": {
"prompt_injection_signals": [],
"public_source_only": true,
"robots_policy": "allowed",
"shared_cache_eligible": true,
"source_directives": []
},
"schema_version": "context-receipt.v1",
"source": {
"canonical_url": "https://docs.cdp.coinbase.com/x402/welcome",
"content_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
"content_type": "text/html; charset=utf-8",
"fetched_at": "2026-01-01T00:00:00.000Z",
"final_url": "https://docs.cdp.coinbase.com/x402/welcome",
"requested_url": "https://docs.cdp.coinbase.com/x402/welcome",
"title": "Welcome to x402"
},
"transformation": {
"max_tokens": 2000,
"method": "deterministic_extract",
"model_used": false,
"pipeline_version": "html-deterministic.v1",
"question": "What is x402 designed to enable for agents and APIs?"
}
},
"type": "json"
}
},
"routeTemplate": "/api/v1/context",
"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"
}
}
}Use it
curl
curl "https://context-relay.contextrelay.workers.dev/api/v1/context" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://context-relay.contextrelay.workers.dev/api/v1/context");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://context-relay.contextrelay.workers.dev/api/v1/context")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/4687.json, and this resource appears in /discovery/resources and /discovery/search.