90 days of the enterprise, pro and team plans free, no card needed. See the plans
Library, sidecar or hosted API
Embed the SDK in a Python service, call it from TypeScript, run the container beside your app, or use this platform. The OpenAI-compatible and Anthropic-compatible endpoints (chat, Responses, Messages, embeddings, moderations, audio, images) mean existing clients switch by changing one base URL.
pip install "opensmartroute[yaml]"
from opensmartroute import (
Objective, RequestConstraints, RouteRequest,
Router, load_rules, load_targets,
)
from opensmartroute.strategies import (
default_strategies,
)
router = Router(
load_targets("targets.yaml"),
strategies=[
load_rules("rules.yaml"),
*default_strategies(),
],
)
req = RouteRequest(
"Prove that sqrt(2) is irrational.",
constraints=RequestConstraints(
max_cost_per_1k=0.02,
),
objective=Objective(quality=1.0, cost=0.4),
)
d = router.route(req, plan=True)
print(d.target.id, f"{d.confidence:.2f}")
# per-strategy scores and rationales
print(d.trace.explain())
# who was filtered out, and why
print(d.trace.policy_rejections)Zero runtime dependencies. plan=True returns the ranked runners-up and every policy rejection with the winner.
Photo: Daniil Komov