@airouter.io/airouter-sdk
v0.1.12
Published
Official Typescript SDK for airouter.io - Automatically route requests to the best Large Language Model (LLM).
Readme
🪄 AI Router: Automatically get the best LLM for any request.
Documentation | Pricing | FAQ
Installation
Basic Installation
Install the package using npm:
npm install @airouter.io/airouter-sdkUsage
Initialize the AiRouter class with your API key:
import { AiRouter } from "@airouter.io/airouter-sdk"
const airouter = new AiRouter(
'<YOUR-API-KEY>',
)
const bestModel = await airouter.getBestModel({
messages: [{ role: "user", content: "Hey how are you doing?" }],
})
const bestModelFullPrivacy = await airouter.getBestModel({
embedding: ['<EMBEDDING>'],
embeddingModel: "text-embedding-3-small",
})License
This project is licensed under the MIT License - see the LICENSE file for details.
