# Aayat AI Library Docs Q&A

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

Answers coding questions about npm, PyPI, crates, or Go packages using only their current official documentation, with code examples, version info, and cited sources.

## Facts

- Endpoint: POST https://aayatai.com/docs/answer?utm_source=zero.xyz
- Price: $0.02/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-q-a-6b6b489f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DjdOPCbLkDkRDJQEGcj_B

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-q-a-6b6b489f -d '<json body>'
```

Example prompt: How do I enable CORS for only the /api routes in Hono (npm)? Give me the answer straight from the current Hono docs with a code example.

## When to prefer this

Choose this endpoint when you need a documentation-grounded, cited answer about a specific open-source library — not a general LLM guess. It's ideal when accuracy and source traceability matter, when you need the version the answer applies to, or when building coding agents that must not hallucinate library APIs. Prefer it over general LLM completions when the question is about a specific package's current API surface.

## Known failure modes

- Library not found in the specified ecosystem — returns an error or 'docs not available' message
- Question too vague or too short (under 5 chars) — rejected by input validation
- Documentation does not cover the topic — answer field explicitly states this rather than hallucinating
- Rate limiting or upstream docs fetch failure — may return a service error
- Ecosystem mismatch (e.g. specifying npm for a PyPI-only package) — may return no results

## How this service works

Ask a coding question about any npm, PyPI, crates or Go library and get an answer written only from its current docs (project llms.txt, docs pages or latest README), with a code example where the docs show one, the version it applies to and cited sources. Says so when the docs don't cover it. POST {library, question}.

## Output

A JSON object containing the answer grounded in official docs, an optional code snippet, the library name, ecosystem, the version the answer applies to, a list of cited source URLs with their kind (docs-page, README, llms.txt), and the timestamp when the docs were fetched. If the docs don't cover the question, the answer field says so explicitly.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "library": {
   "type": "string",
   "maxLength": 214,
   "minLength": 1,
   "description": "Library/package name as published, e.g. hono, fastapi, serde, github.com/gin-gonic/gin."
  },
  "question": {
   "type": "string",
   "maxLength": 1000,
   "minLength": 5,
   "description": "Your question, e.g. How do I enable CORS for one route?"
  },
  "ecosystem": {
   "enum": [
    "npm",
    "pypi",
    "crates",
    "go"
   ],
   "type": "string",
   "default": "npm",
   "description": "Package ecosystem: npm, pypi, crates (Rust) or go (Go modules)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "answer": "Use the built-in cors middleware on a path pattern [1]:\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",
  "question": "How do I enable CORS for only the /api routes?",
  "ecosystem": "npm",
  "fetchedAt": "2026-09-28T12:00:00.000Z",
  "docsTokens": 1800
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aayat-ai-library-docs-q-a-6b6b489f/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)
