1import Pivotra from"@pivotra/sdk";23const client = newPivotra({ apiKey: process.env.API_KEY });45const response = await client.chat.completions.create({6 model: "auto",7 routing: {8 strategy: "balanced",9 fallbacks: ["gpt-6.2-sol", "gemini-4-argon"],10 },11 messages: [12 { role: "user", content: "Summarize this support ticket in one sentence." },13 ],14});1516console.log(response.choices[0].message.content);17console.log(response.routing.model, response.usage.cost);
Works with clients that let you set a custom OpenAI base URL:
OpenAI SDK
Vercel AI SDK
LangChain
LlamaIndex
LiteLLM
Any HTTP client
Cost optimization
More intelligence. Less unnecessary cost.
A one-line classification rarely needs a frontier model. Compare how configurations trade cost, latency, context and quality on the same workload.
Modeled monthly costEstimate
Requests / month
Configuration
Est. cost / month
Avg. latency
Min. context
Eval index (demo)
Single premium model
Every request → Claude Opus 5.5
$13,140.00
1.05s
1M
94
Single efficient model
Every request → GPT-6 Luna
$328.50
240ms
1.05M
74
Routed · balancedRouting
Engine picks per request
uses: Command R7B, Codestral, GPT-6.2 Sol
$2,678.10
243ms
128K
67
Routed · cost-firstRouting
Cheapest model above quality floor
uses: Command R7B, Codestral, Claude Haiku 5.5
$398.10
219ms
128K
66
Workload: 45% classification · 30% support replies · 15% code · 10% reasoning. Illustrative prices from the sample catalog; your results will depend on your traffic and quality requirements.
Your next model, one line away.
Same request, same response shape. Change a model ID — not your integration.
Test a new release in the playground, then shift traffic gradually with a preferred model.
Put it in a fallback chain first. Promote it once your logs say it’s ready.
Use cases
One policy per workload, not one model for everything.
Real workloads are pipelines. Here’s how the engine routes each step of common production patterns — computed live from the catalog.
Lowest cost strategy
Classify cheaply. Answer carefully.
Most support traffic is tagging and triage. Send it to fast, inexpensive models and keep stronger models for the replies customers actually read.
Extraction / classification · 400 tok in · 60% of calls
$0.00002
coCommand R7B· Cohere200ms TTFT
02Reply drafting
General chat · 1,200 tok in · 35% of calls
$0.00027
Claude Haiku 5.5· Anthropic280ms TTFT
03Escalation review
Multi-step reasoning · 3,000 tok in · 5% of calls
$0.0005
Claude Haiku 5.5· Anthropic280ms TTFT
Blended cost per 1,000 calls
$0.13
Modeled
Developer experience
Everything production needs, built in.
Tracing, spend limits, scoped keys, streaming and typed errors — the pieces every team ends up building around their LLM calls, available from the first request.
Request tracing
Every call records the routing decision, the model and provider that served it, latency, token usage and cost — searchable and exportable.
200
req_7c1e…a90f
gpt-6-luna
balanced
284ms
$0.00004
200
req_31b0…11c2
claude-sonnet-5-5
quality
912ms
$0.00350
429
req_e04d…7b3e
gemini-3.8-flash
latency
41ms
—
200
req_90aa…c4d1
codestral
task rule
377ms
$0.00061
Spend controls
Monthly limits, alert thresholds and an optional hard stop — per workspace and per key.