# AttestPage recipes

Last updated: 2026-10-10

Short, runnable recipes for calling AttestPage from an agent. In each one, the agent checks a source before it cites it. Copy one, run it, then change the tools to fit your agent.

| Recipe | Runnable file | Framework | Language | How it calls AttestPage | Pays with x402 |
|---|---|---|---|---|---|
| [langchain.md](/docs/examples/langchain) | [langchain.mjs](/docs/examples/langchain.mjs) | LangChain (`create_agent`, `createAgent`) | Python and JavaScript | Python: a small client using only the standard library. JavaScript: the client from the OpenAI Agents SDK recipe | Python: no, free trial, then returns the price. JavaScript: yes, when a key is set |
| [openai-agents-sdk.md](/docs/examples/openai-agents-sdk) | [openai-agents-sdk.mjs](/docs/examples/openai-agents-sdk.mjs) | OpenAI Agents SDK | JavaScript | A small client over `fetch` | Yes, with `@x402/fetch` when a key is set |
| [claude-agent-sdk.md](/docs/examples/claude-agent-sdk) | [claude-agent-sdk.mjs](/docs/examples/claude-agent-sdk.mjs) | Claude Agent SDK | JavaScript | The `quoteproof-mcp` MCP server (stdio) | Yes, when `QUOTEPROOF_X402_KEY` is set |
| [fetch-x402.md](/docs/examples/fetch-x402) | [fetch-x402.mjs](/docs/examples/fetch-x402.mjs) | None | JavaScript | Plain `fetch`, one x402 payment step by step | Yes |

## Run a recipe

Each page shows its code in full, with what to install and the command that runs it. The LangChain (JavaScript) and OpenAI Agents SDK recipes share one client, [`attestpage.mjs`](/docs/examples/attestpage.mjs), shown on the OpenAI Agents SDK page.

- Plain fetch with x402 always pays, so it needs `ATTESTPAGE_X402_KEY`, the key of a wallet made only for testing.
- OpenAI Agents SDK runs on the free trial with no wallet key; it needs `OPENAI_API_KEY` for the model.
- LangChain (JavaScript) and Claude Agent SDK run on the free trial with no wallet key; they need `ANTHROPIC_API_KEY` for the model.

## Service address

```
https://vehcdj664efetfrsolne5umanq.srv.us
```

Every recipe uses this address by default. To call another address, set `ATTESTPAGE_URL` (the MCP server reads `QUOTEPROOF_URL`).

## Routes and prices

Prices are per call in USDC. The full list is at [`/pricing.json`](https://vehcdj664efetfrsolne5umanq.srv.us/pricing.json) and in the [OpenAPI document](https://vehcdj664efetfrsolne5umanq.srv.us/openapi.json).

| Route | What it answers | Price |
|---|---|---|
| `POST /v1/verify/quote` | Is this quote on the page at this URL: `exact`, `fuzzy` or `none`, with offsets and page hashes | US$0.01 |
| `POST /v1/verify/citations` | The same for up to 10 quote and URL pairs | US$0.10 per batch |
| `POST /v1/verify/quotes` | The same for up to 20 quotes on one page, fetched once | US$0.08 per batch |
| `POST /v1/verify/document` | Every quote with its link in a finished document, checked on the live page | US$0.10 per part of up to 10 pairs |
| `POST /v1/verify/document/preview` | The pairs a document check would make, and its price | free |
| `POST /v1/fetch` | A page as clean text, with a verdict on what came back (`real`, `bot_wall`, `js_shell`, `paywall`, `http_error` and others) | US$0.002 |
| `POST /v1/check/links` | Status, redirects, final URL and verdict for up to 10 URLs | US$0.005 per batch |
| `POST /v1/check/packages` | Whether up to 10 npm, PyPI or crates.io names exist, with latest version | US$0.005 per batch |
| `POST /v1/attest` | A signed, timestamped receipt over a SHA-256 you send | US$0.002 |
| `POST /v1/receipt/verify` | Checks a receipt's signature against the published keys | free |

Every answer from a paid route carries a `receipt`: an Ed25519-signed JWS of what the fetcher saw and when. A receipt records what was on the page at that time, not whether a statement on it is correct.

## How a call is paid

1. **Free trial.** Send the header `Quoteproof-Trial: 1` and a paid route answers without payment, a few calls a day, with at most 3 URLs or pairs per batch. Once the day's trial calls are used, a trial request gets `429 trial_exhausted` and is not charged. See [Limits](https://vehcdj664efetfrsolne5umanq.srv.us/docs/limits).
2. **402 Payment Required.** A valid request gets `402` when it has no trial header or is a trial batch over 3 items. The offer is in the `PAYMENT-REQUIRED` header: base64 JSON with the amount (USDC, 6 decimals), network and pay-to address.
3. **x402.** Sign the offer and send the same request again with the `PAYMENT-SIGNATURE` header. Payment settles only when the route answers with a status below 400; the answer then carries a `PAYMENT-RESPONSE` header.

Payments run on Base Sepolia (`eip155:84532`), a test network. Test USDC has no value. Use a wallet made only for testing, holding only test USDC.

A bad request gets `400` before any offer and is never charged. Error codes are listed at [`/docs/errors`](https://vehcdj664efetfrsolne5umanq.srv.us/docs/errors).

## Try it without code

```sh
# Free: what a verify/quote answer looks like
curl -s https://vehcdj664efetfrsolne5umanq.srv.us/v1/sample/quote

# The 402 offer for verify/quote, decoded
curl -s -o /dev/null -D - -X POST https://vehcdj664efetfrsolne5umanq.srv.us/v1/verify/quote \
  -H 'content-type: application/json' -d '{}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 -d
```

## More

- [Payments](https://vehcdj664efetfrsolne5umanq.srv.us/docs/payments)
- [MCP server](https://vehcdj664efetfrsolne5umanq.srv.us/docs/mcp)
- [llms.txt](https://vehcdj664efetfrsolne5umanq.srv.us/llms.txt)
