Meridian with LangChain

Configure ChatOpenAI with a custom openai_api_base to route through Meridian's proxy. Drop-in compatible with any OpenAI SDK consumer.

Configuration

langchain.config.ts
import { ChatOpenAI } from "@langchain/openai";

const model = new ChatOpenAI({
  modelName: "gpt-4o",
  openAIApiKey: "YOUR_API_KEY",
  configuration: {
    baseURL: "https://api.openai.com/v1",
  },
});

const response = await model.invoke("Hello from Meridian");

The baseURL override is passed via the configuration object, which LangChain forwards directly to the underlying OpenAI client. Meridian intercepts the request, applies your routing rules, and proxies to the upstream provider.