Skip to content

Feature Request: Add OpenRouter provider routing/custom request parameter options to Copilot settings #283201

Description

@jsalix

Hello! I'm enjoying VSCode Copilot so far, thanks for work from you guys.

I primarily use the OpenRouter integration since I have credits over there and like testing out various models for my various needs, both professional and personal. I would love to see some sort of setting or configuration that would allow me to specify the "provider" OpenRouter routes requests to, link to docs: https://openrouter.ai/docs/features/provider-routing

The minimum feature that would be most useful to me would be setting values in the only string array under the provider object in the request body, i.e.:

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -d '{
  "model": "deepseek/deepseek-r1-0528",
  "messages": [
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ],
  "provider": {
    "only": ["deepinfra"]
  }
}'

This would let me make sure the requests are going to the specific OpenRouter provider I want, which might be based on their price, context size, max output, inference speed, prompt caching, etc. I am aware I can set an account-wide setting in OpenRouter that forces all requests to specific providers, but I have many different OpenRouter keys that I use in many different apps that I'm playing around with and it wouldn't be nearly as convenient since those providers would be enforced for ALL my keys.

Even more useful, maybe having a custom setting like github.copilot.chat.byok.openRouterCustomizeRequest that lets me append an object of properties to be added to the request body for all calls to OpenRouter? This could even let me set values for things like samplers (i.e. min_p, presence_penalty, etc) which is useful for models from folks like DeepSeek and Qwen which have specific sampler settings to get the best performance from their models. I get if that's outside the current scope and could potentially be a foot-gun for less experienced users, but as a "poweruser" (I think lol) this would be super useful to me.

Thanks!

Metadata

Metadata

Labels

*out-of-scopePosted issue is not in scope of VS Code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions