agentgrade

← Knowledge Base

What is llms.txt?

llms.txt is a markdown file at /llms.txt that describes your service in natural language for LLMs. While OpenAPI gives machines a structured spec, llms.txt gives language models the context they need to understand what your service does, when to use it, and how.

Format

Per the llmstxt.org spec, the file must start with an H1 heading:

# Your Service Name

> Brief one-line description of what this service does.

## Overview

Your Service lets agents search and analyze public datasets. All read
endpoints are free. Write endpoints use x402 micropayments.

## Endpoints

- GET /api/search?q=term — Search datasets (free)
- POST /api/analyze — Run analysis on a dataset ($0.10 per call)
- GET /api/status — Health check (free)

## Authentication

Free endpoints need no auth. Paid endpoints return HTTP 402 with an
x402 payment challenge. Pay with USDC on Base.

## Examples

Search for climate data:
  GET /api/search?q=climate+data

Analyze a dataset:
  POST /api/analyze {"dataset_id": "climate-2024", "type": "summary"}

Why it matters

LLMs process natural language better than JSON schemas. llms.txt gives them the "human context" — what the service is for, practical examples, and the big picture. It complements OpenAPI rather than replacing it.

Spec maturity

Community standard. Defined at llmstxt.org. Widely adopted — major sites including Anthropic, Cloudflare, and Stripe publish llms.txt.

Learn more