> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.merge.dev/merge-gateway/routing/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server. # Routing > Build once. Connect to every API, tool, and LLM. Ship products and agents to production without owning the integration stack. ## Docs - [Routing policies](https://docs.merge.dev/merge-gateway/routing/overview.md): The three routing strategies (Priority, Intelligent, Build Your Own Router), how to select a policy with a model alias, how Gateway picks a vendor, and tag-based routing. - [Using routing policies](https://docs.merge.dev/merge-gateway/routing/using-policies.md): How Gateway resolves the routing policy for a request, which errors fail over to the next model or vendor, how to send priority_order inline, and how default_routing works. - [Deterministic strategies](https://docs.merge.dev/merge-gateway/routing/deterministic-strategies.md): How the Priority strategy orders models, fails over, and handles a single-model list, in the dashboard, the API, and per request. - [Intelligent routing](https://docs.merge.dev/merge-gateway/routing/intelligent.md): How the Intelligent strategy scores prompt complexity, how the Cost, Performance, and Capability axes shift model choice, the Use case selector, and which models are eligible. - [Build Your Own Router](https://docs.merge.dev/merge-gateway/routing/build-your-own-router.md): Configure a weighted blend of published, eval-derived, or uploaded benchmarks, and Gateway routes each request to the highest-scoring model. Covers scoring, benchmark sources, score overrides, fallback, and permissions. - [Custom classifiers](https://docs.merge.dev/merge-gateway/routing/custom-classifiers.md): Create a complexity classifier from your own labeled prompts, import them as JSON or CSV, and use it as the complexity scorer in a Build Your Own Router config. - [Model aliases](https://docs.merge.dev/merge-gateway/routing/model-aliases.md): Send @alias/ as the model in any chat request to route through that routing policy. Covers how aliases are created, renamed, and managed from the dashboard or /v1/routing-policies, and the errors they return. - [Cache-aware routing](https://docs.merge.dev/merge-gateway/routing/cache-aware-routing.md): Gateway remembers which vendor served a session and prefers that route while its prompt cache is warm and cheaper, so cached prefixes get read instead of rewritten on another vendor.