---
title: "GitHub Copilot Chat on your own API key"
canonical: https://relayswitch.io/guides/github-copilot
generated: 2026-11-15T03:25:00.231Z
source: https://api.relayswitch.io/v1/catalog
base_url: https://api.relayswitch.io/v1
---

Checked 2026-10-28

# GitHub Copilot Chat on one key

Add RelaySwitch to Copilot Chat in VS Code as a Custom Endpoint: one prepaid key, any chat model on the Models page, billed per token with no subscription.

GitHub Copilot Chat in VS Code accepts your own model key. Its **Custom Endpoint** provider connects any Chat Completions API, so one RelaySwitch key puts Claude, GPT, DeepSeek, Kimi and GLM in the model picker, each at the per-token price on its [model page](https://relayswitch.io/models). You top up by card or crypto and pay as you go; there is no Copilot plan to buy and no GitHub sign-in needed for these models.

This guide fills the whole `chatLanguageModels.json` entry from the live catalog, including the context and output limits VS Code asks for, then prices a sample agent session on each model so you can pick one on cost.

## 01What you need

-   VS Code with the GitHub Copilot Chat extension and the Chat view open. This guide follows the VS Code docs; other editors have their own Copilot plugins and settings.
-   A RelaySwitch key. Sign in with an email code at the [console](https://app.relayswitch.io/console). Keys start with `sk-relay-`.
-   A balance. Top-ups start at $10, by card or crypto, with no subscription and no KYC. Before the first top-up the console chat gives you 12 free turns a day to try models; Copilot requests bill the balance.
-   On a Copilot Business or Enterprise seat, the organisation admin must leave the "Bring Your Own Language Model Key in VS Code" policy on. Individual users need no plan at all.

## 02Add RelaySwitch as a Custom Endpoint

1.  In the Chat view, open the model picker and select **Manage Language Models** (the gear icon), or run **Chat: Manage Language Models** from the Command Palette.
2.  Select **Add Models**, then **Custom Endpoint**. It replaced the older OpenAI Compatible provider, so pick it even if you have used the old one before.
3.  Name the group **RelaySwitch**, choose the API type **Chat Completions**, and paste your key when VS Code asks for it. The key is sent as a Bearer token, so no extra request headers are needed.
4.  VS Code opens `chatLanguageModels.json` with the entry it just made. Replace its `models` list with the one in the block below, keep the `apiKey` line VS Code wrote, and save.
5.  Open the picker again. The RelaySwitch group lists each model by its `name`. If it is missing, restart VS Code once; the docs note some models appear only after a restart.

json

1`[`

2 `{`

3 `"name": "RelaySwitch",`

4 `"vendor": "customendpoint",`

5 `"apiKey": "${input:relayswitchApiKey}",`

6 `"apiType": "chat-completions",`

7 `"models": [`

8 `{`

9 `"id": "claude-sonnet-5-5",`

10 `"name": "Claude Sonnet 5.5",`

11 `"url": "https://api.relayswitch.io/v1/chat/completions",`

12 `"toolCalling": true,`

13 `"vision": true,`

14 `"contextWindow": 1000000,`

15 `"maxOutputTokens": 128000`

16 `},`

17 `{`

18 `"id": "claude-opus-5-5",`

19 `"name": "Claude Opus 5.5",`

20 `"url": "https://api.relayswitch.io/v1/chat/completions",`

21 `"toolCalling": true,`

22 `"vision": true,`

23 `"contextWindow": 1000000,`

24 `"maxOutputTokens": 128000`

25 `},`

26 `{`

27 `"id": "gpt-5.5",`

28 `"name": "GPT-5.5",`

29 `"url": "https://api.relayswitch.io/v1/chat/completions",`

30 `"toolCalling": true,`

31 `"vision": true,`

32 `"contextWindow": 1050000,`

33 `"maxOutputTokens": 128000`

34 `},`

35 `{`

36 `"id": "gpt-6.1-sol",`

37 `"name": "GPT-6.1 Sol",`

38 `"url": "https://api.relayswitch.io/v1/chat/completions",`

39 `"toolCalling": true,`

40 `"vision": true,`

41 `"contextWindow": 1050000,`

42 `"maxOutputTokens": 128000`

43 `},`

44 `{`

45 `"id": "deepseek-v4-pro-0813",`

46 `"name": "DeepSeek V4 Pro 0813",`

47 `"url": "https://api.relayswitch.io/v1/chat/completions",`

48 `"toolCalling": true,`

49 `"vision": false,`

50 `"contextWindow": 1048576,`

51 `"maxOutputTokens": 393216`

52 `},`

53 `{`

54 `"id": "kimi-k2.7-code",`

55 `"name": "Kimi K2.7 Code",`

56 `"url": "https://api.relayswitch.io/v1/chat/completions",`

57 `"toolCalling": true,`

58 `"vision": true,`

59 `"contextWindow": 262144,`

60 `"maxOutputTokens": 131072`

61 `},`

62 `{`

63 `"id": "glm-5.3",`

64 `"name": "GLM 5.3",`

65 `"url": "https://api.relayswitch.io/v1/chat/completions",`

66 `"toolCalling": true,`

67 `"vision": false,`

68 `"contextWindow": 1000000,`

69 `"maxOutputTokens": 131072`

70 `}`

71 `]`

72 `}`

73`]`

The `apiKey` value is an input variable such as `${input:relayswitchApiKey}`, as the docs recommend, so the file holds no raw key. Field names and the menu path follow the [VS Code language models docs](https://code.visualstudio.com/docs/copilot/customization/language-models) (read 2026-10-28).

## 03What each field does

VS Code reads the numbers for its own bookkeeping: how full a session is and when to trim it. Billing does not read them; every request bills at the live catalog price.

| id | contextWindow | maxOutputTokens | vision | Input | Output |
| --- | --- | --- | --- | --- | --- |
| `claude-sonnet-5-5` | 1,000,000 | 128,000 | true | $1.20 | $3.00 |
| `claude-opus-5-5` | 1,000,000 | 128,000 | true | $2.716 | $9.70 |
| `gpt-5.5` | 1,050,000 | 128,000 | true | $1.80 | $9.00 |
| `gpt-6.1-sol` | 1,050,000 | 128,000 | true | $0.582 | $2.91 |
| `deepseek-v4-pro-0813` | 1,048,576 | 393,216 | false | $0.792 | $1.188 |
| `kimi-k2.7-code` | 262,144 | 131,072 | true | $0.426 | $1.7936 |
| `glm-5.3` | 1,000,000 | 131,072 | false | $0.3178 | $0.9987 |

Prices in USD per million tokens, read from the live catalog when this page was built. Limits come from the developer pages the catalog records.

-   **url**: the full endpoint, `https://api.relayswitch.io/v1/chat/completions`. VS Code uses a URL with an explicit path as is; given only a base URL it would append the path for the API type itself.
-   **toolCalling**: must be `true` for a model to show up in agent mode. The block sets it on every model.
-   **vision**: `true` only where the model page lists image input. A text-only model cannot read a pasted screenshot.
-   **contextWindow** and **maxOutputTokens**: VS Code derives `maxInputTokens` as the difference. Setting the window higher than the model accepts lets a long session grow until a request fails as too long. Where a model's output limit is as large as its window, the block sets half the window so input keeps room.
-   **chat.utilityModel** and **chat.utilitySmallModel**: without a GitHub sign-in, point these settings at one of your RelaySwitch models so titles, summaries and commit messages keep working.

## 04Check the key before Copilot

Two curl calls rule out the key and the endpoint before you debug VS Code itself. The first lists every model id your key can call:

bash

1`curl https://api.relayswitch.io/v1/models -H "Authorization: Bearer sk-relay-..."`

The second sends one small request the way Copilot Chat does. `-i` prints the headers, including the request id and, on a non-streamed answer, the charge in USD.

bash

1`curl -i https://api.relayswitch.io/v1/chat/completions \`

2 `-H "Authorization: Bearer sk-relay-..." \`

3 `-H "Content-Type: application/json" \`

4 `-d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Say ok."}]}'`

If both work, any failure left is in the JSON file. Send a message in Copilot Chat and the request shows on the console's Usage page within seconds, with its tokens and its charge.

## 05Which model to pick

Agent mode resends the conversation, the files it read and the tool results on every turn, so input tokens are most of the bill. A low input price matters more than a low output price. Of the models here, GLM 5.3 has the lowest input rate today at $0.3178 per million tokens.

| Model | Input | Cached | Output | Developer list in / out | Context |
| --- | --- | --- | --- | --- | --- |
| [Claude Sonnet 5.5](https://relayswitch.io/models/claude-sonnet-5-5) | $1.20 (40% under) | $0.075 | $3.00 (70% under) | $2.00 / $10.00 | 1M tokens |
| [Claude Opus 5.5](https://relayswitch.io/models/claude-opus-5-5) | $2.716 (32% under) | $0.1455 | $9.70 (51% under) | $4.00 / $20.00 | 1M tokens |
| [GPT-5.5](https://relayswitch.io/models/gpt-5.5) | $1.80 (64% under) | $0.16 | $9.00 (70% under) | $5.00 / $30.00 | 1.1M tokens |
| [GPT-6.1 Sol](https://relayswitch.io/models/gpt-6.1-sol) | $0.582 (70% under) | $0.0582 | $2.91 (70% under) | $2.00 / $10.00 | 1.1M tokens |
| [DeepSeek V4 Pro 0813](https://relayswitch.io/models/deepseek-v4-pro-0813) | $0.792 (40% under) | $0.0625 | $1.188 (70% under) | $1.32 / $3.96 | 1M tokens |
| [Kimi K2.7 Code](https://relayswitch.io/models/kimi-k2.7-code) | $0.426 (55% under) | $0.0852 | $1.7936 (55% under) | $0.95 / $4.00 | 262K tokens |
| [GLM 5.3](https://relayswitch.io/models/glm-5.3) | $0.3178 (70% under) | $0.066 | $0.9987 (70% under) | $1.092 / $3.432 | 1M tokens |

USD per million tokens, read from the RelaySwitch catalog when this page was built. Developer list: the catalog's record of the developer's own price.

The Claude ids answer the Chat Completions format, so Claude Sonnet and Opus work in this provider with the same API type as the rest. For the full list, with every price and context size, see the [Models page](https://relayswitch.io/models). How the balance and the cached rate work is on [Pricing](https://relayswitch.io/pricing).

## 06What an agent session costs

The task: one feature built over 40 agent-mode turns, late enough in the session that the context is large. Each turn sends 80,000 tokens of earlier context, 2,000 new input tokens, and gets 1,500 output tokens back. Those sizes are an assumption; your own Usage page shows the real ones.

| Model | Context from cache | No cache hits |
| --- | --- | --- |
| [GLM 5.3](https://relayswitch.io/models/glm-5.3) | $0.2964 | $1.10 |
| [DeepSeek V4 Pro 0813](https://relayswitch.io/models/deepseek-v4-pro-0813) | $0.3346 | $2.67 |
| [GPT-6.1 Sol](https://relayswitch.io/models/gpt-6.1-sol) | $0.4074 | $2.08 |
| [Kimi K2.7 Code](https://relayswitch.io/models/kimi-k2.7-code) | $0.4143 | $1.50 |
| [Claude Sonnet 5.5](https://relayswitch.io/models/claude-sonnet-5-5) | $0.516 | $4.12 |
| [GPT-5.5](https://relayswitch.io/models/gpt-5.5) | $1.20 | $6.44 |
| [Claude Opus 5.5](https://relayswitch.io/models/claude-opus-5-5) | $1.26 | $9.49 |

40 turns at the live per-token prices. A model with no cached rate bills cached tokens at its input rate.

Two columns, because whether the earlier context hits the prompt cache depends on the model and the request. When it does, the response reports cached tokens and they bill at the cached rate. The console's Usage page shows the split for every request.

The spread is wide. With cache hits the same session runs $0.2964 on GLM 5.3 and $1.26 on Claude Opus 5.5. Keeping both in the group and switching in the picker between routine edits and the hard step is a reasonable split.

## 07Errors and fixes

-   `401`: the key is wrong, revoked or cut short. Run the Manage Language Models flow again, paste the key from the console, and repeat the curl check.
-   `402`: the balance is too low for the request. Top up in the console; the key works again at once.
-   `404`: the `id` is not in the catalog. Check for a typo or a display name in the id field.
-   `429`: the key hit its rate limit. Wait a minute and resend, or create a key with a higher Requests / min in the console.
-   The group is in the file but not in the picker: the JSON has a syntax error, or VS Code needs a restart. The Problems panel flags the first.
-   A model is in the picker for Ask but not for Agent: `toolCalling` is missing or `false` on that entry.
-   Inline suggestions still come from GitHub, or stop without a sign-in: expected. Bring-your-own-key covers chat and utility tasks only; completions, semantic search and embeddings stay on GitHub's side.

## Questions

Can I use GitHub Copilot Chat without a Copilot subscription?

Yes, in VS Code. The docs say bring-your-own-key models work without a GitHub sign-in and without a Copilot plan. With a RelaySwitch key you pay per token from a prepaid balance instead, topped up by card or crypto.

What URL do I enter for the Custom Endpoint?

https://api.relayswitch.io/v1/chat/completions on each model, with apiType chat-completions. VS Code uses a URL with an explicit path as it is.

Do Claude models work through the Chat Completions API type?

Yes. The Claude ids on RelaySwitch answer the Chat Completions format, so the whole group uses one API type and one key.

Does my own key change inline code completions?

No. Bring-your-own-key applies to the chat experience and utility tasks. Inline suggestions, semantic search and embeddings still run through GitHub and need a GitHub account.

Why is a model missing from the picker in agent mode?

Agent mode lists only models with toolCalling set to true. Check that entry in chatLanguageModels.json, save, and restart VS Code if the picker still lags.

Related

-   [All guides](https://relayswitch.io/guides)
-   [Cline](https://relayswitch.io/guides/cline)
-   [Cursor](https://relayswitch.io/guides/cursor)
-   [Models and prices](https://relayswitch.io/models)
-   [How pricing works](https://relayswitch.io/pricing)
-   [Pay by card or crypto](https://relayswitch.io/pay-with-crypto)
-   [Docs](https://relayswitch.io/docs)

## Every chat model in Copilot

One key, prepaid from $10 by card or crypto. No KYC, no subscription.

[Models](https://relayswitch.io/models)[Get a key](https://app.relayswitch.io/console)

