# BRAINIAC llms.txt Context Budget Analyzer

> BRAINIAC llms.txt Context Budget Analyzer is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.03/call, status unknown (last checked 2026-11-12).

Analyzes an llms.txt document or raw text for token budget efficiency, duplicate content, and structural quality issues, returning a scored report with issues and recommendations.

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/llms-txt/context-budget-analyze?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-llms-txt-context-budget-analyzer-60a04026
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zx_4BFPvsxACCATjbsQsB

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability brainiac-llms-txt-context-budget-analyzer-60a04026 -d '<json body>'
```

Example prompt: Can you analyze this llms.txt document for me and check if it has any duplicate links, repeated lines, or token budget issues — then give me a quality score and recommendations to clean it up?

## When to prefer this

Use this endpoint when you need to validate and score an llms.txt document specifically — checking for duplicate lines, repeated URL paths, token budget sizing, and structural completeness. Prefer this over generic text linters when you are preparing an llms.txt file for AI agent consumption and want a domain-specific quality score with actionable recommendations. No account or API key is needed; payment is per-call in USDC on Base via x402.

## Known failure modes

- Text exceeds 200,000 character limit — request rejected
- Malformed document object missing required section fields — validation error
- Empty or missing both text and document fields — no content to analyze
- Network or payment failure via x402 — no response returned
- Token estimate inaccuracy for non-English or code-heavy content due to fixed 4-chars-per-token heuristic

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

A JSON object containing a 0–100 quality score, a list of issues (each with type, evidence, location, severity, and description), an analysis summary with character/line/link counts and estimated token count, warnings, limitations of the analysis, and an array of recommendations for improving the document.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "maxLength": 200000
  },
  "document": {
   "type": "object",
   "properties": {
    "title": {
     "type": "string",
     "maxLength": 200
    },
    "summary": {
     "type": "string",
     "maxLength": 5000
    },
    "sections": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "name",
       "links"
      ],
      "properties": {
       "name": {
        "type": "string",
        "maxLength": 200
       },
       "links": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "title",
          "url"
         ],
         "properties": {
          "url": {
           "type": "string",
           "maxLength": 2000
          },
          "title": {
           "type": "string",
           "maxLength": 200
          },
          "description": {
           "type": "string",
           "maxLength": 1000
          }
         },
         "additionalProperties": false
        },
        "maxItems": 200
       }
      },
      "additionalProperties": false
     },
     "maxItems": 50
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "score": 87,
  "issues": [
   {
    "type": "duplicate_line",
    "evidence": "Read this before calling the API today.",
    "location": "line 9 and line 10",
    "severity": "medium",
    "description": "The same line of at least 20 characters appears more than once."
   },
   {
    "type": "duplicate_url",
    "evidence": "/start",
    "location": "line 6 and line 7",
    "severity": "medium",
    "description": "The same link path is repeated, so an agent may read the same target twice."
   }
  ],
  "success": true,
  "analysis": "Measured 284 characters, 11 lines, and 2 links. The character estimate is 71 tokens at 4 characters per token.",
  "warnings": [],
  "limitations": [
   "The parser reads ATX headings, a blockquote directly after the H1, and markdown list links. It does not fetch URLs, run HTML, or decide that a link works.",
   "Token count is Math.ceil(characters / 4). It is not the tokenizer of any model.",
   "Score: 100, minus 5 per repeated line group (max 40), minus 8 per repeated path group (max 30), minus 8 when the text exceeds 8000 characters or 15 when it exceeds 20000.",
   "Repeated text is an exact trimmed line. Similar sentences that are not identical are not counted."
  ],
  "recommendations": [
   {
    "type": "repeated_description",
    "location": "line 6",
    "description": "The same link description appears on more than one link."
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-llms-txt-context-budget-analyzer-60a04026/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
