Frameworks and Integrations

Community ecosystem overview

TheRouter.ai works with OpenAI-compatible clients, framework adapters, and observability tooling across web, backend, and agent runtimes.

Overview

This page mirrors the OpenRouter workflow and adapts it for TheRouter.ai. Use TheRouter.ai as your OpenAI-compatible endpoint and keep model IDs in `provider/model` format.

Installation

Install the required SDKs and keep your TheRouter.ai key in environment variables.

install.sh
npm install openai @openrouter/ai-sdk-provider langchain

Configuration

Set TheRouter.ai base URL overrides and pass your API key. Add attribution headers when your app should appear in rankings.

TypeScript
const endpoint = "https://api.therouter.ai/v1";
const models = ["openai/gpt-4o", "anthropic/claude-sonnet-4.5", "google/gemini-2.5-pro"];

Caveats

Integration note
Different frameworks expose provider options differently; validate fallback and tool-calling behavior before migrating production code.

For production rollouts, pin SDK versions and validate model compatibility in staging before broad rollout.