I posted about cutting Claude Code bills 67% by routing across 13 providers instead of paying Anthropic for every request. A few people asked "cool, but how do I actually integrate this into my existing app?"
Three new packages shipped today.
@leanroute/vercel-ai-sdk
If you are on Next.js and use the Vercel AI SDK, this is a drop-in provider:
import { leanroute } from "@leanroute/vercel-ai-sdk";
import { generateText } from "ai";
const { text } = await generateText({
model: leanroute("deepseek/deepseek-v4-flash"),
prompt: "Hi",
});
Same interface as @ai-sdk/openai, but the string can be any of 24 headline SKUs across OpenAI, Anthropic, Google, DeepSeek, Groq, xAI, and more. Streaming, tool calling, structured output, and Next.js server components all work out of the box because it wraps createOpenAI from the AI SDK.
@leanroute/langchain
LangChain users get the same treatment:
import { ChatLeanroute } from "@leanroute/langchain";
const llm = new ChatLeanroute({ model: "anthropic/claude-sonnet-5" });
const res = await llm.invoke("Hi");
Returns a ChatOpenAI instance, so it plugs into every runnable, agent, and chain that accepts a BaseChatModel.
create-leanroute-app
New project? Skip the setup:
npx create-leanroute-app my-app
Two templates. next gives you a streaming chat UI with a model picker, cost display, and Vercel deploy config. node gives you the OpenAI SDK pre-configured with three example scripts. Both take about 60 seconds from npx to running app.
Getting started
Grab a runtime key at leanroute.dev/dashboard/keys, export it, install the package that matches your stack. Full walkthrough in the original post.
All three packages: Apache-2.0, source in github.com/leanroute/ai-gateway.
Top comments (0)