# LangChain Integration with OfoxAI Configuration Guide Source: https://ofox.ai/docs/integrations/langchain [LangChain](https://python.langchain.com) is a development framework for building AI applications, supporting Python and JavaScript. Since OfoxAI is fully compatible with the OpenAI protocol, you only need to change the `openai_api_base` to get started. ## Prerequisites - An OfoxAI account with an API Key ([Get one here](https://app.ofox.ai)) - Python 3.8+ installed ## Configuration Steps ### Step 1: Install Dependencies ```bash pip3 install langchain langchain-openai ``` ![Install LangChain](https://ofox.ai/screenshots/langchain/01-install.png) ### Step 2: Configure and Run **Python** ```python filename="example.py" from langchain_openai import ChatOpenAI llm = ChatOpenAI( model="openai/gpt-6.1-sol", openai_api_key="", openai_api_base="https://api.ofox.ai/v1" ) response = llm.invoke("Hello") print(response.content) ``` Run: ```bash python3 -W ignore example.py ``` **JavaScript** ```javascript filename="example.js" import { ChatOpenAI } from "@langchain/openai" const llm = new ChatOpenAI({ model: "openai/gpt-6.1-sol", openAIApiKey: "", configuration: { baseURL: "https://api.ofox.ai/v1" } }) const response = await llm.invoke("Hello") console.log(response.content) ``` ![Run Result](https://ofox.ai/screenshots/langchain/02-run.png) ## Available Models For recommended models, see the [OfoxAI Model Marketplace](https://ofox.ai/models). ## FAQ **Q: `ModuleNotFoundError: No module named 'langchain_openai'`** Run `pip3 install langchain-openai` to install the missing package. **Q: API Key is invalid** Make sure the `openai_api_key` is your OfoxAI API Key, not an official OpenAI Key.