LYRENTH
DocsPricingBenchmarksIndex statsAboutBlogFor site ownersStatusContact
/docs / integrations
For agent developers

Integrations

Every way to plug Lyrenth in as your agent's web reader. One key works across all of them, and each reads through the same standing index and returns the same clean AIDocument.

SDKs

Python and TypeScript

Both clients are dependency-free and wrap the same three calls: read one URL, read up to twenty, or get just the Markdown.

pip install lyrenth
from lyrenth import Lyrenth

client = Lyrenth()                    # reads LYRENTH_API_KEY
doc = client.read("https://example.com/post")

print(doc.title)
print(doc.word_count, "words")
print(doc.markdown[:400])             # the cleaned body
# doc.raw is the full AIDocument envelope

# Up to 20 URLs in one call, each failure isolated.
for r in client.read_batch(["https://example.com/a", "https://example.com/b"]):
    print(r.url, r.ok, r.error)

# Or just the text.
markdown = client.read_markdown("https://example.com/post")

The document you get back is flat and ready to use: title, description, markdown, the word count, and the canonical URL. When you want the whole grouped envelope, it is on raw. Errors raise a typed LyrenthError carrying the HTTP status, so you can branch on it.

No package

One authenticated GET

The smallest possible integration: a URL in, Markdown out, from a shell or any HTTP client.

curl "https://api.lyrenth.com/v1/read?url=https://example.com/post" \
  -H "Authorization: Bearer $LYRENTH_API_KEY"

Add &fresh=1 to force a live re-fetch, or &max_tokens=4000 to cap the body to a context budget. The full parameter list is in the API reference.

For site owners

Edge templates

Two deployable templates that report AI agent visits to your dashboard from your own edge, so you see every AI reader of your site and not only the ones who come through Lyrenth.

Both do the same job. They watch the User-Agent on incoming requests, buffer anything that looks like an AI bot, and post aggregated counts to /v1/ingest/bot/<your-domain> after the response has already gone out, so your visitors never wait on it. Both are wrapped in try/catch at every step: if Lyrenth is unreachable, the failure is that no new data appears in your dashboard, never that your site is down. Neither one reads a request body, a response body, a cookie, or a visitor IP, and the query string is stripped from the path before anything is sent.

Both need your domain verified first, and the per-domain ingest token from /sites/<your-domain>/settings. Tokens start with aiwt_ and are not API keys: one can only post bot counts for its own domain.

Cloudflare Worker

A standalone worker bound to your zone's routes. It wraps the whole request, so it sees the response status too, and it works for any site behind Cloudflare whatever the site is built with.

deploy
  1. Copy your ingest token from the site settings page.
  2. Set LYRENTH_DOMAIN in wrangler.toml to your domain, with no www prefix.
  3. Replace the two routes entries with your own zone.
  4. Run wrangler secret put LYRENTH_INGEST_TOKEN and paste the token. Do not put it in the file.
  5. Run wrangler deploy.

Vercel Edge Middleware

One file inside your own Next.js project. Simplest path if you are already on Vercel. It runs before your route renders, so it records the bot and the path but not the response status.

deploy
  1. Copy your ingest token from the site settings page.
  2. Add middleware.ts at your project root, or merge its recording call into the middleware you already have.
  3. Add LYRENTH_DOMAIN and LYRENTH_INGEST_TOKEN to the project environment variables.
  4. Push. Vercel redeploys and the data starts arriving.

The worker page has the code for both, along with what is collected and what is not. Read the site-owner worker page.

Published

Where the packages live

Everything on this page is a published package, not a snippet to copy.

RegistryPackageWhat it is
npmlyrenthTypeScript SDK, with the Vercel AI SDK and eve tools
npmlyrenth-mcpMCP server, for the npx path
PyPIlyrenthPython SDK, with optional framework adapters
PyPIlangchain-lyrenthLangChain read tool and document loader
PyPIllama-index-readers-lyrenthLlamaIndex reader
MCP registrycom.lyrenth/lyrenth-mcpThe official Model Context Protocol registry

The MCP server is also listed on Claude directory, Cursor directory, Smithery, Glama, LobeHub and GitHub.

One key, every surface.

The free tier needs no card, and the same key works everywhere on this page.