OpenRouter provider for Copilot Chat with one control panel: paste a request body from the OpenRouter Request Builder and every chat request follows it, while the status bar tracks your key's credit usage.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
OpenRouter for Copilot with Custom Request & Credit Check
A VS Code extension that registers a customizable OpenRouter provider in Copilot Chat. Copilot's built-in OpenRouter provider cannot send OpenRouter's provider routing object or a session_id (microsoft/vscode#283201; microsoft/vscode-copilot-release#11420). This extension calls OpenRouter directly instead of through Copilot's CAPI proxy, so every Chat request can carry whatever request-body options you paste — and it tracks your key's credit usage while you work.
What it does
Adds an "OpenRouter: RC" group to the Copilot Chat model picker with the full OpenRouter catalog (nothing is model-restricted client-side).
Lets you paste a request body from the OpenRouter Request Builder into one panel; its settings — provider routing, sampling params, response_format, plugins, transforms, cache_control, etc. — apply verbatim to every request until you clear or replace it.
Presets: pick a preset in the panel to send "preset": "<slug>" on every request; presets that pin a model also appear in the picker as @preset/<slug> entries (up to the first 25). Picker preset entries affect only turns on that entry.
Reasoning models get VS Code's native Thinking Effort selector (or a simple on/off toggle); reasoning traces render in chat.
Anthropic-family models (anthropic/*) automatically get a top-level cache_control (unless your pasted body sets its own).
Model picker entries show estimated blended price per 1M tokens, context window, max output, and capabilities.
Status bar shows credit remaining; the panel has a usage dashboard.
Always enforced (pasted copies are ignored): model, messages, and tools come from Copilot; stream: true; the extension's own per-session session_id (keeps the prompt cache warm).
The panel
One webview, "OpenRouter for Copilot", with four sections: Settings (save/clear the API key), Usage (credit dashboard), Presets (dropdown), and Custom Request (paste/save/clear). Open it from the status bar item (OR …) or the "OpenRouter: Manage provider" command.
Install (from VSIX)
Build: npm install && npm run package → openrouter-copilot-request-credit-<version>.vsix.
VS Code → Extensions → "…" → Install from VSIX… → select the file.
Open the panel and paste your OpenRouter key (kept in your OS keychain).
In Chat, pick a model from the OpenRouter: RC group and use it like any Copilot model.