Continue · VS Code + JetBrains

Continue + Leanroute

Continue's OpenAI provider speaks our wire format natively. You add one entry per model you want available in the editor's model picker.

1. Get a gateway key

From /dashboard/keys create a key labeled "continue" (or whatever helps you remember which editor is using it). Copy the gw_live_* value — it's shown only once.

2. Edit ~/.continue/config.json

Open Continue's config (in VS Code: Command Palette → Continue: Open config.json). Add or replace the models array with the Leanroute entries you want. Each model gets the same apiKey and apiBase; the only thing that differs is the title and the canonical model string.

{
  "models": [
    {
      "title": "Sonnet via Leanroute",
      "provider": "openai",
      "model": "anthropic/claude-sonnet-4-6",
      "apiKey": "gw_live_YOUR_KEY",
      "apiBase": "https://api.leanroute.dev/v1"
    },
    {
      "title": "GPT-4o via Leanroute",
      "provider": "openai",
      "model": "openai/gpt-4o",
      "apiKey": "gw_live_YOUR_KEY",
      "apiBase": "https://api.leanroute.dev/v1"
    },
    {
      "title": "DeepSeek-V3 (cheap) via Leanroute",
      "provider": "openai",
      "model": "deepseek/deepseek-v3",
      "apiKey": "gw_live_YOUR_KEY",
      "apiBase": "https://api.leanroute.dev/v1"
    }
  ]
}

Save the file. Continue picks up the change on the next chat or autocomplete request — usually no editor restart is needed, but if the new model doesn't appear in the picker within a few seconds, reload the window.

3. Sanity-check the wire

Open the Continue chat panel, pick "Sonnet via Leanroute" from the model dropdown, and type hello. You should get a response within a second or two. If the response header bar shows a 402, your prepaid balance is exhausted — top up at /dashboard/billing. If the model name is rejected with 400, double-check the provider/model form against /dashboard/models.

Optional: opt in to cheaper-model swaps

By default we send to the exact model you asked for. If you want Continue's Sonnet requests routed to DeepSeek-V3 (or whichever is cheapest in the flagship tier today) when they show up, enable the cheaper-model swaps toggle in /dashboard/settings. Any single request can still override with the header X-Gateway-Routing: explicit — Continue doesn't expose a way to set arbitrary headers, so this is an org-wide opt-in.

Troubleshooting

  • 401 unauthenticated: the key was rotated or revoked. Issue a new one at /dashboard/keys.
  • 400 unknown_model: the model name doesn't match our canonical list. The provider prefix is required (use anthropic/claude-sonnet-4-6, not claude-sonnet-4-6).
  • No autocomplete suggestions: Continue uses a separate "tabAutocompleteModel" setting. Add a small/cheap model (e.g. openai/gpt-4o-mini) under that key in the same config file.