# Onto — AI is reading your website wrong.
> Onto serves clean Markdown to AI agents instead of HTML noise. Same content, right format. One line of code. No changes to your site.

**Source:** /serve-sdk
**Extracted:** 2026-05-20T20:59:17.286Z

---
AlphaProduct · Serve SDK

## Serve agents the version  
_they can actually read._

One line in middleware. AI crawlers get clean Markdown. Humans get the full experience, untouched. Our own AIO score went 50 → 80. Gemini stopped hallucinating our product. Claude reads us in Markdown and explicitly confirms the MIME type.

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

1 line

Install footprint

0

Changes to your pages

<15 ms

Edge middleware overhead

01 // Install

### One line in middleware. Zero changes to pages.

`npm install @ontosdk/next`, wrap one middleware export, ship. The SDK reads your existing routes at build time — no code changes inside your pages.

middleware.ts

\# Install
npm install @ontosdk/next
// middleware.ts
import { withOnto } from "@ontosdk/next";
export default withOnto({
  apiKey: process.env.ONTO\_API\_KEY,
  routes: \["/products/:path\*", "/docs/:path\*"\],
});
// That's the whole integration.

01**npm install** `@ontosdk/next`. Wrap one middleware export. Ship.

02**Build-time extraction** turns your routes into clean Markdown payloads alongside the HTML output.

03**Accept-header routing** at the edge sends agents to `.onto` payloads and humans to your existing HTML.

02 // Capabilities

### Build-time extraction. Runtime routing.

The SDK does the work where it's cheapest — at build time. The edge middleware does the work where it matters — routing the right version to the right caller in under 15 ms.

Build01

Build-time route extraction

Every public route compiles into a clean Markdown payload at build time. No runtime overhead, no surprise costs at peak traffic.

Routing02

Accept-header + UA bot routing

Detects GPTBot, ClaudeBot, PerplexityBot, Gemini, and 20+ others. Sends them clean Markdown; humans get your full HTML unchanged.

Context03

Per-route context injection

Inject pricing, FAQ blocks, or schema fragments per route — agents see the canonical version, humans see what you ship.

Structure04

JSON-LD + schema preserved

We don't strip semantic markup — Schema.org, OpenGraph, and JSON-LD blocks survive the extraction step intact.

Humans05

Zero overhead for browsers

Real users never touch the Onto path. Your existing HTML, CSS, and JS pipeline serves them exactly as before.

Analytics06

Bot dashboard included

See which bots hit which routes, when, and what they read. The visibility most sites have never had over their AI traffic.

03 // Lifecycle

### From install to served Markdown.

Step 01

Install the package

npm install @ontosdk/next. Works in any Next.js 14+ App Router project.

@ontosdk/next

Step 02

Wrap middleware

One import, one wrapped export. No code changes inside your pages — extraction reads the same source tree your build already uses.

middleware.ts

Step 03

Build extracts routes

At build time we walk your routes and emit a .onto payload alongside each HTML output. Cheerio-based, schema-aware.

.onto payloads

Step 04

Edge serves the right version

Accept header says Markdown? Send the .onto payload. Browser? Send the HTML. All under 15 ms at the edge.

Vercel edge runtime

04 // Compared

### Serve SDK vs leaving bots to scrape.

Today, AI crawlers fetch the same bloated HTML your humans load, then guess at what your product does. The SDK gives them the canonical answer instead of the bloat.

With Serve SDK

Doing nothing

What bots see

✓Clean Markdown · 10× smaller

Bloated HTML · same as humans

Hallucination risk

✓Low — explicit schema

High — agents fill gaps

Human experience

✓Unchanged

Unchanged

Setup time

✓Under 5 minutes

n/a

Page-code changes

✓Zero

n/a

Bot analytics

✓Dashboard included

—

Edge overhead

✓<15 ms

—

05 // Pricing

### The SDK is free. The dashboard is the upgrade.

Install `@ontosdk/next` and ship without ever signing up. Pay only when you want the analytics dashboard, per-route context, or multi-site management.

Free

$0forever

1 site

30-day analytics · SDK free on npm

ProMost picked

$19/ month

1 site

1-year analytics · per-route context

Business

$99/ month

Up to 10 sites

Unlimited analytics · shared Slack

Enterprise

Custom

Unlimited sites

Procurement · custom SLA · sub-processors

Multi-site teams: Business covers up to 10 sites; Enterprise is custom procurement with sub-processor list on request.

[Full pricing breakdown](/pricing)

06 // Common questions

### Before you wire it into middleware.

01Will installing this affect my Google SEO?

No. Googlebot continues to receive your HTML unchanged — we only route the AI-specific user agents (GPTBot, ClaudeBot, etc.) to Markdown. Google's own crawler still sees the same site it always has.

02Do I need to change my pages?

No. The SDK reads your existing routes at build time and emits a .onto payload alongside the HTML output. Your page components, layouts, and styles stay exactly as they are.

03Which frameworks does the SDK support?

Next.js 14+ App Router is the primary target — that's where `@ontosdk/next` ships. Remix, SvelteKit, and Astro are on the roadmap; if you'd use them, let us know which.

04How do you detect AI bots?

A combination of Accept-header content negotiation (when the client requests text/markdown) and a curated User-Agent allowlist covering GPTBot, ClaudeBot, PerplexityBot, Gemini, Cohere, Meta-ExternalAgent, Bytespider, and others. The list ships in the SDK and updates on npm.

05Can I customize what gets extracted?

Yes — `onto.config.ts` lets you set per-route extractors, inject schema fragments, or skip routes entirely. The defaults work for most marketing and docs sites without configuration.

06Is the SDK actually free?

Yes. @ontosdk/next is free forever on npm — no key required to install or build. Paid tiers add the analytics dashboard, per-route context injection, and multi-site management.

Ready to install

### Stop letting AI hallucinate your product.

One line in middleware. Zero changes to your pages. Free forever on npm. Sign up only when you want the dashboard.

[Install the SDK](https://app.buildonto.dev/signup)// Next.js 14+ · @ontosdk/next