# Aayat AI Library Docs Fetcher

> Aayat AI Library Docs Fetcher is a paid API for AI agents from aayatai.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-02).

Fetches up-to-date, topic-filtered documentation for any npm, PyPI, crates, or Go library, trimmed to a token budget, with source attribution and current version.

## Facts

- Endpoint: GET https://aayatai.com/docs/lib?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aayat-ai-library-docs-fetcher-4926128b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cQkn6s4o5zIBRi_B70EAg

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 aayat-ai-library-docs-fetcher-4926128b
```

Example prompt: Can you pull up the current middleware docs for the hono npm library, focused on CORS, and keep it under 3000 tokens?

## When to prefer this

Choose this endpoint when a coding agent needs fresh, authoritative documentation for a specific library rather than relying on potentially stale training data. It is especially valuable when working with rapidly-evolving packages where APIs change between versions, or when you need topic-scoped docs trimmed to fit an LLM context window. Prefer it over generic web search when you want structured, version-tagged markdown with explicit source attribution rather than raw HTML pages.

## Known failure modes

- Library not found in the specified ecosystem — returns an error or empty content
- Topic too narrow with no matching documentation sections
- Token budget too small to return meaningful content (minimum 500)
- Documentation source unavailable or unreachable at crawl time
- Incorrect ecosystem specified for the library (e.g. npm instead of pypi)
- Rate limiting or payment failure via x402 protocol

## How this service works

Up-to-date docs for any npm, PyPI, crates or Go library: finds the project's own llms.txt and docs pages (or the latest release's README), keeps only the sections relevant to topic within a tokens budget, and returns them with sources and the current version. library is the package name; ecosystem defaults to npm. ?library=hono&topic=middleware&tokens=3000

## Output

Returns a JSON object containing: markdown-formatted documentation content (with HTML comment source headers), the library's latest published version, the package ecosystem, a list of source URLs with their kind (llms.txt, docs-page, readme, etc.), an estimated token count, a truncation flag indicating if content was cut to fit the budget, a homepage URL, and a fetchedAt timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "library"
     ],
     "properties": {
      "topic": {
       "type": "string",
       "maxLength": 200,
       "description": "What you need, e.g. routing, authentication, streaming responses (default: overview)."
      },
      "tokens": {
       "type": "integer",
       "default": 4000,
       "maximum": 12000,
       "minimum": 500,
       "description": "Most tokens of documentation to return."
      },
      "library": {
       "type": "string",
       "maxLength": 214,
       "minLength": 1,
       "description": "Library/package name as published, e.g. hono, fastapi, serde, github.com/gin-gonic/gin."
      },
      "ecosystem": {
       "enum": [
        "npm",
        "pypi",
        "crates",
        "go"
       ],
       "type": "string",
       "default": "npm",
       "description": "Package ecosystem: npm, pypi, crates (Rust) or go (Go modules)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "library",
      "ecosystem",
      "version",
      "content",
      "tokens",
      "sources"
     ],
     "properties": {
      "topic": {
       "type": [
        "string",
        "null"
       ]
      },
      "trust": {
       "type": "object",
       "description": "Third-party text, cleaned: read trust.notice; removed = what we stripped."
      },
      "tokens": {
       "type": "integer",
       "description": "Estimated tokens in content."
      },
      "content": {
       "type": "string",
       "description": "Markdown documentation, each part headed by an HTML comment naming its source."
      },
      "library": {
       "type": "string"
      },
      "sources": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         },
         "kind": {
          "enum": [
           "llms.txt",
           "llms-fu
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "topic": "cors middleware",
  "tokens": 42,
  "content": "<!-- source: https://hono.dev/docs/middleware/builtin/cors -->\n# CORS Middleware\n\n```ts\nimport { cors } from 'hono/cors'\napp.use('/api/*', cors())\n```",
  "library": "hono",
  "sources": [
   {
    "url": "https://hono.dev/docs/middleware/builtin/cors",
    "kind": "docs-page"
   }
  ],
  "version": "4.13.9",
  "homepage": "https://hono.dev",
  "ecosystem": "npm",
  "fetchedAt": "2026-09-28T12:00:00.000Z",
  "truncated": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aayat-ai-library-docs-fetcher-4926128b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from aayatai.com](https://www.zero.xyz/host/aayatai.com/llms.txt)
