90 days of the enterprise, pro and team plans free, no card needed. See the plans
Switch in one line
OpenSmartRoute speaks the APIs your code already calls - OpenAI chat completions and Responses, the Anthropic Messages API, embeddings. Point the client at the router, set model to "auto" and every request is priced, routed and explained. Rolling back is the same one line.
Today
from openai import OpenAI
client = OpenAI(api_key=OPENAI_API_KEY)
reply = client.chat.completions.create(
model="gpt-4.1",
messages=[{"role": "user", "content": prompt}],
)
print(reply.choices[0].message.content)Routed
from openai import OpenAI
client = OpenAI(base_url="https://api.opensmartroute.ai/v1",
api_key=OSR_API_KEY)
reply = client.chat.completions.create(
model="auto", # the router picks per request
messages=[{"role": "user", "content": prompt}],
)
print(reply.choices[0].message.content)
print(reply.model) # the model that answeredWhat changed: Two arguments: base_url and the key. model="auto" lets the router decide; keep "gpt-4.1" and the call is pinned, still routed among its providers.
modelthe target that answered - a catalogue model or a deployment of yoursopensmartroute.request_idwhat you send back with feedback, and what the trace is filed underopensmartroute.alternativesthe runners-up, in rank orderopensmartroute.cost_usdwhat this answer cost; the ledger compares it with the baselineopensmartroute.fallback_fromthe targets that failed before this one answered, if anyX-OSR-Target headerthe same target id for clients that only read headersThe same weights and limits are what the routing lab lets you try without a key. On 150 real prompts the router spent 89% less than always using the frontier model; the benchmark page shows the cases it lost too.