# PrepLayer.ai — full reference Everything an agent needs to call PrepLayer in one fetch. Deterministic text preprocessing, paid per call with x402 (USDC). Base URL: https://preplayer.maximus-boomerus.workers.dev ## Protocol 1. `POST` the tool path with no payment header. 2. Receive `402` + `PAYMENT-REQUIRED` header (base64 JSON `{x402Version, accepts[]}`). 3. Pay the `accepts[0]` requirement (USDC, scheme `exact`) via a facilitator. 4. Retry with the `X-Payment` header set to the base64 `paymentPayload`. 5. Receive `200` JSON: the tool result plus a `payment_receipt` object. Treasury `0x8cb59b1bffb39c130ab85a8177e93eae9ddbaf10`. Networks Base `eip155:8453`, Solana `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`, Polygon `eip155:137`, Arbitrum `eip155:42161`. Polygon and Arbitrum price 1.2x Base. Every endpoint below is deterministic — no model is called underneath. ## normalize — $0.002 Unicode NFKC normalization, zero-width and bidi control stripping, smart-quote and dash folding to ASCII, whitespace collapsing, optional case folding. Returns a stable content hash for exact-equality comparison. POST `/v1/normalize` ```json { "text": "Hello, world—", "fold_case": true, "strip_invisible": true, "fold_width": true, "collapse_whitespace": true } ``` All flags except `text` default to `true`. `text` accepts 1-100000 characters. ## validate — $0.002 Validate and canonicalize a single identifier. Returns `{valid, canonical, fingerprint}`. POST `/v1/validate` ```json { "kind": "email", "value": "User@Example.COM" } ``` `kind` is one of: `email`, `url`, `phone` (E.164), `iban` (mod-97), `card` (Luhn), `uuid`, `sha256`, `gitsha`, `evm` (EIP-55 checksum), `domain`. ## slugify — $0.002 URL-safe slug generation with optional transliteration of non-ASCII characters. POST `/v1/slugify` ```json { "text": "Café Déjà Vu — Episode 1", "max_length": 80, "separator": "-", "transliterate": true } ``` ## hash — $0.002 Content hash for deduplication and integrity checks. POST `/v1/hash` ```json { "text": "some content", "algo": "sha256" } ``` `algo` defaults to `sha256`; `sha512` also supported. ## classify — $0.003 Language and content-type classification with a confidence threshold. POST `/v1/classify` ```json { "text": "…", "threshold": 0.5 } ``` ## validate_json — $0.003 Validate and canonicalize a JSON document against an optional JSON Schema. POST `/v1/validate_json` ```json { "json": { "a": 1 }, "schema": { "type": "object" } } ``` `schema` is optional; without it the call only checks well-formedness and canonical key order. ## extract — $0.005 Typed field extraction. Returns values with span offsets so you can cite them. POST `/v1/extract` ```json { "text": "…", "types": ["email", "url", "date", "money", "key", "person"] } ``` ## redact — $0.005 PII redaction by class, returning the redacted text plus the spans removed. POST `/v1/redact` ```json { "text": "…", "classes": ["email", "phone", "ssn", "card", "iban"] } ``` ## diff — $0.005 Deterministic line and word diff between two documents. POST `/v1/diff` ```json { "a": "first", "b": "second", "format": "unified", "context": 3 } ``` `format` accepts `unified` or `inline`; `context` is lines of surrounding context. ## chunk — $0.005 Token-aware chunking with overlap and a strategy selector. POST `/v1/chunk` ```json { "text": "…", "size": 512, "overlap": 64, "strategy": "recursive" } ``` ## extract_custom — $0.005 Extract arbitrary named fields that you define inline. POST `/v1/extract_custom` ```json { "text": "…", "fields": [ { "name": "ticket_id", "type": "string", "pattern": "TKT-[0-9]+" }, { "name": "amount", "type": "money" } ] } ``` ## dedupe — $0.01 Near-duplicate detection across a batch of up to 200 documents. Exact Jaccard similarity over word-3-shingle sets decides duplication; each document also gets a compact 64-bit SimHash content fingerprint. POST `/v1/dedupe` ```json { "documents": [{ "id": "a", "text": "…" }, { "id": "b", "text": "…" }], "threshold": 0.8 } ``` ## batch — $0.40 for 10 calls Run up to 10 of the tools above in a single paid call. $0.04 effective per call. POST `/v1/batch` ```json { "requests": [ { "endpoint": "normalize", "input": { "text": "Hello" } }, { "endpoint": "hash", "input": { "text": "Hello" } } ] } ``` ## Not implemented `/v1/subscription` ($200 per 10K calls) and `/v1/priority` are specified in the manifest but return `501 Not Implemented`. Do not route traffic to them. ## Discovery artifacts - `GET /` — health JSON with `Accept: application/json`, otherwise landing HTML - `GET /v1/manifest.json` — MCP tool manifest, JSON Schemas, per-network pricing - `GET /.well-known/x402` — x402 Bazaar service descriptor - `GET /server.json` — MCP Registry `ServerJSON` - `GET /llms.txt`, `GET /llms-full.txt` — this file and the index