Credentials. Hi Route stores subscription credentials, API keys and decision model connections, so use keys with the minimum permissions you need and review who else can access the local service.
Who it is forA developer whose Codex or Claude Code subscription runs out early because every step, including simple file reads, uses the strongest model.
The problemAgent sessions spend premium model usage on routine steps such as reading code or gathering facts, which drains the subscription quickly.
The outcomeRoutine turns run on an economical model, difficult turns stay on the primary model, and each session shows which model ran and what it cost.
What you need first
- macOS 15 or later on Apple silicon or Intel, or Linux x86_64 or ARM64 (aarch64) for the headless CLI and daemon
- An existing Codex or Claude Code subscription, a registered API, or a compatible custom API to connect
- A decision model connection (Bailian, OpenRouter Jev, TypeSafe, or a compatible endpoint) for model-based judgment
- An Agent client such as Codex or Claude Code configured to use HiRoute
Steps
- Run
curl -fsSL https://hiroute.ai/install.sh | shto install the current-user CLI and daemon on Linux without sudo. - Run
hiroute service start --output jsonto start the local service, then runhiroute system status --output jsonto confirm it is running. - Connect your Codex or Claude Code subscription, API key, or compatible custom API in Hi Route.
- Open Models, then Decision models, and connect Bailian, OpenRouter Jev, TypeSafe, or a compatible endpoint.
- Create and publish a routing plan using difficulty routing, then connect your Agent client to it.
- Open the sessions view and check the task category, actual model group, and cost for a few turns.
Prompt for your agent
Using the HiRoute repo at https://github.com/higress-group/HiRoute, set up difficulty routing for <target agent client> so routine turns use the regular model group and hard turns use the primary group. Report the published routing plan name and the model group chosen for the last three turns in a session. Verify that the sessions view shows the actual model that ran and its cost.
Caveat. Routing quality depends on the decision model connection you choose, and cache reuse depends on the provider, so savings are not guaranteed.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for higress-group/HiRoute and "Cut Codex and Claude Code costs with difficulty routing"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer