Valeo

Documentation

Everything you need to create, validate, and integrate with 402.md.


Quick Start

1. Create a file called 402.md in your project root.

2. Add YAML frontmatter with your pricing:

402.md
---
version: "1.0"
owner: "0xYourWalletAddress"
network: "base"

endpoints:
  - path: "/api/data"
    price: "$0.01"
    description: "Your data endpoint"
---

3. Deploy it so it's accessible at https://yourdomain.com/402.md

4. Submit your domain to the registry.

Using the Generator

Don't want to write YAML by hand? Use our interactive generator to build your 402.md step by step with a live preview.

Validating Your Manifest

Use our online validator to check your 402.md for errors before deploying.

Or validate programmatically with the npm package:

terminal
npm install @402md/validator
validate.ts
import { validate } from "@402md/validator";
import { readFileSync } from "fs";

const content = readFileSync("402.md", "utf-8");
const result = validate(content);

if (result.valid) {
  console.log("Valid!", result.normalized);
} else {
  console.log("Errors:", result.errors);
}

API Reference

POST/api/validate

Validate 402.md content without indexing.

POST/api/submit

Submit a domain for crawling and indexing.

GET/api/registry

Search and browse indexed sites.

GET/api/registry/[domain]

Get full details for a specific site.

GET/api/stats

Registry-wide statistics.

GET/api/badge/[domain]

Dynamic SVG badge for embedding.

Embedding a Badge

Add a verified badge to your README or documentation:

markdown
[![402.md](https://402md.org/api/badge/yourdomain.com)](https://402md.org/registry/yourdomain.com)

x402 Integration

402.md defines what things cost. The x402 protocol handles how payments are made.

For sellers (API providers), add x402 middleware:

terminal
npm install x402-next

For buyers (AI agents), use x402-fetch:

terminal
npm install x402-fetch