x402 payment notes
How a paid call settles — the metered USDT flow on X Layer.
Paid tools are metered per call with x402 v2 on X Layer (eip155:196), settled in USD₮0 via
the OKX facilitator. Assay needs no account or API key; the buyer still needs a compatible wallet
to authorize a paid replay.
The flow
- Negotiate for free —
initialize,tools/listand notifications are POSTs and complete without a payment challenge. This lets the client establish MCP and choose a service before any billing begins. A GET to/mcpinstead returns the standard 402 challenge:/mcpis the registered marketplace endpoint for the 0.05 USDT ATS scan, and a buyer's client validates an endpoint by probing it, so a 200 there would read as "not an x402 service" and refuse the purchase. Free machine-readable discovery lives at/.well-known/assay.json. - POST /mcp · tools/call — invoke a paid tool with plain JSON-RPC.
- HTTP 402 — the
PAYMENT-REQUIREDheader carries a base64 JSON challenge:x402Version: 2, anacceptsentry using schemeexact, networkeip155:196, the USD₮0 asset0x779ded0c9e1022225f8e0630b35a9b54be713736, atomic amount, and pay-to address. - Sign — the client signs an EIP-3009 exact-scheme authorization for the amount and retries
the same request with the
PAYMENT-SIGheader (also accepted:X-PAYMENT,PAYMENT-SIGNATURE). - 200 + PAYMENT-RESPONSE — the facilitator verifies and settles on-chain; the response carries the settlement proof and your result.
Marketplace resources
The generic /mcp endpoint must keep negotiation free. Assay therefore publishes concrete
resources such as /x402/asy_story_bank and /x402/asy_interview_prep for direct marketplace
integration. An unpaid GET or POST to one of those paid resources returns its own 402 immediately;
the paid replay returns the service result directly. Promotion and freelancer resources use
/x402/asy_promotion_dossier and /x402/asy_freelancer_proof_pack, which server-bind the correct
asy_create_dossier_job variant. Free job status, job result, and seal verification resources
return 200 without x402.
The complete live route map is published under marketplaceResources at
/.well-known/assay.json.
Intake: tolerant input, and no charge for a request we cannot serve
Two rules protect a buyer who is calling Assay for the first time.
Synonyms are accepted. The published schema is canonical, but the obvious guesses are mapped
onto it before anything else looks at the request: resume / cv / documentText → resumeText,
jobDescription / jobPosting / role → jd, a single claims string → the array the schema
declares, a base64 data: URI → raw base64, type: "promotion review" → variant: "promotion".
A canonical key you supply always wins over a synonym, and a chat-style message
(“can you scan my resume?”) is never mistaken for the résumé itself. Marketplace service names work
wherever a tool name or route slug is expected — /x402/ats-resume-scan and
tools/call { name: "ATS Resume Scan" } both resolve.
Preflight runs before settlement. If a request cannot produce the advertised capability — an
ATS scan with no résumé, a cover letter with no evidence, a dossier job with an attachment that
cannot decode — Assay answers with 400 invalid_request naming the missing input, the keys that
would satisfy it, and a runnable example. No payment is taken: the check runs ahead of the x402
gate, so charged: false is a fact about the rail, not a promise. An unpaid probe of a paid
resource still receives the standard 402 first, so marketplace validators see the challenge they
expect.
GET /x402/:service/schema (free, no payment) publishes one service's input contract — arguments,
price, and a working example — and GET /x402 lists them all.
Guarantees
- PolicyGate before payment. A request Assay refuses on policy is refused politely — and never charged.
- A refusal never costs money. Assay refuses to write what it cannot trace; that refusal is the product, so it is delivered before the paywall, not after it.
- Body-bound idempotent recovery. A settled call is cached against its
Idempotency-Key(or the payment signature hash). A retry with the same key and canonical arguments recovers the original result even if the payment header was lost. Reusing the key for different input returns409 idempotency_conflict— never another charge and never another person’s result. - Free means free.
asy_verify,asy_job_status, andasy_job_resultare never gated. - No charge before tool invocation.
GET, malformed transport requests,initialize,tools/list, and notifications never enter payment handling. Onlytools/callfor a paid tool can return a 402. - Fixed prices. The table in pricing is the table the paywall
enforces, published machine-readably at
/.well-known/assay.json.
The rail is proven end-to-end on X Layer mainnet with real USD₮0 — settlement
tx 0x4babf76c….

