X

Using OpenRouter in Visual Studio 2026 through an Ollama Proxy

One of the more annoying limitations in GitHub Copilot for Visual Studio 2026 is that OpenRouter is not supported directly.

That’s unfortunate, because OpenRouter gives access to a huge range of models through a single API. Claude, GPT-5, DeepSeek, Gemini, Qwen, Mistral… it’s all there.

Meanwhile, Visual Studio does support Ollama.

So the workaround became pretty obvious:

Create a small proxy that pretends to be Ollama while forwarding everything to OpenRouter.

Project link:

https://github.com/sander-/openrouter-copilot-proxy

The idea is simple:

Visual Studio 2026
        ↓
    Ollama API
        ↓
      Proxy
        ↓
   OpenRouter
        ↓
   Any AI model

Visual Studio thinks it’s talking to Ollama.

Behind the scenes, the proxy translates requests into OpenRouter API calls.

Why This Exists

Visual Studio 2026 currently has fairly limited flexibility when it comes to AI providers.

There’s no direct OpenRouter integration, no easy custom endpoint configuration, and no straightforward way to experiment with different providers.

But because Ollama support already exists, it becomes the perfect bridge.

The proxy exposes an Ollama-compatible API locally, which means Visual Studio connects without realizing anything special is happening.

That suddenly unlocks access to a much larger ecosystem of models directly inside Copilot Chat and agent workflows.

Setup

It is just a PowerShell script.

Clone the repository:

git clone https://github.com/sander-/openrouter-copilot-proxy
cd openrouter-copilot-proxy

Then either pass the OpenRouter key directly:

.\openrouter-proxy.ps1 -OpenRouterApiKey "sk-or-v1-..."

Or use an environment variable:

$env:OPENROUTER_API_KEY = "sk-or-v1-..."
.\openrouter-proxy.ps1

You can also filter providers:

.\openrouter-proxy.ps1 -ModelFilter "anthropic"

And enable verbose request/response logging:

.\openrouter-proxy.ps1 -DebugOutput

The script exposes a local Ollama-compatible endpoint that Visual Studio 2026 can connect to.

Once configured, Copilot starts talking to OpenRouter models transparently.

This Gets Interesting with Agents

This setup becomes especially useful with agent workflows inside Visual Studio.

Modern coding agents rely heavily on:

  • repository context
  • multi-step reasoning
  • tool usage
  • planning
  • asking follow-up questions
  • autonomous execution loops

Different models behave very differently in those scenarios.

Some are great at reasoning.

Some are much stronger at implementation.

Others are extremely fast but less reliable.

With OpenRouter behind the proxy, switching between models becomes easy.

For example:

  • Claude for architecture and reasoning
  • DeepSeek for coding
  • GPT-5 for broader planning
  • Qwen for speed

That flexibility is one of the biggest advantages of this setup.

Token Visibility Is Actually Useful

One unexpected benefit of having a proxy in the middle is visibility.

It becomes possible to inspect:

  • token input
  • token output
  • prompt sizes
  • latency
  • retries
  • tool calls
  • raw responses

That becomes extremely useful when experimenting with agents and comparing models.

Some models burn through tokens surprisingly fast.

Others stay concise.

Some ask excellent follow-up questions.

Some completely fall apart during autonomous tasks.

Seeing the actual traffic makes it much easier to understand how models behave in practice.

One Annoying Limitation

There is still one frustrating issue in Visual Studio 2026.

The selected model is not remembered for new chat threads.

So every time a new conversation starts, the correct model has to be selected again manually.

That gets tedious pretty quickly when switching models often.

Hopefully default model selection gets added eventually.

For now, the workflow is basically:

  1. Start a new thread
  2. Select the model again
  3. Continue working

Not a huge issue, but definitely a bit of friction.

Summary

Using Ollama compatibility as a bridge to OpenRouter turned out to be a surprisingly clean solution for Visual Studio 2026.

It opens the door to far more models, better experimentation with agents, and much more flexibility than the default Copilot setup currently allows.

Until proper OpenRouter support arrives, this works remarkably well.

Related Post
Leave a Comment