One lightweight interface for AI Badgr, OpenAI, and Anthropic. Reduce integration overhead, optimize costs, and ensure reliability.
One lightweight interface for AI Badgr, OpenAI, and Anthropic. Reduce integration overhead, optimize costs by defaulting to Badgr, and ensure reliability with automatic fallback.
Seamlessly switch between AI Badgr, OpenAI, and Anthropic.
Full support for streaming responses and embedding models.
Built-in hooks for logging, monitoring, and analytics.
npm install @aibadgr/routerimport { Router } from '@aibadgr/router';
const router = new Router({
defaultProvider: 'aibadgr',
apiKey: process.env.AIBADGR_API_KEY,
fallback: ['openai', 'anthropic']
});
const response = await router.chat.completions.create({
model: 'gpt-3.5-turbo',
messages: [{ role: 'user', content: 'Hello!' }]
});