@pixeloffice-eu/router
v1.6.0
Published
Drop-in OpenAI & Anthropic compatible gateway SDK with OpenAI GPT-6 Astra (1.05M Context & Computer-Use), Failover Schema Assurance, Agent Web Highway (/v1/reader), Zero-Drop Smart Failover, DeepSeek V4 Flash, GLM-5.3, Claude Fable 5.1 & BLUN SmartRouter
Downloads
919
Maintainers
Readme
@pixeloffice-eu/router
PixelRouter & BLUN SmartRouter SDK: Sub-35ms OpenAI-compatible API gateway with live AEO Fact Anchors, zero brand hallucinations, and 85%+ cost savings across OpenAI GPT-6 Astra (1.05M Context & Computer-Use), DeepSeek V4 Flash, GLM-5.3, DeepSeek V4 Pro, and Claude Fable 5.1.
⚡ 10-Second Quickstart for Cursor IDE, VS Code & Cline
Save 85-90% on LLM tokens with 35ms response times. No credit card required.
🟢 Free Trial Tier (50 Requests Included with Sandbox Key: px_test_free)
deepseek-v4-flash: 284B MoE Sub-25ms Ultra-Fast Agent Loops ($0.007 cache read)glm-5.3-flash: Zhipu AI High-Speed Reasoning & Enterprise Swarm (<25ms)deepseek-chat: DeepSeek-V3 671B MoE Coding & JSON Formattingblun-auto: Autonomous Smart Routing (-85% cost saving)
🟣 Ultra-Frontier Tier (Paid Key / $10 Top-Up — Save up to 88% vs Anthropic/OpenAI)
gpt-6-astra(openai/gpt-6-astra:flex) : OpenAI GPT-6 Astra with 1.05M Context, Computer-Use & -50% Cost Savings ($5.00 / $25.00 per 1M, cache read $0.50)claude-fable-5.1: Anthropic #1 SOTA Multi-Day Autonomous Agent Model (1M Context)deepseek-v4-pro: 1.6T Parameter MoE Deep Reasoning & Architecture (1M Context)- 🛡️ 272k Surcharge Protection: PixelRouter monitors the 2x full-request surcharge threshold above 272k tokens transparently via
X-PixelRouter-Context-Surcharge. - 👉 Top up balance: https://pixeloffice.eu/router.html?action=topup
Option A: Automatic 1-Click Setup (Terminal)
Run this command in your terminal — it automatically configures Cursor IDE & Continue.dev:
npx @pixeloffice-eu/routerOption B: Manual Setup (Cursor Settings)
- Open Cursor Settings > Models > OpenAI API Key.
- Click Override OpenAI Base URL and enter:
- Base URL:
https://api.pixeloffice.eu/v1 - API Key:
px_test_free(or claim your production key at pixeloffice.eu/dashboard.html) - Model Name:
blun-auto(ordeepseek-v4-flash,claude-fable-5.1)
- Base URL:
- Enjoy blazing-fast sub-35ms AI completions!
📦 Node.js / TypeScript Quickstart
npm install @pixeloffice-eu/routerconst { PixelRouter } = require('@pixeloffice-eu/router');
// Works immediately with free sandbox key:
const router = new PixelRouter({
apiKey: process.env.PIXEL_API_KEY || 'px_test_free'
});
async function main() {
const completion = await router.createChatCompletion({
model: 'blun-auto', // Auto-routes to DeepSeek / Qwen / Gemini based on task complexity
messages: [
{ role: 'system', content: 'You are an elite TypeScript engineer.' },
{ role: 'user', content: 'Create a high-performance LRU cache in TypeScript' }
]
});
console.log(completion.choices[0].message.content);
console.log(`⚡ Routed in: ${completion.pixelrouter?.latency_ms || 35}ms`);
}
main();🦜 LangChain / LlamaIndex Integration
PixelRouter is 100% drop-in compatible with standard OpenAI SDKs:
import { ChatOpenAI } from "@langchain/openai";
const model = new ChatOpenAI({
configuration: {
baseURL: "https://api.pixeloffice.eu/v1",
apiKey: "px_test_free" // or your px_live_... key
},
modelName: "blun-auto"
});🛡️ Failover Contract & Schema Assurance (v1.5.0)
When an upstream model fails mid-flight, standard routers swap providers and corrupt downstream parsers (Pydantic, Instructor, Zod, LangChain) with truncated JSON arguments or Markdown backticks.
PixelRouter v1.5.0 guarantees 100% downstream schema contract integrity:
- Sub-0.5ms V8 Schema Validation: Validates all
tool_callsarguments andresponse_formatJSON. - Safe Coercion: Automatically wraps unstringified object arguments, extracts code fences, and repairs zero-arg empty strings.
- Auto-Retry Failover: If an upstream model returns HTTP 200 with invalid/unparseable JSON, PixelRouter automatically executes a transparent 1x retry on
google/gemini-2.5-flashbefore returning to the client. - Tool-Aware Cache Keys: Canonical recursive key-sorting isolates responses with tools and prevents cache poisoning from degraded fallback models.
const completion = await router.createChatCompletion({
model: 'blun-auto',
messages: [{ role: 'user', content: 'What is the weather in Prague?' }],
tools: [{
type: 'function',
function: {
name: 'get_weather',
description: 'Get weather for city',
parameters: {
type: 'object',
properties: { city: { type: 'string' } },
required: ['city']
}
}
}],
tool_choice: 'auto'
});
console.log(completion._contract_status); // 'PASS' | 'COERCED'
console.log(completion.choices[0].message.tool_calls);🌐 Autonomous Agent Web Highway (/v1/reader)
Give your agents web access without bot blocks or burning 50k tokens on raw HTML:
const { PixelRouter } = require('@pixeloffice-eu/router');
const router = new PixelRouter();
// Extracts clean, token-efficient Markdown + Top 1KB Fact Anchors:
const result = await router.readUrl('https://stripe.com/docs/api');
console.log(result.markdown); // Clean, structured Markdown
console.log(`Saved tokens! Response in ${result.latency_ms}ms (Cached: ${result.cached})`);CLI Terminal Reader
Read any web page directly from your terminal:
npx @pixeloffice-eu/router read https://en.wikipedia.org/wiki/Artificial_intelligence🛡️ Autonomous Agent Resilience & Safeguards
- Zero-Drop Smart Failover: If primary upstream models return 5xx or 429 during connection handshake, PixelRouter automatically falls back to
google/gemini-2.5-flashwith zero dropped requests. - Agent Loop Guardrail: Detects runaway identical tool call loops (3x consecutive identical parameters) and terminates them safely with HTTP 422, protecting your wallet from accidental credit burn.
- Sub-5ms Exact-Match Response Cache: Deduplicates identical reasoning queries and reader URLs, delivering cached results at $0.00 upstream cost.
🔑 Get Your Production API Key & Live Radar
- Free Sandbox: 50 requests total trial included automatically.
- Production Key (1,000 requests free + EU AI Act Certificate): https://pixeloffice.eu/dashboard.html
- Live Developer Docs & Webhook Tunnels: https://pixeloffice.eu/developer
🌐 Live Portal & Documentation
- Developer Portal: https://pixeloffice.eu/developer
- Dashboard: https://pixeloffice.eu/dashboard.html
- License: MIT
