# PrepLayer.ai — deterministic text prep for agents > Batch-first: run a whole job in one $0.02 / 10-call bundle. Twelve x402-paid > endpoints for the boring text work an agent has to do before it can think: > normalize, validate, dedupe, redact, diff, chunk, extract, hash. > Pay per job in USDC over x402. No API keys, no accounts, no signup. > $0.10 of calls is available at NO COST to a first-time triallist wallet. The wallet identity X-Agent-Id: 0x is presented in place of a payment header on any route priced ≤ $0.01. > Every unpaid 402 body repeats this offer in its starter_credit field, so the offer is discoverable without reading this file. Base URL: `https://api.maximusmediahouse.com` ## Start here (free) - [Live demo — /v1/dedupe](https://api.maximusmediahouse.com/v1/demo): runs the real deterministic engine, ~1s, no wallet needed, output verifiable against the paid route. - [Credit envelope status](https://api.maximusmediahouse.com/v1/credit/status): the funded $0.50 starter-credit pool and how much prepaid capacity remains on cheap routes. ## Discovery (free, never charged) - [Machine manifest (MCP)](https://api.maximusmediahouse.com/v1/manifest.json): full tool list, JSON Schemas, per-network pricing. - [x402 discovery doc](https://api.maximusmediahouse.com/.well-known/x402): Bazaar-facing service descriptor, networks, resources. - [Full text reference](https://api.maximusmediahouse.com/llms-full.txt): every endpoint with parameters and prices, in one fetch. ## Repeat product: batch ladder (10 / 50 / 100 slots) - [batch](https://api.maximusmediahouse.com/v1/batch): run up to 10 of the primitives in one call. $0.02 per 10 calls (= $0.0020 each, below the priciest single route $0.01), one payment, one round trip. - [batch50](https://api.maximusmediahouse.com/v1/batch/50): up to 50 calls in one payment. $0.075 (= $0.0015/call). - [batch100](https://api.maximusmediahouse.com/v1/batch/100): up to 100 calls in one payment. $0.100 (= $0.0010/call). The ladder gets cheaper per call as the bundle grows. One payment covers the whole job. ## Recurring tier: prepaid call balance - [subscription](https://api.maximusmediahouse.com/v1/subscription): one settled $1.00 x402 top-up credits 1,000 prepaid calls (= $0.0010/call) you draw down across sessions on cheap routes (≤ $0.01). - [subscription balance](https://api.maximusmediahouse.com/v1/subscription/balance?wallet=0x…): the funded balance is the source of truth and is queryable by the buyer at any time. - remaining capacity is returned as the "remaining_calls" field on every paid response AND on both status endpoints above; it is null (never a misleading 0) when the caller is not on a prepaid balance. - This prepaid pack does not auto-renew: it is a one-time top-up, the spend stops when the balance reaches zero, and you top up again only when you choose to. - When the balance reaches zero, an eligible route returns HTTP 402 with error 'insufficient_prepaid_balance' and you can top up again at POST /v1/subscription. ## Foot-in-door: per-call All tools are `POST`, gated with x402. Price per single call on Base; other chains carry a 1.0x-1.2x multiplier (Polygon and Arbitrum are 1.2x). Sub-cent, so it never trips an agent-wallet approval. - normalize: Unicode NFKC, zero-width/bidi stripping, smart-quote and dash folding, whitespace collapse, case folding. Returns a stable content hash. $0.002 - validate: canonicalize one identifier — email, URL, E.164 phone, IBAN (mod-97), card (Luhn), UUID, SHA-256, git SHA, EVM address (EIP-55), domain. $0.002 - slugify: URL-safe slugs with optional transliteration. $0.002 - hash: SHA-256 / SHA-512 content hash. $0.002 - classify: language and content-type classification with a confidence threshold. $0.003 - validate_json: validate and canonicalize JSON against an optional schema. $0.003 - extract: typed field extraction (emails, URLs, dates, money, keys, people). $0.005 - redact: PII redaction by class with span offsets. $0.005 - diff: deterministic line/word diff with optional unified format and context. $0.005 - chunk: token-aware chunking with overlap and strategy selection. $0.005 - extract_custom: extract arbitrary named fields you define with types and patterns. $0.005 - dedupe: near-duplicate detection across up to 200 documents. Exact Jaccard over word-3-shingles plus a 64-bit SimHash fingerprint per doc. $0.01 ## Funded demo envelope (AX1 starter credit) A visiting wallet (X-Agent-Id header or body.payer) draws prepaid credit on cheap routes (≤ $0.01) with no payment header, up to the funded envelope (per-wallet cap $0.10 + a global $0.50 budget held in the credit pool wallet). EVERY unpaid 402 body carries this offer inline in its starter_credit field, naming the wallet identity X-Agent-Id: 0x presented in place of a payment header. The response is branded `payment_source: "starter_credit"` — never a fabricated x402 receipt. When the envelope is spent it's per-call x402 from there. Status: `GET /v1/credit/status`. ## Payment - Protocol: x402 v1, scheme `exact`, asset USDC. - Networks: Base `eip155:8453`, Solana `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`, Polygon `eip155:137`, Arbitrum One `eip155:42161`. - Treasury: `0x8cb59b1bffb39c130ab85a8177e93eae9ddbaf10` - Facilitator: `https://api.cdp.coinbase.com/platform/v2/x402` Call any paid endpoint with no payment header: the response is `402` plus a `PAYMENT-REQUIRED` header containing base64 payment requirements. A paid retry carries the payment in the `X-Payment` header and returns JSON. ## Using it from an MCP client Transport is streamable HTTP at `/mcp`: https://api.maximusmediahouse.com/mcp **Client-paid mode.** The calling agent pays with its own wallet; this service holds no keys and no funds. The client is `createx402MCPClient` from `@x402/mcp`: ```ts import { createx402MCPClient } from "@x402/mcp"; import { ExactEvmScheme } from "@x402/evm/exact/client"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const client = createx402MCPClient({ name: "my-agent", version: "1.0.0", schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }], autoPayment: true, }); await client.connect( new StreamableHTTPClientTransport(new URL("https://api.maximusmediahouse.com/mcp")), ); const out = await client.callTool("normalize", { text: "Hello, world—" }); // pays $0.002 ``` Without an x402 client: `tools/list` shows every tool and its price, and an unpaid `tools/call` returns the PaymentRequired object in `structuredContent` instead of a result. ## Notes - `priority` is specified in the manifest but not implemented: it returns `501`. It is not advertised as available. - `subscription` is a real recurring tier: a settled $1.00 top-up credits a prepaid call balance you can draw down and query (GET `/v1/subscription/balance`). - Every endpoint is deterministic: same input, same output, no model call underneath.