> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meshrouter.app/llms.txt
> Use this file to discover all available pages before exploring further.

# LangChain

> Use MESH with OpenAI-compatible framework integrations.

Any framework that supports an OpenAI-compatible base URL can target MESH.

```ts theme={null}
import { ChatOpenAI } from '@langchain/openai';

const model = new ChatOpenAI({
  apiKey: process.env.MESH_API_KEY,
  configuration: { baseURL: 'https://api.meshrouter.app/v1' },
  model: 'auto',
});
```

Keep fallback chains, tool definitions, and structured-output schemas in the request body where the
framework allows custom OpenAI fields.
