urai-router
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| URAI_KEYS_FILE | No | Path to the keys file (part of the keys.txt search order, used when --keys is not passed; falls back to ./keys.txt, ~/.config/urai-router/keys.txt, and other default locations) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Urai Router routes OpenAI-compatible chat requests across every API key in your keys.txt.
Use urai_chat for completions, urai_models to discover models (free OpenCode Zen models are included),
urai_health to inspect key health, and urai_ensure_proxy to get a local OpenAI-compatible base URL.
Never print API keys: the tools only return masked values.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| urai_chatB | Send an OpenAI-style chat completion through the automatic key router. Rotates keys on 401/403/429/5xx. |
| urai_modelsC | List the merged model catalogue from all configured providers, including free OpenCode Zen models. |
| urai_keysB | Show masked API keys, health, cooldowns and key counts per provider. |
| urai_healthA | Show router health, key file, catalogue freshness and proxy status. |
| urai_statsA | Show routing statistics (same as health plus catalogue details). |
| urai_explainB | Explain how a model or alias would be routed, which providers qualify and how many keys are ready. |
| urai_refreshC | Reload keys.txt and refresh provider model catalogues. |
| urai_ensure_proxyB | Start the local OpenAI-compatible proxy in the background if needed and return its base URL. |
| urai_checkC | Probe one or all keys with a tiny request and report which ones are valid. |
| urai_setupC | Generate/merge OpenCode, Kiro and skill configuration. dry_run defaults to true. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| route_request | Instructions for routing a coding request through Urai Router |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Urai Router config | Redacted router configuration |
| Key health | Masked keys and cooldown state |
| Providers | Provider registry with base URLs and auth style |
| Models | Merged model catalogue |
| Stats | Router status and catalogue freshness |
TDQS
Scored across 10 tools
Most tools have distinct actions, but urai_health and urai_stats explicitly overlap, with stats described as health plus catalogue details. urai_check and urai_keys also partially overlap on key health/validity, which could cause misselection.
All tools use the same urai_ prefix and snake_case, with a mostly predictable split between action verbs and resource nouns. The mix of verb-style and noun-style names is minor but still readable.
Ten tools is well-scoped for a routing server covering chat, key checks, proxy startup, configuration, model listing, and diagnostics. Each tool maps to a plausible operational need.
The surface covers core routing, key inspection/refresh, proxy startup, model catalogue, setup, and diagnostics. Minor gaps exist around stopping the proxy or adding/removing keys directly, but agents can work around these by editing keys.txt or relying on existing operations.