Skip to main content
Eden AI’s /v3 endpoint is OpenAI-compatible, so LangChain’s ChatOpenAI talks to it once you change base_url and the model id. Every chat model in the catalog is then available through the same LangChain chat model interface, in Python and in TypeScript.

Overview

LangChain is a framework for developing applications powered by language models. LangChain’s ChatOpenAI class (langchain-openai for Python, @langchain/openai for TypeScript) sends OpenAI-style chat completion requests to any base URL you give it, and Eden AI’s /v3/chat/completions accepts them.

Installation

Python needs 3.10 or later, and the TypeScript package needs Node.js 22 or later.

Quick Start

The TypeScript sample uses top-level await, so run it as an ES module: save it as a .mts file, or set "type": "module" in package.json.

Model naming

Pass any provider/model id as model, for example openai/gpt-latest, anthropic/claude-sonnet-latest or vertex/gemini-flash-latest. Browse the catalog in List LLM Models.

Environment Variables

Next Steps