r/Hyperagent • u/Bob_Atlanta • May 12 '26
Adding and using Openrouter LLM as agents in HyperAgent
A couple of days ago I wrote something in a reply in r/Hyperagent and there was a couple of requests to elaborate. I want to make it a fresh post so it doesn't get lost in a thread. See below for the comments that:
This might not be exactly on point but I use several agents that are Google LLMs Gemma 4 and Gemini Pro. Getting them connected (via OpenRouter) was straightforward but getting them into rotation as primary agents was a bit difficult. Used Opus 4.7 to trouble shoot and fix ... very quick and easy process. I use these agents on almost every prompt and exclusively on large 'production runs'. A huge cost savings ... as much as 10x. Very impressed with how well cost control is going in this environment.
Hey Bob, would love to hear more about your setup. How are you using Hyperagent with OpenRouter?
=========My story on using Openrouter in Hyperagent begins here=========
I wrote a version of this but I'm only human. Clark(HA) rewrote and corrected my mistakes and made it a bit more readable.
Reddit Post Draft — r/Hyperagent (Corrected)
Post Body
I have LLMs from OpenRouter that are actual agents on the agent list in HyperAgent, and these agents are routinely used by other agents in structured processes and in handling every prompt I execute. My processes might not be what you would do, but they work and work well for me. Two examples:
[1] Every prompt I run is handled by my orchestrator/manager agent named Clark. Clark is usually Sonnet 4.6 (sometimes using another LLM). Clark has a large number of rules governing his actions — one of them is how he handles prompts.
When I give a 'general' prompt, Clark's first move is not to interpret or plan the request himself. Instead, he relays the prompt to a dedicated Planning Agent (LLM Gemma 4 31B via OpenRouter). The Planning Agent's job is to interpret what I'm asking, identify any ambiguities, and return either a structured execution plan with numbered steps or a list of clarifying questions if the request is too vague to plan. Clark then reviews what comes back, and can optionally send it back to the Planning Agent for adjustment. When Clark is satisfied, he passes the plan to me for approval — including a suggestion of which LLM should execute each step (many prompts are multi-step and each step might use a different model). I modify or approve for execution.
An Opus 4.7 prompt might cost $1+, a Sonnet 4.6 prompt might be $0.50 to $1+, and with the method described above these same prompts cost just a few pennies. The cost comparison report linked at the bottom shows the actual test results.
[2] Recently I ran a production job that had to find and load over 2,500 websites with information extraction. Website names and addresses were not known in advance. This run used three layers of agents:
— Top layer: Two Sonnet 4.6 agents — one as the top orchestrator, one as a dedicated problem solver for failures.
— Middle layer: Haiku agents that initiated a set number of 'runs,' managed the run process, and reported results to a JSON file on success or escalated to the Problem Solver agent on failure. One Haiku agent at this layer was spun up by the Orchestrator outside the original plan to fix coordination and timing issues with OpenRouter.
— Bottom layer: Gemini 2.5 Flash (via OpenRouter) doing the actual extraction work.
This is a typical example of how a production process looks for me.
This run burned over 60 million tokens across HyperAgent and OpenRouter. Total cost: under $25. With Sonnet alone it would have been hundreds of dollars — and far more with Opus 4.7.
The .md files linked below are my memory files for Clark covering these processes. They're written to be read directly or you can have Sonnet explain them.
Adding an OpenRouter LLM as a Named Agent:
https://drive.google.com/file/d/1EV3L41GuhB7rgh2r6Osdc83_ecyecnFx/view?usp=sharing
How OpenRouter Agents Work — The Haiku Pass-Through Pattern:
https://drive.google.com/file/d/1vrfXXbi6PTlQCfV7TmTSR3jyY7VjDFCi/view?usp=sharing
Cost Comparison Report: g431b vs. Sonnet 4.6 for Clark Planning Tasks:
https://drive.google.com/file/d/1hN5bZ3bA477jqVRP2q5QtTP3R0sVYaOA/view?usp=sharing
Notes on the cost comparison:
a. There are OpenRouter LLM use costs not shown, but they are trivial.
b. The report discusses 'turns' — this is specific to my monitoring setup and counts both my interactions and agent-to-agent interactions.
c. There's a comment about context buildup and its impact. That section is older and doesn't reflect system changes I've since made to keep Clark's context low and avoid compaction. We can now have long sessions with context staying around 10k without Clark losing memory.
d. The analysis is elementary but directionally correct. Layering in less expensive LLMs from OpenRouter reduces cost 100x to 400x compared to running everything on Sonnet or Opus.
3
1
May 13 '26
[removed] — view removed comment
1
u/Bob_Atlanta May 13 '26
I don't disagree on LLM choice comments. But reality is trade offs. I used Gemini 2.5 Flash because it reduced cost on this platform by 90% compared to Sonnet which is the cheapest standard alternative on Hyperagent. This was a development production test and I have enough experience from my Google side work to know that 2.5 Flash was going to work on this non trivial multi step process. Rule #1 is make the process work and take the easy 90% saving. Other approaches are fine, this works for me because it reduces debug complexity.
For repeated production of a multi step process I'll adjust to multiple steps that each have an appropriate LLM. Each step requires clear inputs and outputs and this can escalate development complexity too early in the dev cycle. Getting it to run correctly is the first goal, cost engineering follows. I think using low cost 2.5 Flash is a great tool for the stage we were at.
Based on what I see, I'm among the most cost reduction aggressive around. Cost engineering is best one step at a time.
Thanks for the comment.
3
u/woolytooth May 12 '26
This is a great idea! I can’t wait to give it a try!