All stories

OpenRouter

How OpenRouter deleted 10,000 lines of code by moving their documentation to Mintlify


OpenRouter retired the brittle homegrown pipeline behind its AI model marketplace in favor of a knowledge platform that syncs docs across repos, ships SDK references straight from source, and serves developers and agents alike.

Success story snapshot

Challenge: OpenRouter's documentation ran on a third-party platform that required ~10,000 lines of hand-maintained transformation code to translate its SDK output into the docs' format. This brittle, ten-step update pipeline carried a number of hidden costs.

Solution: Rather than keep patching the pipeline, OpenRouter moved to Mintlify. They manage their multirepo deployments with a docs-as-code workflow that pulls SDK docs straight from their source repos, with two-way sync, automations, and AI-native features built in.

Key Results:

  • 6 weeks from contract to go-live
  • ~10,000 lines of custom docs transformation code retired
  • 10-step, brittle publishing pipeline replaced with automated multirepo deploys
  • 3 SDK references rendered directly from their source repos

Knowledge as the AI model marketplace storefront

OpenRouter sits at the heart of the inference economy. They offer a single API that routes to hundreds of models across every major lab, with an SDK ecosystem growing so fast its TypeScript package crossed 300,000 weekly downloads.

But its docs hadn't kept up. For a product whose entire value is developer-facing, documentation is the main way users learn about and build with OpenRouter.

"Our docs for OpenRouter currently are not great at all," Matt Apperson, who leads SDKs and CLI at OpenRouter, told Mintlify at the start of the relationship. "We're looking to overhaul our docs and change how we think about writing and maintaining docs. Making them a first-party thing. Not just something we need to do as part of a checklist."

Deals hinging on stalled docs

Before Mintlify, publishing a docs change at OpenRouter required navigating a convoluted pipeline. Make code changes, generate schemas, generate SDKs, generate docs, convert formats, and finally deploy. OpenRouter maintained hand-built scripts to translate Speakeasy's SDK output into the doc platform's format.

"It's something around 10,000 lines of code just to get the automated docs from Speakeasy into our docs," said Apperson. "We're basically stacking custom code on custom code for stuff that feels like it should be pretty basic."

When the pipeline broke, which happened often, the cost was steep. One failure took three engineers a full week to restore the ability to deploy. Restructuring the site meant maintaining redirects by hand. And the API playground couldn't even render OpenRouter's own SDK, telling developers to "just use fetch" instead.

The most expensive gap wasn't developer-facing at all. The machine-readable layer that enterprise buyers increasingly demanded was hand-rolled, and it was starting to cost deals. "The llms.txt generation is honestly priority number one for us, because we have deals hinging on it. Right now, we have thousands of lines of scripts to patch it together," said Apperson.

Underneath it all, the platform itself had stopped moving. After their previous vendor was acquired, bug fixes were quoted at eight months out. "We're spending so much time keeping everything else working that we're not actually fixing the docs."

Requirements that would break most platforms

OpenRouter's requirements would have broken most documentation platforms. SDK references must generate from separate repos. A private monorepo and a public docs repo both needed to accept changes. Publishing required release gates, so early model access doesn't leak before launch. And agent-ready output must be a first-class deliverable.

Mintlify built multirepo deployments so SDK docs render directly from each SDK's source repo, and shipped custom webhook-triggered automations for OpenRouter's release flow. It also designed a bidirectional sync between private and public docs, and worked with Speakeasy so generated SDKs now output Mintlify-ready MDX.

Live—and built for what's next

OpenRouter migrated from its old docs solution to Mintlify's intelligent knowledge platform in just six weeks. Today, TypeScript, Python, and Go SDK references flow in from their own repos and stay in sync automatically. The 10,000 lines of transformation scripts are gone. And the ten-step pipeline? A single webhook.

The AI-native layer OpenRouter once hand-built comes with the platform. Markdown endpoints and llms.txt are generated automatically. Skills for steering coding agents and an MCP server are included. For the company routing the world's AI traffic, docs are finally something they can build on.

"We need to use our docs as a leverage point," says Apperson. "This is the source of truth."

The bottom line

OpenRouter traded a docs pipeline that consumed engineering time for knowledge infrastructure that ships itself. Just weeks after the Mintlify migration was complete, Apperson started joining calls with teams still using his previous docs platform to encourage them to make the same move.

"Most companies that care about their docs are using Mintlify," says Apperson, "and I think it shows."