# Serve SDK · Onto
> Give AI agents your Next.js pages as clean Markdown, at the same URL. People and Google get your page as before, and the dashboard shows which agents came.

**Source:** /serve-sdk
**Extracted:** 2026-09-25T19:45:29.379Z

---
Product · Serve SDK · Next.js 14+

## Serve agents Markdown. Zero changes to your pages.

At build, `@ontosdk/next` writes a clean Markdown copy of every prerendered page. When a known AI agent asks for a URL, it gets that Markdown; everyone else gets your page — same URL, served from your own site.

[Get started →](https://app.buildonto.dev/signup)[Scan your site](#try)

$`npm install @ontosdk/next`[Read the docs ↗](https://docs.buildonto.dev/sdk/installation)

0

changes to your pages

699 → 17 KB

stripe.com/pricing, same cleaner

$0

the SDK, on npm

Try it

### Does your site serve agents yet?

The free scan checks whether your pages already have a Markdown version — and shows what an agent is handed today.

ReadBatchScorefreeRead & scoreMapExtract

https://free scan

Show:MarkdownJSON

Get codeScanfree

Trystripe.com/pricingvercel.com/pricinglinear.app/pricing

How it works

### Once at build. Every time an agent asks.

The build writes the Markdown; the middleware decides who gets it. Watch each half, or click a step.

Serve SDK · buildYour buildServe SDKAn agent visits your site

your build · @ontosdk/next

Your CI runs next build && onto-next

1.  01Find the pages
    
    Every prerendered page under `.next/server/app`. Routes rendered per request get no `.md`.
    
2.  02Clean each one
    
    The same `@ontosdk/core` cleaner the Read API uses — once per build, not once per request.
    
3.  03Write the files
    
    One `.md` per route in `public/.onto/`, and `llms.txt` from your `onto.config.ts`.
    
4.  04Send the list to your dashboard
    
    Posted with your site key — only when `ONTO_API_KEY` is set. That's what fills Serve → Routes.
    

public/.onto/\*.md, public/llms.txt, and your dashboard's route list

your edge · @ontosdk/next

GPTBot asks yoursite.com for /pricing

1.  01Who's asking
    
    A known AI crawler's User-Agent, an `Accept: text/markdown` header, or `?onto` on the URL.
    
    *   `a person`→straight through to your page — nothing changes
    *   `an agent`→carry on
    
2.  02Note the visit
    
    Sent to your dashboard without waiting, so it never slows the answer.
    
3.  03Hand over the Markdown
    
    Built from your pages at deploy time and served from your own site — nothing is extracted per request.
    
4.  04Add your context
    
    Notes you've written for the route, on Serve Pro and above.
    

Markdown for the agent, your page for everyone else

Install

### From install to served Markdown.

Five steps, none of them inside a page component.

01/Install and scaffoldThe package, then init: it writes your config, your middleware and a .env.local — and skips any file you already have.02/The middlewareWhat init writes. If you already had a middleware.ts, wrap your export in ontoMiddleware yourself — nothing inside your pages changes.03/Add the build stepOne edit to package.json, yours to make: run onto-next after next build. Set ONTO\_API\_KEY too if you want the dashboard.04/Build writes the Markdownonto-next reads the pages Next.js just prerendered, cleans each with @ontosdk/core, and writes one .md per route plus llms.txt. Pages rendered per request get none.05/Agents get the MarkdownA known AI agent, Accept: text/markdown, or ?onto on the URL gets the .md from your own site. Everyone else — Googlebot included — gets your page.

~/acme

$ npm install @ontosdk/next
$ npx onto-next init
✓ Created onto.config.ts
✓ Created middleware.ts
✓ Created .env.local

_Package_@ontosdk/next_Next.js_14+, App Router

The 14 agents the Serve SDK answers with Markdown

#### Answering someone now4

A person just asked about your page, and the agent is fetching it to reply.

*   ![](/_next/image?url=%2Fanthropic.png&w=48&q=75)Claude-User
*   ![](/openai.svg)ChatGPT-User
*   ![](/_next/image?url=%2Fperplexity.png&w=48&q=75)Perplexity-User
*   ![](/_next/image?url=%2Fduckduckgo.png&w=48&q=75)DuckAssistBot

#### Building AI search4

Indexing your pages so an AI search engine can cite them later.

*   ![](/_next/image?url=%2Fperplexity.png&w=48&q=75)PerplexityBot
*   ![](/openai.svg)OAI-SearchBot
*   ![](/_next/image?url=%2Famazon.png&w=48&q=75)Amazonbot
*   ![](/_next/image?url=%2Fyou.png&w=48&q=75)YouBot

#### Collecting training data6

Reading your pages into the data the next model learns from.

*   ![](/openai.svg)GPTBot
*   ![](/_next/image?url=%2Fanthropic.png&w=48&q=75)ClaudeBot
*   ![](/_next/image?url=%2Fgoogle.png&w=48&q=75)Google-Extended
*   ![](/_next/image?url=%2Fmeta.png&w=48&q=75)Meta-ExternalAgent
*   ![](/_next/image?url=%2Fbytedance.png&w=48&q=75)Bytespider
*   ![](/_next/image?url=%2Fcommoncrawl.png&w=48&q=75)CCBot

The list ships in `@ontosdk/next` and updates with it on npm. Googlebot isn't on it, so your search results don't change.

Control plane

### See which agents read which pages.

Once ONTO\_API\_KEY is set, every visit the SDK answers is noted: which agent, which route, and the Markdown served against the HTML it replaced. On Serve Pro, agents Onto can't name get their own list, and everything exports to CSV.

acme.com _example_

**16**agent visits

**13**named

**3**unknown

**5.8 MB**not sent

Live feed

All_16_Named_13_Unknown_3_

1.  Perplexity-User/docs/apiJP21.3 KB ~of 498 KB~now
2.  ClaudeBot/pricingCA8.2 KB ~of 412 KB~40s
3.  Amazonbot/changelogUS5.4 KB ~of 287 KB~1m
4.  GPTBot/docs/quickstartUS11.6 KB ~of 356 KB~2m
5.  Unknown/blog/launchBR6.9 KB ~of 301 KB~2m

Pricing

### Serving is free. Paid plans go deeper.

The SDK needs no key and no plan. The free dashboard keeps 30 days of history; paid plans add a year or more, context per route, unknown agents, CSV export and more sites.

30 days of history

$0forever

1 site

[Install the SDK](https://app.buildonto.dev/signup)

Includes

*   SDK is free forever on npm
*   Bot detection + clean Markdown serve
*   Basic analytics dashboard

A year of history

$19/ month

1 site

[Upgrade to Pro](https://app.buildonto.dev/serve/billing)

Includes

*   Unknown agents, payload saved, CSV export
*   Per-route context injection
*   Email support

All of your history

$99/ month

Up to 10 sites

[Upgrade to Business](https://app.buildonto.dev/serve/billing)

Includes

*   Everything in Pro, across 10 sites
*   Every new Serve feature first
*   Shared Slack support

[

Enterpriseannual

#### Everything above, without the ceilings.

No monthly cap · 100 concurrent · unlimited sites

Read without a monthly credit cap · Serve on as many sites as you run · Security and legal questions answered in writing

Contact sales](mailto:founder@buildonto.dev)

Questions

### Before you wire it into middleware.

01Will this affect my Google rankings?

No. Googlebot isn't on the SDK's list, so it gets your HTML exactly as before. Google-Extended and GoogleOther — Google's AI crawlers — do get the Markdown.

02Do I need to change my pages?

No. `onto-next` reads the HTML Next.js already prerendered and writes a Markdown copy of each page to `public/.onto/`. Your components, layouts and styles stay as they are. The one optional exception: to add JSON-LD from your config, you put `<OntoProvider>` in your root layout.

03Which frameworks does it support?

Next.js 14 and up, on the App Router — the build step reads the App Router's output, so the Pages Router isn't supported. Vue, Angular and WordPress are on the [roadmap](/roadmap).

04How does it know who's an agent?

Any one of three: the User-Agent matches an AI agent on the SDK's list (GPTBot, ClaudeBot, PerplexityBot, Meta-ExternalAgent, Bytespider and more), the request sends `Accept: text/markdown`, or the URL has `?onto`. The list ships in the SDK and updates with it on npm.

05What about pages rendered per request?

They don't get a Markdown copy — onto-next only sees what Next.js prerendered at build. An agent asking for one of them gets your normal page.

06What goes in onto.config.ts?

A description of your site: its name, summary and base URL, your key routes with a line on each, external links and any extra sections. `onto-next` turns it into `/llms.txt`, and `<OntoProvider>` can add JSON-LD from it.

07Does it slow my site down?

Not for people: for them the middleware only reads the User-Agent and headers, with no network calls. For an agent it fetches the prebuilt Markdown from your own site — and on Serve Pro, the context you've written for that route from Onto — before answering.

08Is the SDK really free?

Yes. `@ontosdk/next` is free on npm and installs and builds without a key. Add `ONTO_API_KEY` and the free plan gives you a dashboard with 30 days of history. Paid plans add a year or more, context per route, unknown agents and CSV export, and more sites.

Get started

### Stop letting AI guess about your product.

Agents get clean Markdown. Your pages stay exactly as they are.

[Get started →](https://app.buildonto.dev/signup)[Scan your site](#try)

The SDK is free · paid plans from $19 / month

---
## Structured Data (JSON-LD)
```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://buildonto.dev/#org",
      "name": "Onto",
      "url": "https://buildonto.dev",
      "logo": "https://buildonto.dev/icon.png",
      "sameAs": [
        "https://x.com/buildonto",
        "https://github.com/ravixalgorithm/ontosdk"
      ]
    },
    {
      "@type": "WebSite",
      "@id": "https://buildonto.dev/#site",
      "url": "https://buildonto.dev",
      "name": "Onto",
      "publisher": {
        "@id": "https://buildonto.dev/#org"
      }
    },
    {
      "@type": "SoftwareApplication",
      "name": "Onto",
      "applicationCategory": "DeveloperApplication",
      "operatingSystem": "Web",
      "url": "https://buildonto.dev",
      "description": "Onto serves AI agents clean Markdown from your own site, at the same URL, and shows you which agents came. Plus the AIO score, a Read API and an MCP server.",
      "publisher": {
        "@id": "https://buildonto.dev/#org"
      },
      "offers": {
        "@type": "Offer",
        "price": "0",
        "priceCurrency": "USD",
        "description": "Free tier: 1,000 credits / month"
      }
    }
  ]
}
```
