Aayat AI
Docs

Build with Aayat AI

Everything you need to call Aayat AI from code or from an AI assistant. Every example on this page is real and can be pasted as-is.

Start in 60 seconds

1. In an AI app (quickest). Add https://aayatai.com/mcp as an MCP server in Claude, Cursor, VS Code or Windsurf and get 20 free calls a day. Step-by-step with one-click install.

2. From code: see the price. Call any endpoint without paying. You get 402 Payment Required and a PAYMENT-REQUIRED header listing the price and where to pay. Nothing is charged.

curl -i "https://aayatai.com/docs/lib?library=hono&ecosystem=npm&topic=cors+middleware&tokens=3000"

3. Pay per call. Use any x402 client with a wallet holding a little USDC (next section). Or top up prepaid credits and send an API key.

HTTP with x402

aayatai.com
curl "https://aayatai.com/docs/lib?library=hono&topic=cors+middleware&tokens=3000"
HTTP/2 402 Payment Required
price: $0.005 USDC · Base, Solana, Polygon, Arbitrum
x402 → signed & paid 0.005 USDC on Base ✓
HTTP/2 200 OK
{
  "library": "hono",
  "ecosystem": "npm",
  "version": "4.13.9",
  "topic": "cors middleware",
  "content": "<!-- source: https://hono.dev/docs/middleware/builtin…",
  "tokens": 42,
  "truncated": false,
  … 3 more
}

import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";

// account: a viem wallet holding a little USDC on Base
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453",
               client: new ExactEvmScheme(account) }],
});

// A 402 is paid in USDC and the request retried for you.
const res = await pay("https://aayatai.com/docs/lib?library=hono&topic=cors+middleware&tokens=3000");
console.log(await res.json());

x402 is an open standard for paying per request over HTTP. The client below sees the 402, signs a USDC payment from your wallet and repeats the call automatically. Accepted: USDC on Base, Solana, Polygon, Arbitrum, same price on every network.

npm install @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet used only by your agent, holding a little USDC on Base.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const pay = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await pay("https://aayatai.com/docs/lib?library=hono&ecosystem=npm&topic=cors+middleware&tokens=3000");
console.log(await res.json());
Use a wallet made just for your agent and keep only a few dollars in it. Every service's own page (for example /services/docs-lib) has its exact inputs, outputs and examples.

API key (prepaid credits)

Prefer an API key, or your client can't pay per call? Top up once with USDC on Base (from $1) and send the key with each call. Each call deducts its normal price; failed calls are refunded to your balance. How to top up, check your balance and get a refund.

curl -H "Authorization: Bearer $AAYAT_KEY" "https://aayatai.com/docs/lib?library=hono&ecosystem=npm&topic=cors+middleware&tokens=3000"
import os, requests

r = requests.get(
    "https://aayatai.com/docs/lib?library=hono&ecosystem=npm&topic=cors+middleware&tokens=3000",
    headers={"Authorization": f"Bearer {os.environ['AAYAT_KEY']}"},
)
print(r.json())

MCP: Claude and Cursor

All tools are available over MCP (Streamable HTTP) at https://aayatai.com/mcp. No sign-up.

Using Claude, Cursor, VS Code or Windsurf? Add Aayat AI in 1 minute: one-click install, step-by-step pictures and example prompts.

Claude Code

claude mcp add --transport http aayat-ai https://aayatai.com/mcp

Cursor

Settings → MCP → Add new MCP server, or add this to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "aayat-ai": {
      "url": "https://aayatai.com/mcp"
    }
  }
}

Claude (claude.ai and apps)

Settings → Connectors → Add custom connector → URL https://aayatai.com/mcp. With credits, use https://aayatai.com/mcp?key=YOUR_KEY. More clients (Claude Desktop, Windsurf, VS Code, others): MCP set-up guide.

Free trial

Over MCP you get 20 free calls a day on 79 of our 101 tools (the ones marked "free trial" on the pricing page). It resets at midnight UTC. After that, or for the costlier tools, the tool's answer explains how to pay. No account and no personal data: we don't store your IP address.

Billing rules

  • Failed calls are never charged. If the data source is down, times out or finds nothing, you pay nothing.
  • Bad inputs are rejected before you pay, with a message saying what's wrong.
  • Same price on every network, and the price is in the 402 answer before you pay.
  • Some answers are cached for minutes to hours (shown on each service's page); a cached answer costs the same and is instant.

For AI agents

Client packages

Official Aayat AI packages for JavaScript/TypeScript and Python, with ready-made tools for LangChain, the Vercel AI SDK, CrewAI, OpenAI function calling and ElizaOS, are ready and will be published to npm and PyPI shortly (package name aayat-ai). Until then, any x402 client or the API key examples above work. Using Claude or Cursor? You don't need a package: add the MCP server.