Api Endpoint

Context Relay

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.

Open interactive test console

Offering

Provider
context-relay.contextrelay.workers.dev
Method
POST
Offering type
Api Endpoint
Transport type
http
Category
Web Search Research
Delivery
Not provided
Pricing model
Not provided
x402 version
2

Endpoint context

URL
https://context-relay.contextrelay.workers.dev/api/v1/context
MIME type
Not provided
First seen
2026-10-16T01:50:06.715Z
Last seen
Tags
url-to-markdown, web-extraction, context-compression, AI-agent, citations

Payment pricing

x402 payment terms are the authoritative price for calling this endpoint.

Payment option 1
0.005 USDC
Atomic price: 5000 · Network: eip155:8453 · Asset: USDC · Scheme: exact
Raw x402 terms
[
  {
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "5000",
    "payTo": "0x08B11EA90aEb253eF0F954BE108A12E6783D8189"
  }
]

Observed health

Status
Healthy
Latest latency
237 ms
Average latency
470 ms
HTTP status
204
Last checked
Reachability
100% over 14 checks

Latency is measured to the first response headers. A reachable result does not verify response accuracy or merchant identity.

Input schema

{
  "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 schema

{
  "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"
}