Breaking Free from AI Subscriptions: Cost-Effective All-in-One Solution with OpenRouter

AI is here to stay. From my early days with the Copilot trial to now I am using it in different flavours and capacities. I've become convinced that AI properly used especially, in Software Engineering can significantly boost development productivity and accelerate learning. By the end of this article, I'll share my approach to leveraging AI. If you're still hesitant to use AI out of fear it will take your job, consider this: there's a much higher probability that colleagues who become proficient with AI tools will ultimately replace you instead. To me, this resistance is similar to avoiding Google searches in favour of manually reading documentation—it sounds admirable in theory but is ultimately less practical and runs counter to how modern work happens. So having said that, one issue with every service nowadays is they're all subscription-based, and moreover, it's often not enough to have just one subscription. Some content is only available on Netflix, and other things are exclusively on Hulu. I felt similarly about major AI models as well—Copilot Pro, Claude Pro, and Grok Pro all require monthly subscriptions. We have Copilot, Tabnine, Cody, and many others in the coding space. The recent release of models is becoming overwhelming, with Grok, R1, Gemini, and others rapidly emerging to challenge the monopoly of OpenAI and Anthropic. For someone like me who uses these models infrequently or in bursts and loves to play with different models to get a better grasp of improvements in AI, paying for subscriptions feels like a waste of money. Of course, you can purchase API keys and pay for credits as you go, but then you're managing different billing accounts and keys for each model, which is hassle on another level. If only there were a single platform that could solve this problem that going to allow you to use any model you want while simply paying for actual usage. I started searching for a solution for this goal and I've found a solution and I will share all about it in this article. Goal to achieve Before explaining the solution, let me provide a brief overview of how I use AI in my workflow. This context will help you understand why I chose this particular approach. I primarily use AI for interactive chat functionality. I don't prefer automatic code generation or AI autocomplete features, though you can achieve cursor-like code generation with this approach if desired. This wasn't my primary goal because I believe generating large sections of code or multiple files simultaneously via AI isn't ideal. Such practices can introduce problematic code that degrades quality and maintainability. Instead, I prefer using AI as a collaborative companion—a tool to discuss issues with, solve specific problems, and suggest improvements. For this workflow, two essential features were critical: Provide better pricing for variable usage patterns (Pay on Usage) The ability to easily add coding context to chat conversations A simple way to experiment with and switch between different AI models OpenRouter a unified interface (All LLM in One API) In my search for a comprehensive AI solution, I explored various approaches and discovered OpenRouter—a unified API gateway that provides access to about 300 models from major providers including every model from OpenAI, Anthropic, Google, Deepseek, and countless others. If a model is publicly available it will be available in OpenRouter. It serves as an excellent platform to monitor recent AI trends and compare model performance side-by-side. OpenRouter even offers a multi-model chat interface where you can test and experiment with different models simultaneously. Each model is accessible through a straightforward API interface using a single API key—which is precisely what we'll be utilizing in our next steps. Perhaps the most appealing aspect is OpenRouter's transparent pricing structure. Costs are clearly displayed for each model and prompt, with no additional fees beyond what you'd pay through official APIs. Integration is remarkably straightforward, as most custom AI chat extensions in IDEs already support the OpenRouter API protocol. CopilotChat Replacement in IDE If you just want to chat with different models then OpenRouter's chat interface is quite sufficient but for us software engineers we need to integrate it into the IDE to supercharge the power with coding context and a easy interface. As I mainly use VSCode, JetBrains IDE & NeoVim. I will share my tooling and configuration with some additional options available for different workflows. For Visual Studio Code & Jetbrain IDE's For these GUI-based IDEs, my preferred choice is the Continue extension. It's exceptionally straightforward, easily configurable, and comes with clear documentation. Alternatives like Cline provide a more Cursor-like agentic code generation experience which isn't my preference for my workflow, but may appeal to others looking for that fu

Mar 15, 2025 - 21:18
 0
Breaking Free from AI Subscriptions: Cost-Effective All-in-One Solution with OpenRouter

AI is here to stay. From my early days with the Copilot trial to now I am using it in different flavours and capacities. I've become convinced that AI properly used especially, in Software Engineering can significantly boost development productivity and accelerate learning. By the end of this article, I'll share my approach to leveraging AI. If you're still hesitant to use AI out of fear it will take your job, consider this: there's a much higher probability that colleagues who become proficient with AI tools will ultimately replace you instead. To me, this resistance is similar to avoiding Google searches in favour of manually reading documentation—it sounds admirable in theory but is ultimately less practical and runs counter to how modern work happens.

So having said that, one issue with every service nowadays is they're all subscription-based, and moreover, it's often not enough to have just one subscription. Some content is only available on Netflix, and other things are exclusively on Hulu. I felt similarly about major AI models as well—Copilot Pro, Claude Pro, and Grok Pro all require monthly subscriptions. We have Copilot, Tabnine, Cody, and many others in the coding space.

The recent release of models is becoming overwhelming, with Grok, R1, Gemini, and others rapidly emerging to challenge the monopoly of OpenAI and Anthropic. For someone like me who uses these models infrequently or in bursts and loves to play with different models to get a better grasp of improvements in AI, paying for subscriptions feels like a waste of money. Of course, you can purchase API keys and pay for credits as you go, but then you're managing different billing accounts and keys for each model, which is hassle on another level. If only there were a single platform that could solve this problem that going to allow you to use any model you want while simply paying for actual usage. I started searching for a solution for this goal and I've found a solution and I will share all about it in this article.

Goal to achieve

