Case study

OpenRouter serves 1M+ developers with agent-optimized Fern Docs

Annual support costs offset by AI search

$1.3M

AI search resolution rate with Ask Fern

88%

Agents consuming OpenRouter's docs monthly

25K+

The problem

A static Next.js site that couldn't keep pace with a fast-moving API platform

OpenRouter's previous documentation lived inside their main Next.js application on Vercel: pre-built static pages with no CMS, no content management tooling, and no separation between docs and product code.

For a 20-person engineering team supporting over a million developers, this was an expensive distraction. Engineers were spending time on docs infrastructure instead of building core platform features like model routing and compliance tooling. And as OpenRouter's API surface expanded, adding utilities like web search, PDF parsing, HIPAA-compliant routing, and user budget controls, their docs application couldn't scale to match.

The team started rebuilding their docs infrastructure in-house, including sidebar navigation, markdown rendering, and search. They quickly realized it would take far more engineering time than they could justify. They also explored integrating Algolia directly for AI-powered search, but that too would have required significant build effort for diminishing returns.

Fern offered the features OpenRouter needed out of the box: AI search, automatic llms.txt generation, and content negotiation for agents. OpenRouter migrated to Fern Docs in February 2025 and has since become Fern's top consumer of AI search volume.

People don't read docs the same way anymore, just like we don't write code the same way. We needed to optimize for agents, and Fern's llms.txt and markdown serving let us do that. All our documentation is written agentically with minimal human intervention and lots of automation.

Shashank Goyal · Founding Engineer at OpenRouter

The solution

A docs platform built for engineering velocity and optimized for AI agents

OpenRouter's migration to Fern required more than swapping out a docs platform. The team worked closely with Fern to ensure compatibility with their existing docs and integrate tightly with their codebase. The result is a documentation platform that runs largely on automation, from how content is written to how it's served.

Key capabilities OpenRouter unlocked with Fern:

  • A docs-as-code workflow that agents can plug into. OpenRouter documentation is primarily written agentically. OpenRouter used Claude and Devin to build out automated writing flows, including weekly automated checks that scan OpenRouter's changelog, identify docs gaps, and generate PRs with proposed updates. OpenRouter's custom-built system integrates with Fern's docs-as-code workflow to open PRs, review via preview links, and build and deploy automatically.
  • Custom component support. OpenRouter imports custom React components and constants directly from their codebase into their documentation so that when a parameter or variable changes in the app, the docs reflect it automatically. Some reference pages are generated entirely from code using custom MDX components that pull from their codebase's shared packages and render content dynamically within Fern. The team worked closely with Fern to make it possible.
  • Content optimized for both humans and agents. Fern's automatic llms.txt generation and Markdown serving gave OpenRouter agent-friendly documentation out of the box, and their agent-facing docs now see nearly 18,000 agent visits across their top pages per month. But OpenRouter needed more granular control over what agents and humans see. Their feedback drove two new Fern features: <llms-only> and <llms-ignore> tags, which let them serve verbose implementation details to agents while showing images, diagrams, and cleaner layouts to humans, and language filtering on llms.txt (e.g., ?lang=python), which cuts token consumption by serving only the SDK examples an agent actually needs.
  • AI search that handles 20,000 queries per month. Fern's built-in AI search resolves 88% of developer queries without a support ticket, and roughly half of all support requests are resolved through search alone. A Slack integration surfaces user feedback on docs pages, helping the team continuously improve content quality and resolution rates.

Looking ahead

Documentation as infrastructure for the agent economy

The collaboration between OpenRouter and Fern continues to shape both products. The llms-only/llms-ignore tags and language-filtered llms.txt that originated from OpenRouter's use case have since shipped to every Fern customer. Fern is now building automatic redirect checking for deleted pages, another feature request from OpenRouter.

As OpenRouter's platform scales to support more models, utilities, and enterprise capabilities, their documentation is evolving with it. "Fern gives us the power and ease to consistently create great docs," says OpenRouter's COO Chris Clark, "and the feedback and reporting tools to point us to where we need to improve."