crazyrouter
v1.0.0
Published
Official Node.js SDK for Crazyrouter — One API key for 300+ AI models (GPT-5, Claude Opus 4, Gemini 3, DeepSeek V3 and more). Drop-in replacement for OpenAI SDK.
Downloads
98
Maintainers
Readme
Crazyrouter Node.js SDK
One API key for 300+ AI models. Drop-in replacement for the OpenAI SDK.
Access GPT-5.4, Claude Opus 4.6, Gemini 3.1 Pro, DeepSeek V3.2, and 300+ more models through a single API — up to 50% cheaper than going direct.
Installation
npm install crazyrouterQuick Start
import Crazyrouter from "crazyrouter";
const client = new Crazyrouter({ apiKey: "sk-xxx" });
// GPT-5.4
const gpt = await client.chat.completions.create({
model: "gpt-5.4",
messages: [{ role: "user", content: "Explain quantum computing" }],
});
// Claude Opus 4.6 — same API, just change the model name
const claude = await client.chat.completions.create({
model: "claude-opus-4-6",
messages: [{ role: "user", content: "Explain quantum computing" }],
});
// Gemini 3.1 Pro
const gemini = await client.chat.completions.create({
model: "gemini-3.1-pro-preview",
messages: [{ role: "user", content: "Explain quantum computing" }],
});Why Crazyrouter?
| Feature | Crazyrouter | Direct APIs | OpenRouter | |---------|-------------|-------------|------------| | Models | 300+ | 1 per provider | 300+ | | API Keys | 1 | Multiple | 1 | | Pricing | Up to 50% cheaper | Full price | +10-30% markup | | OpenAI Compatible | ✅ | ❌ | ✅ | | SDK Compatibility | Drop-in | N/A | Custom |
Supported Models
- OpenAI: GPT-5.4, GPT-5.2, GPT-5, GPT-4o, GPT-4.1, o3, o4-mini
- Anthropic: Claude Opus 4.6, Sonnet 4.6, Haiku 4.5
- Google: Gemini 3.1 Pro, Gemini 3 Pro, Gemini 2.5 Pro/Flash
- DeepSeek: V3.2, V3.1, R1
- And 280+ more...
Helper Functions
import { listModels, chat } from "crazyrouter";
// List all available models
const models = await listModels("sk-xxx");
// Quick one-liner chat
const answer = await chat("sk-xxx", "gpt-5.4", "What is 2+2?");Streaming
const stream = await client.chat.completions.create({
model: "claude-opus-4-6",
messages: [{ role: "user", content: "Write a poem" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}Migration from OpenAI SDK
- import OpenAI from "openai";
+ import Crazyrouter from "crazyrouter";
- const client = new OpenAI({ apiKey: "sk-openai-xxx" });
+ const client = new Crazyrouter({ apiKey: "sk-crazyrouter-xxx" });
// Everything else stays the same!Links
License
MIT © Crazyrouter
