# URL to Markdown API — agent onboarding

ScriptMasterLabs' URL to Markdown API converts a public HTTPS URL into clean,
LLM-ready Markdown. No account, no API key, no subscription.

Canonical page: https://scriptmasterlabs.com/url-to-markdown-api

## Price

- $0.001 USDC per accepted read, settled via x402 v2 on Base (eip155:8453).
- Failed reads are never charged: invalid, private, robots-blocked,
  unavailable, oversized, or undecodable sources return a no-charge
  alternative instead of settling.
- Repeat-buyer pack: 10 read credits for $0.005 USDC ($0.0005 per read) at
  GET /api/web/credits, spent via GET /api/web/extract.

## 1. Preview free (no wallet needed)

GET https://squeezeos-api.onrender.com/api/web/preview

Returns a fixed-source (example.com) extraction through the production engine
with charged: false. Use it to verify the response shape before paying.

## 2. Read the contract

GET https://squeezeos-api.onrender.com/api/web/reader-info

Price, payment terms, failure contract, and limits in one JSON document.

## 3. Request a page — receive the 402 challenge

GET https://squeezeos-api.onrender.com/api/web/read-markdown?url=https://example.com

An unsigned request returns HTTP 402 with a PAYMENT-REQUIRED header and a JSON
body whose accepts array states the exact terms (amount 1000 = $0.001 USDC,
USDC asset, network eip155:8453, payTo) plus a Bazaar discovery extension
describing the input and output schema.

## 4. Sign and retry

Sign an EIP-3009 transferWithAuthorization for the challenged amount and retry
the same URL with the x402 v2 PAYMENT-SIGNATURE header. Serialization
requirements, learned from live settlement:

- Serialize every authorization value as a string (value, validAfter,
  validBefore); numeric values are rejected by the facilitator validator.
- Echo the challenge's accepted object in the payment payload.

A successful retry returns the Markdown (text/markdown, or JSON with
format=json) plus a PAYMENT-RESPONSE header carrying the settlement
transaction hash on Base.

## Limits

- Public HTTPS only; private and non-global targets are blocked.
- robots.txt disallow is honored.
- No JavaScript rendering — static fetch only.
- max_chars 1000-50000.

## Naming

Product: URL to Markdown API (ScriptMasterLabs). Legacy names kept only as
compatibility aliases: SML Agent Web Access, Clean Web Reader, SML Web
Extract, SML x402 Clean Web Reader.
