LangChain's ChatOpenAI class accepts a custom base URL. With AIgateway in front, every chain, agent, retriever, and tool that LangChain supports works against any of our 1000+ models.
Drop in ChatOpenAI with the AIgateway base URL.
Same shape on the JS side via @langchain/openai.