OpenHands model routing

OpenHands AI model router for resilient agent sessions

Route every OpenHands agent action through one Sage Router endpoint. Keep OpenHands on a stable OpenAI-compatible interface while Sage Router selects across local models, Ollama Cloud, NVIDIA NIM, and authorized cloud APIs by policy, capability, latency, and provider health.

Create API key OpenHands guide Coding-agent routes Browse models

OpenAI-compatible endpoint

OpenHands can use OPENAI_BASE_URL=https://api.sagerouter.dev/v1 with a hosted generated sk_sage_* key, or OPENAI_BASE_URL=http://127.0.0.1:8790/v1 for local routing.

Local Ollama fallback

Use local-first for low-risk background work, balanced for general agent sessions, and stronger authorized cloud routes for fragile repo-wide changes.

429 failover

When an OpenHands route, provider key, or upstream model rate-limits or fails, Sage Router can retry the next healthy eligible provider while OpenHands stays on one endpoint.

60-second OpenHands setup

export OPENAI_BASE_URL=https://api.sagerouter.dev/v1
export OPENAI_API_KEY=sk_sage_your_generated_key

# Or configure OpenHands config.toml:
[llm]
model = "auto"
api_base = "https://api.sagerouter.dev/v1"
api_key = "sk_sage_your_generated_key"

# Local router alternative:
# api_base = "http://127.0.0.1:8790/v1"
# api_key = "local-router"

Agent continuity

OpenHands keeps running through provider outages because the router owns retry and failover policy behind the endpoint.

Credential load balancing

Authorized credential pools can load balance and fail over on rate limits, provider health, latency, and policy.

Provider boundary

Sage Router does not grant unauthorized OpenAI, Anthropic, Gemini, NVIDIA, Ollama Cloud, or other provider access. Customers bring authorized credentials or use hosted routing for Sage Router account control.

OpenHands without provider-specific rewiring

OpenHands does serious multi-step work. Sage Router keeps the agent pointed at one stable endpoint while moving model selection, health-aware fallback, local/cloud preference, and telemetry into one routing layer.

Next steps

Create an API key, open the OpenHands guide, copy the hosted quickstart, or estimate routing fit.