One OpenAI base URL
Use https://api.sagerouter.dev/v1 for hosted routing, http://127.0.0.1:8790/v1 for local routing, or a Tailnet host when provider credentials should stay private.
OpenAI-compatible routing
Keep the OpenAI SDK shape, but stop hard-coding one provider, one API key, and one model. Sage Router gives OpenAI-compatible clients one base URL for generated hosted keys, local routers, provider subscriptions, OpenAI keys, Anthropic, Gemini, Ollama, and private endpoints.
Use https://api.sagerouter.dev/v1 for hosted routing, http://127.0.0.1:8790/v1 for local routing, or a Tailnet host when provider credentials should stay private.
Configure multiple OpenAI API keys for the same provider, balance traffic across healthy credentials, and fail over when one key hits a 429 or retryable provider error.
Route OpenAI-compatible chat completions and Responses-style agent traffic through stable profiles such as sage-router/frontier while keeping provider policy behind the router.
export OPENAI_BASE_URL=https://api.sagerouter.dev/v1
export OPENAI_API_KEY=sk_sage_your_generated_key
curl "$OPENAI_BASE_URL/chat/completions" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sage-router/frontier",
"messages": [{"role": "user", "content": "Route this through the best healthy model"}]
}'
Retryable rate limits can move to another eligible credential, provider, or local model without every app implementing its own fallback stack.
Image, audio, video, and document inputs route to capable models only, with served modality history recorded per model for better future decisions.
Sage Router sells routing, generated keys, quotas, and analytics. Public plans do not grant unauthorized provider access or bypass provider terms.
The OpenAI SDK is the common client interface for agents, coding tools, and internal apps. The operational problem is not syntax; it is reliability. Teams need health-aware fallback, credential pools, multimodal capability gates, provider policy, route telemetry, and hosted activation without rewriting every client.
Create an API key, copy the hosted quickstart, read the API reference, or compare OpenRouter.