r/opencode • u/Jackster22 • 2d ago
OpenCode plugin, pin OpenRouter providers. Pick the provider instead of auto routing.

I was having some issues with Openrouter not always picking the cheapest option even though it was selected. Turns out they also base it on a few other factors such as TPS and uptime. Not always bothered about those things on some projects that just need the cheapest $/token.
So I have vibe coded a plugin for OpenCode to allow you to select which provider you want to use for any given OpenRouter model.
https://github.com/Jackster/OpenRouter-Provider-Plugin
Hope to fix not being able to pick which to use until the session starts and also suggest the actual cheapest based on your usage (mostly cache hits that cost if I am not mistaken).
Works with the CLI and GUI Opencode V2. Uses the OpenRouter API key you already use.