xAI API key custody
Configure Grok as an authorized provider route using your own XAI_API_KEY. Sage Router supports API-key mode; it does not proxy xAI SSO sessions or grant unauthorized Grok access.
xAI Grok routing
Use Sage Router as the policy layer around xAI Grok API routes. Keep XAI_API_KEY under your custody, expose one OpenAI-compatible endpoint to agents, and fail over to other authorized coding, frontier, local, or multimodal routes when a key, model, or provider path is unhealthy.
Configure Grok as an authorized provider route using your own XAI_API_KEY. Sage Router supports API-key mode; it does not proxy xAI SSO sessions or grant unauthorized Grok access.
Point OpenAI SDKs, Codex, Cursor, Aider, Continue, OpenHands, and gateway-compatible clients at https://api.sagerouter.dev/v1 while the router chooses Grok, OpenAI, Anthropic, Gemini, Ollama, NVIDIA NIM, or private routes by policy.
When a Grok key, model route, or fallback provider rate-limits, Sage Router can choose another eligible authorized route instead of making every agent own retry and fallback logic.
export OPENAI_BASE_URL=https://api.sagerouter.dev/v1
export OPENAI_API_KEY=sk_sage_your_generated_key
export XAI_API_KEY=xai-your_authorized_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": "Use Grok if it is the best healthy authorized route"}]
}'
Credential pools can distribute traffic across authorized xAI keys and fail over when one key is exhausted, revoked, rate-limited, or unhealthy.
Image, audio, video, and document inputs route only to capable models, so auto and agentic profiles do not send multimodal work to incompatible routes.
Public Sage Router plans sell routing, generated keys, quotas, and telemetry. They do not include bundled xAI resale or xAI SSO proxying.
Grok is another useful frontier route, but production agents still need provider policy, 429 failover, key rotation, route observability, multimodal capability gates, and local escape hatches. Sage Router keeps Grok in the matrix without making it the only path.
Create an API key, copy the hosted quickstart, use the OpenAI-compatible setup, or estimate routing fit.