Context
by Context Relay in Search & web
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.
https://context-relay.contextrelay.workers.dev/api/v1/context- Price
- $0.005
- per call in USDC
- Uptime
- 100%
- last 30 days
- Response time
- 546 ms
- 894 ms slowest 5%
- Last check
- Passed
- 3 h ago, next any minute now
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
POST https://context-relay.contextrelay.workers.dev/api/v1/context
Each call costs $0.005 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
POST https://context-relay.contextrelay.workers.dev/api/v1/context
content-type: application/json
{
"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"
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
freshness_seconds | integer | No | Default: 3600. |
max_price_usd | number | No | Abort before retrieval if the fixed service price exceeds this amount. |
max_tokens | integer | No | Default: 4000. |
question | string | No | Optional task or question used to rank relevant passages. |
url | string (uri) | Yes | Public HTTP or HTTPS page to retrieve. |
Example response
The provider's example. We can't check it without paying.
Example response, 67 lines
{
"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?"
}
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.005.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://context-relay.contextrelay.workers.dev/api/v1/context' \
-H 'content-type: application/json' \
--data-raw '{"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"}'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://context-relay.contextrelay.workers.dev/api/v1/context' \
-H 'content-type: application/json' \
--data-raw '{"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"}' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.005 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.005" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.005 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fcontext-relay.contextrelay.workers.dev%2Fapi%2Fv1%2Fcontext&method=POST
const res = await pay("https://context-relay.contextrelay.workers.dev/api/v1/context", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"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"
}),
});
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.005 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.005"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.post(
"https://context-relay.contextrelay.workers.dev/api/v1/context",
json={
"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",
},
)
print(res.status_code, res.text)Security scan
No findings
We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 3 h ago | Passed | 402 | 681 ms | $0.005 |
| 8 h ago | Passed | 402 | 666 ms | $0.005 |
| 12 h ago | Passed | 402 | 546 ms | $0.005 |
| 17 h ago | Passed | 402 | 802 ms | $0.005 |
| 22 h ago | Passed | 402 | 584 ms | $0.005 |
Show 10 older checks
| 26 h ago | Passed | 402 | 548 ms | $0.005 |
| 30 h ago | Passed | 402 | 466 ms | $0.005 |
| 34 h ago | Passed | 402 | 1.0 s | $0.005 |
| 39 h ago | Passed | 402 | 492 ms | $0.005 |
| 43 h ago | Passed | 402 | 539 ms | $0.005 |
| 47 h ago | Passed | 402 | 588 ms | $0.005 |
| 2 days ago | Passed | 402 | 529 ms | $0.005 |
| 2 days ago | Passed | 402 | 446 ms | $0.005 |
| 3 days ago | Passed | 402 | 614 ms | $0.005 |
| 3 days ago | Passed | 402 | 673 ms | $0.005 |