TypeScript

GateCtr + LangChain.js

Route LangChain.js LLM calls through GateCtr

1

Install

No additional packages required. Use your existing LangChain.js installation.

2

Configure

Before
import { ChatOpenAI } from "@langchain/openai";

const llm = new ChatOpenAI({ model: "gpt-4o" });
After GateCtr
import { ChatOpenAI } from "@langchain/openai";

const llm = new ChatOpenAI({
  model: "gpt-4o",
  configuration: { baseURL: "https://api.gatectr.com/v1" },
});
3

Test

Make a test call and check the GateCtr dashboard for token savings and cost data.

What GateCtr does under the hood for LangChain.js

When you route LangChain.js calls through GateCtr, every request is automatically compressed (up to 40% fewer tokens), scored for complexity (to select the optimal model), and checked against your budget cap before reaching the LLM provider. You get full observability β€” tokens, cost, latency β€” in the GateCtr dashboard.

Start saving with LangChain.js β€” free

No credit card required. Up and running in 5 minutes.

Start free