Lightweight, zero-dependency client SDK for SentioGate — the zero-markup, OpenAI-compatible LLM router that sends each request to a suitable model across your own provider keys (OpenAI, Anthropic, Gemini, DeepSeek, Groq and more) and automatically falls back to another model if one fails.
- 📦 NPM Package:
https://www.npmjs.com/package/@sentiogate/sdk - 🐍 Python SDK:
https://pypi.org/project/sentiogate-python/ - 🌐 Developer Hub & Simulator:
https://sentiogate.github.io
# npm
npm install @sentiogate/sdk
# pnpm
pnpm add @sentiogate/sdk
# yarn
yarn add @sentiogate/sdk
# bun
bun add @sentiogate/sdkimport { AutoRouter } from "@sentiogate/sdk";
const router = new AutoRouter({
baseUrl: "https://api.sentiogate.dev", // host only; the SDK adds /v1/...
apiKey: process.env.SENTIOGATE_API_KEY,
});
// Basic chat completion: "auto" picks the cheapest suitable model
const response = await router.chat({
model: "auto",
messages: [
{ role: "system", content: "You are a concise engineering assistant." },
{ role: "user", content: "Explain vector embeddings in 1 sentence." },
],
});
console.log(response.choices[0].message.content);for await (const chunk of router.streamChat({
model: "auto",
messages: [{ role: "user", content: "Write a quicksort implementation in TypeScript." }],
extraBody: { route_preference: "latency" }, // "cost" (default), "quality" or "latency"
})) {
process.stdout.write(chunk.choices?.[0]?.delta?.content || "");
}- 0% Token Markup: Bring-Your-Own-Key (BYOK). You pay your providers directly; SentioGate adds no fee per token.
- Automatic routing: send
model: "auto"and setroute_preference(viaextraBody) tocost(default),qualityorlatency. You can also request a specificprovider/model. - Fallback: SentioGate automatically falls back to another model if one fails.
- Structured errors and opt-in retries:
RouterClientErrorexposescode,retryAfterandretryable; setmaxRetriesto retry transient 429s after the server's Retry-After. - OpenAI-compatible: pass extra OpenAI-style parameters through
extraBody. - Multi-Environment Support: Node.js 18+, Bun, Deno, edge runtimes and modern browsers.