Create a key
Sign in on the hosted account page, choose a plan or trial path, then generate an sk_sage_* key. Raw keys are shown once.
API quickstart
Create a hosted API key, set one base URL, and use Sage Router profiles such as sage-router/frontier without opening anonymous model traffic.
Live /v1/models requires an active generated sk_sage_* key. The public model catalog is available at https://api.sagerouter.dev/model-catalog.
Sign in on the hosted account page, choose a plan or trial path, then generate an sk_sage_* key. Raw keys are shown once.
Use OPENAI_BASE_URL=https://api.sagerouter.dev/v1 and your generated key as OPENAI_API_KEY.
Start with sage-router/frontier for high-quality agent work. Pro/Max users can use sage-router/fusion when a prompt benefits from a parallel model panel and judge synthesis.
Environment
export OPENAI_BASE_URL=https://api.sagerouter.dev/v1
export OPENAI_API_KEY=sk_sage_your_key_here
export OPENAI_MODEL=sage-router/frontier
First request
curl https://api.sagerouter.dev/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sage-router/frontier",
"messages": [
{"role": "user", "content": "Reply with one sentence about Sage Router."}
]
}'
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: "https://api.sagerouter.dev/v1",
});
await client.chat.completions.create({
model: "sage-router/frontier",
messages: [{ role: "user", content: "Plan one launch task." }],
});
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["OPENAI_API_KEY"],
base_url="https://api.sagerouter.dev/v1",
)
client.chat.completions.create(
model="sage-router/frontier",
messages=[{"role": "user", "content": "Plan one launch task."}],
)
mkdir -p ~/.codex
cat >> ~/.codex/config.toml <<'TOML'
[model_providers.sage-router-hosted]
name = "Sage Router Hosted"
base_url = "https://api.sagerouter.dev/v1/"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
[profiles.sage-router-frontier]
model_provider = "sage-router-hosted"
model = "sage-router/frontier"
TOML
export OPENAI_API_KEY=sk_sage_your_key_here
codex --profile sage-router-frontier
Read the dedicated Codex setup page for hosted, local port 8790, and Tailnet profiles.
Premium synthesis
On Pro, Max, metered, manual, or operator-enabled accounts, sage-router/fusion runs a small panel of eligible authorized routes, then asks a judge route to synthesize one final answer. OpenRouter-style clients can also attach {"type":"openrouter:fusion"} as a premium server tool. Lite keys receive 402 fusion_plan_required.
curl https://api.sagerouter.dev/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sage-router/fusion",
"messages": [
{"role": "user", "content": "Compare the strongest launch risks and give one recommendation."}
]
}'
curl https://api.sagerouter.dev/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sage-router/frontier",
"messages": [
{"role": "user", "content": "Survey the strongest arguments for and against this launch."}
],
"tools": [{"type": "openrouter:fusion"}],
"tool_choice": "required"
}'
| Status | Likely cause | Next action |
|---|---|---|
| 401 | Missing, revoked, or inactive sk_sage_* key. | Create or verify a hosted API key on the account page. |
| 402 | Plan, quota, or billing state blocks routing. | Choose a plan, finish checkout, or review current quota. |
| 429 | Request-per-minute limit or abuse control triggered. | Back off, reduce concurrency, or upgrade the plan limit. |
| 503 | No healthy authorized backend route is available. | Check public status, provider credentials, local router health, or fallback policy. |
For safe diagnostics, response headers, and support context, read the dedicated API troubleshooting page.
Boundary
Sage Router sells routing, account management, quotas, analytics, and reliability infrastructure. Public plans route across customer-authorized provider access, local models, subscriptions, API keys, cloud accounts, or endpoints. Sage Router does not grant unauthorized model access, pool personal accounts, or override provider terms.