Use LangChain with the LLM gateway
LangChain's ChatOpenAI happily talks to
any OpenAI-compatible endpoint. Point it at the gateway and every chain, agent, and
tool call gets routed to the right model, for free.
1 models routed through the gateway over the last 30 days.
Why use LangChain with the gateway
LangChain apps fan out into many model calls: query reformulation, retrieval, re-ranking, generation. Each one is a chance to pick a cheaper model. The gateway does that picking for you, request by request.
- Three-line drop-in with ChatOpenAI
- Cut LLM costs on multi-step chains by 50 to 70%
- Works with chat, embeddings, and tool-calling agents
- Switch routing rules without redeploying your LangChain app
- Per-chain spend caps and per-model latency tracking
- Self-hostable router, keep all traffic in your VPC
Setup in 60 seconds
Initialize ChatOpenAI with the gateway
base URL and API key. The rest of your LangChain code stays the same.
Install the LangChain OpenAI adapter and wire it up:
# pip install langchain-openai
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="https://api.manifest.build/v1",
api_key="mnfst_YOUR_KEY",
model="auto",
)
response = llm.invoke("Hello")
print(response.content)
https://api.manifest.build/v1
mnfst_YOUR_KEY
auto
LangChain tokens processed by the gateway
Models in use
# Model |
Auth type | Tokens / last 30 days |
|---|---|---|
1.Kilo Auto Free | API Key | 5 M |