This directory contains the Mintlify-hosted documentation for openrouter.ai/docs.
- Validate Docs — Runs
mint validateon all PRs touchingprojects/docs/**, then type-checks everyts/tsxcode fence that imports@openrouter/sdkor@openrouter/agentagainst the versions pinned inscripts/package.json(bun scripts/ci/check-docs-snippets.ts) and annotates failing lines. A later fence on the same page that uses a name an earlier checked fence declares (a continuation such asconst result = await openrouter.callModel(...)) is checked with the earlier fences in scope; fences that stand alone (fetchor other-SDK alternatives, type listings, signature notation) are not checked. A fence that imports a checked package is a whole file, so one that does not parse (for example JSX in atsfence, which needstsx) fails on its parse diagnostics. The same check runs as theDocs SDK snippet type-checktask ofbun run lint, so the requiredlintjob blocks the merge queue on it. Known failures are listed by content hash inscripts/ci/check-docs-snippets-baseline.json; a listed example is exempt as a whole until it is edited, which re-checks it, and--update-baselineregenerates the list - Docs Preview — Posts a preview URL as a PR comment for internal PRs (fork PRs cannot access secrets)
A guide or cookbook written for a specific model or model family should also be linked from that model's page on openrouter.ai, which lists it in the page's Documentation section and structured data. Declare the family in the page's frontmatter:
---
title: Gate Agent Tool Calls with Jev
models:
- typesafe/jev
---Each entry is author/name-prefix, lowercase. A model page links the doc when its author matches and its model name equals the prefix or starts with <prefix>-, so typesafe/jev covers typesafe/jev-1.13, ~typesafe/jev-latest, and typesafe/jev-1.13:free. List several families when a page covers several (openai/gpt-6-astra and openai/gpt-astra on the Astra migration guide). Pages under cookbook/ show as Cookbook, everything else as Guide, and the sidebarTitle (or title) is the link text. A page marked noindex: true cannot declare models.
After editing frontmatter run bun run generate:docs:model-map and commit the regenerated model-documentation-map.gen.ts in projects/web. The Validate Docs workflow fails when that file is stale. Labs live in projects/web rather than here and are listed by hand in model-documentation-resources.ts next to the generated file.
To preview docs locally, install the Mintlify CLI and run:
cd projects/docs
mint devOr use Tilt: tilt trigger docs with a running tilt up (or start it enabled with tilt up -- docs). The docs are served at http://localhost:3003 (override with DOCS_PORT).