OpenHands
Route OpenHands through BitRouter via its LiteLLM-backed custom LLM provider.
OpenHands talks to models through LiteLLM, which has a generic OpenAI-compatible passthrough. Configure that passthrough to hit BitRouter and OpenHands routes across the whole registry.
Prerequisites
-
BitRouter running — local proxy at
http://127.0.0.1:4356, or BitRouter Cloud athttps://api.bitrouter.ai. -
OpenHands installed:
pip install openhands-ai
Mind the double openai/ prefix. LiteLLM uses a leading openai/ to mean "this is an OpenAI-compatible endpoint", and sends everything after it as the model name. Because BitRouter ids already carry a provider prefix, the model string becomes openai/ + openai/gpt-4o → openai/openai/gpt-4o. The first segment is for LiteLLM; the rest is the registry id BitRouter receives.
Point OpenHands at BitRouter
In OpenHands, open Settings → LLM → Advanced and set:
- Custom Model —
openai/openai/gpt-4o - Base URL —
http://127.0.0.1:4356/v1 - API Key — any value for the local proxy; your BitRouter key for Cloud
Add an [llm] section to config.toml in your working directory:
[llm]
model = "openai/openai/gpt-4o"
base_url = "http://127.0.0.1:4356/v1"
api_key = "local-placeholder" # any value for the local proxyFor Cloud, set the base URL to https://api.bitrouter.ai/v1 and use your BitRouter key (from bitrouter auth login or the dashboard) as the API key.
Pick a model
After the leading openai/, use any registry id in provider/model form — openai/openai/gpt-4o, openai/anthropic/claude-sonnet-4-6, openai/google/gemini-2.5-pro — optionally with a :cost or :latency variant on the registry id. See Models.
Verify
Run a task in OpenHands and confirm a response. BitRouter's bitrouter-served-by response header tells you which provider actually answered.
Learn more
How is this guide?