Before explaining the solution, let me provide a brief overview of how I use AI in my workflow. This context will help you understand why I chose this particular approach.
I primarily use AI for interactive chat functionality. I don't prefer automatic code generation or AI autocomplete features, though you can achieve cursor-like code generation with this approach if desired. This wasn't my primary goal because I believe generating large sections of code or multiple files simultaneously via AI isn't ideal. Such practices can introduce problematic code that degrades quality and maintainability.
Instead, I prefer using AI as a collaborative companion—a tool to discuss issues with, solve specific problems, and suggest improvements. For this workflow, two essential features were critical:

  1. Provide better pricing for variable usage patterns (Pay on Usage)
  2. The ability to easily add coding context to chat conversations
  3. A simple way to experiment with and switch between different AI models

OpenRouter a unified interface (All LLM in One API)

In my search for a comprehensive AI solution, I explored various approaches and discovered OpenRouter—a unified API gateway that provides access to about 300 models from major providers including every model from OpenAI, Anthropic, Google, Deepseek, and countless others. If a model is publicly available it will be available in OpenRouter. It serves as an excellent platform to monitor recent AI trends and compare model performance side-by-side.
Openrouter Chat Room Interface

OpenRouter even offers a multi-model chat interface where you can test and experiment with different models simultaneously. Each model is accessible through a straightforward API interface using a single API key—which is precisely what we'll be utilizing in our next steps.

Token Usage and Cost Report Per Prompt for last 30 days

Perhaps the most appealing aspect is OpenRouter's transparent pricing structure. Costs are clearly displayed for each model and prompt, with no additional fees beyond what you'd pay through official APIs. Integration is remarkably straightforward, as most custom AI chat extensions in IDEs already support the OpenRouter API protocol.

CopilotChat Replacement in IDE

If you just want to chat with different models then OpenRouter's chat interface is quite sufficient but for us software engineers we need to integrate it into the IDE to supercharge the power with coding context and a easy interface. As I mainly use VSCode, JetBrains IDE & NeoVim. I will share my tooling and configuration with some additional options available for different workflows.

For Visual Studio Code & Jetbrain IDE's

For these GUI-based IDEs, my preferred choice is the Continue extension. It's exceptionally straightforward, easily configurable, and comes with clear documentation. Alternatives like Cline provide a more Cursor-like agentic code generation experience which isn't my preference for my workflow, but may appeal to others looking for that functionality. If anyone into that they can use Cline which is more popular VSCode Plugin.

Setup is very simple:

  1. Install the Extension.
  2. Setup the Continue Local Config with model data
{
  "models": [
    {
      "title": "Flash 2.0",
      "provider": "openrouter",
      "model": "google/gemini-2.0-flash-001",
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "OPENROUTER-API-KEY"
    },
    {
      "title": "Claude 3.7 Sonnet",
      "provider": "openrouter",
      "model": "anthropic/claude-3.7-sonnet",
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "OPENROUTER-API-KEY"
    },
    {
      "title": "DeepSeek: R1",
      "provider": "openrouter",
      "model": "deepseek/deepseek-r1:free",
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "OPENROUTER-API-KEY"
    },
    {
      "title": "OpenAI: o3 Mini",
      "provider": "openrouter",
      "model": "openai/o3-mini",
      "apiBase": "https://openrouter.ai/api/v1",
      "apiKey": "OPENROUTER-API-KEY"
    },
  ],
  "contextProviders": [
  ],
  "slashCommands": [
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "cmd",
      "description": "Generate a shell command"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ],
  "data": []
}

In this configuration, I've added four models from four different LLM providers: Google's Gemini 2.0 Flash, Antropics Claude-3.7-sonnet, Deepseek's R1 and OpenAi's o3 Mini. You can add any model from the OpenRouter API you want. Now, you can choose any of these models from the chat Interface and add context with the @ symbol.

Visual Studio Continue with Openrouter Local Config<br>

For Neovim

I tried many options for Neovim, and everyone is quite hyped about Avante. But to me, it felt like a lot of tooling I don't need as it is more focused for cursor-like code generation agentic workflow. So if anyone into that they will I think really like avante.
After testing many options, I ultimately selected CodeCompanion. It impressed me with its simplicity while still being feature-rich. It provides excellent support for different context providers, makes switching between models effortless, and maintains the lightweight experience I value in my Neovim setup.
CodeCompanion also offers clear, comprehensive documentation, making it straightforward to implement advanced features if anyone wants it.

CodeCompanion Plugin in Neovim

To replicate similar experiences in Neovim you can check my config from my dotfile repo:
.dotfile: code-companion.lua

Bonus tip: If you use Lualine, you can integrate a loading animation & current model selection for CodeCompanion that significantly enhances your user experience while processing requests.
.dotfile: lualine.lua

.dotfile: spinner.lua

You can follow the getting started guide and set the OPENROUTER_API_KEY in the environment. It's good to go. The experience is in my opinion much better and polished than GitHub Copilot Chat in Neovim.

Conclusion:

After using this setup, I don't miss Copilot & Tabnine Chat at all. In fact, I'm enjoying the additional features this approach provides. Regarding cost, if someone uses expensive models like Claude 3.7 heavily - especially with agentic workflows or you are into "Vibe Coding" where millions of lines of context are shared - then a subscription service like Copilot might be more cost-efficient.

However, for occasional users like me, this approach is very affordable. Plus, you're not dependent on a provider's goodwill to access the latest models. When an API becomes publicly available, you can immediately integrate it into your workflow. In my opinion, this flexibility is invaluable in today's rapidly evolving AI landscape.