Official Typescript SDK for airouter.io - Automatically route requests to the best Large Language Model (LLM).
npm install @airouter.io/airouter-sdk#
🪄 AI Router: Automatically get the best LLM for any request.
Documentation | Pricing | FAQ


Install the package using npm:
``sh`
npm install @airouter.io/airouter-sdk
Initialize the AiRouter class with your API key:
`ts
import { AiRouter } from "@airouter.io/airouter-sdk"
const airouter = new AiRouter(
'
)
const bestModel = await airouter.getBestModel({
messages: [{ role: "user", content: "Hey how are you doing?" }],
})
const bestModelFullPrivacy = await airouter.getBestModel({
embedding: ['
embeddingModel: "text-embedding-3-small",
})
``