Introduction
BYOK router for OpenAI-compatible APIs.
Promptimizer is middleware, not a new model vendor. You bring an OpenAI-compatible key. We classify each request, route it to the cheapest adequate tier, cache repeated system and context prefixes, and measure cost saved versus always-frontier — with a quality score, so silent degradation is visible.
Quickstart
Create an account, mint an API key, and route your first prompt.
Open →
SDK
npm i promptimizer — drop-in chat completions plus an offline classifier.
Open →
API
OpenAI-compatible /v1 endpoints, auth, and error map.
Open →
Quality gate
Hard questions escalate. A cheap-only router fails the benchmark on purpose.
Open →
What you get
| Piece | Job |
|---|---|
| Classifier | Complexity L1–L5, category, quality risk |
| Router | Cheapest selected model in the adequate tier. Step up, never down |
| Prompt cache | SHA-256 of system + long context. Repeat prefixes bill at 50% input |
| Quality guard | Thin or refusing answers on hard tasks retry one tier higher |
| Benchmark | Fixed 15-task gold set. Cost and quality vs always-frontier |
Quality is measured
Each request has a quality gate. The benchmark reports routed quality, frontier quality, and the delta so cheap answers that fail are visible.
How it ships
Create an account, store a provider, mint a pmz_live_ key. The TypeScript SDK and any OpenAI-compatible client talk to /api/v1. FastAPI is the self-hosted gateway.