2026 年 6 月,Github Copilot 的计费方式从原来的按请求次数收费变成了按 Token 消耗量收费。并且不再提供任何免费模型。

这一计费方式的改变使得 Github Copilot 的使用成本大幅增加,对于重度使用者经常可以一天就消耗掉一个月的使用额度。

Token 焦虑时代正式来临。

本文介绍如何在 VS Code 中使用 Github Copilot 对接现有的免费模型 API。

In June 2026, GitHub Copilot’s billing model changed from charging per request to charging by token consumption. It also stopped offering any free models.

This billing change dramatically increased the cost of using GitHub Copilot — heavy users can easily burn through a month’s quota in a single day.

The era of token anxiety has officially arrived.

This article explains how to connect GitHub Copilot to existing free model APIs in VS Code.

Github Copilot 添加 Opencode 免费模型 API

请保证你的 Github Copilot 账号是免费账号或者个人订阅,企业订阅的账号个人是无法添加自定义模型的。

  1. 打开 VS Code 中的 Copilot 聊天对话框,点击 Auto 进入模型切换界面,然后点击设置图标。

  1. 在弹出的对话框中点击 Add Models,然后选择 Custom Endpoint。

  1. Group Name 可以随便填,我这里输入 “opencode”。

  1. API Key 需要填入 public

  1. API 类型选择 OpenAI Chat Completions。

  1. 最后在打开的 json 文件中,修改 models 数组为下面的内容。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"models": [
{
"id": "deepseek-v4-flash-free",
"name": "deepseek-v4-flash-free",
"url": "https://opencode.ai/zen/v1/chat/completions",
"toolCalling": true,
"vision": false,
"contextWindow": 1000000,
"thinking": true,
"reasoningEffortFormat": "chat-completions",
"supportsReasoningEffort": [
"low",
"high",
"max"
],
"maxInputTokens": 500000,
"maxOutputTokens": 500000
},
{
"id": "mimo-v2.5-free",
"name": "mimo-v2.5-free",
"url": "https://opencode.ai/zen/v1/chat/completions",
"toolCalling": true,
"vision": true,
"contextWindow": 1000000,
"thinking": true,
"reasoningEffortFormat": "chat-completions",
"supportsReasoningEffort": [
"low",
"high",
"max"
],
"maxInputTokens": 500000,
"maxOutputTokens": 500000
},
{
"id": "nemotron-3-ultra-free",
"name": "nemotron-3-ultra-free",
"url": "https://opencode.ai/zen/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 500000,
"maxOutputTokens": 500000
}

Github Copilot 添加 Nvidia 免费模型 API

Nvidia 也开放了一些免费的模型 API 调用,但它不是完全公开的,需要注册并获取 API Key 后才能使用。

听说最近中国用户在注册过程中可能会出现手机号验证的麻烦,但我没有遇到什么困难。

  1. 访问 https://build.nvidia.com/settings/api-keys

  2. 注册账号并登录(可能需要验证手机号)

  3. 点击 “Create API Key” 按钮,填写一个名字并选择一个过期时间即可。保存好生成的 API Key,它只会显示一次。

接下来需要按照上一节中描述的方式再添加 Nvidia 的模型 API,API Key 需要填入刚刚生成的那个字符串。

在最后一步修改 json 文件中的 models 数组为下面的内容:

1
2
3
4
5
6
7
8
9
10
11
"models": [
{
"id": "minimaxai/minimax-m2.7",
"name": "minimaxai/minimax-m2.7",
"url": "https://integrate.api.nvidia.com/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 128000,
"maxOutputTokens": 128000
}
]

Nvidia 的免费模型 API 有很多,但目前的使用体验不如 Opencode 的免费模型 API 流畅,并且不是所有模型都兼容 Github Copilot 的调用方式,我测试的可用的是 minimaxai/minimax-m2.7 这个模型。
所有免费可用的模型列表可以在 https://build.nvidia.com/models 中查看。

希望这篇文章能帮助大家在 Token 焦虑时代继续愉快地使用 Github Copilot!

Adding the Opencode Free Model API to GitHub Copilot

Make sure your GitHub Copilot account is a free account or a personal subscription — individuals cannot add custom models to enterprise subscription accounts.

  1. Open the Copilot chat dialog in VS Code, click Auto to enter the model switcher, then click the settings icon.

  1. In the dialog that pops up, click Add Models, then choose Custom Endpoint.

  1. The Group Name can be anything — I entered “opencode”.

  1. For the API Key, enter public.

  1. Set the API type to OpenAI Chat Completions.

  1. Finally, in the json file that opens, change the models array to the content below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"models": [
{
"id": "deepseek-v4-flash-free",
"name": "deepseek-v4-flash-free",
"url": "https://opencode.ai/zen/v1/chat/completions",
"toolCalling": true,
"vision": false,
"contextWindow": 1000000,
"thinking": true,
"reasoningEffortFormat": "chat-completions",
"supportsReasoningEffort": [
"low",
"high",
"max"
],
"maxInputTokens": 500000,
"maxOutputTokens": 500000
},
{
"id": "mimo-v2.5-free",
"name": "mimo-v2.5-free",
"url": "https://opencode.ai/zen/v1/chat/completions",
"toolCalling": true,
"vision": true,
"contextWindow": 1000000,
"thinking": true,
"reasoningEffortFormat": "chat-completions",
"supportsReasoningEffort": [
"low",
"high",
"max"
],
"maxInputTokens": 500000,
"maxOutputTokens": 500000
},
{
"id": "nemotron-3-ultra-free",
"name": "nemotron-3-ultra-free",
"url": "https://opencode.ai/zen/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 500000,
"maxOutputTokens": 500000
}

Adding the Nvidia Free Model API to GitHub Copilot

Nvidia has also opened up some free model API calls, but they aren’t fully public — you need to register and obtain an API Key before you can use them.

I’ve heard that Chinese users may run into phone number verification trouble during registration recently, but I didn’t have any difficulties.

  1. Visit https://build.nvidia.com/settings/api-keys

  2. Register an account and log in (phone number verification may be required)

  3. Click the “Create API Key” button, enter a name and choose an expiration time. Save the generated API Key — it is only shown once.

Next, add Nvidia’s model API following the steps described in the previous section, and fill in the API Key with the string you just generated.

In the final step, change the models array in the json file to the content below:

1
2
3
4
5
6
7
8
9
10
11
"models": [
{
"id": "minimaxai/minimax-m2.7",
"name": "minimaxai/minimax-m2.7",
"url": "https://integrate.api.nvidia.com/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 128000,
"maxOutputTokens": 128000
}
]

Nvidia has many free model APIs, but their current user experience isn’t as smooth as Opencode’s free model APIs, and not all models are compatible with GitHub Copilot’s calling convention. The one I tested and found usable is the minimaxai/minimax-m2.7 model.
The list of all free available models can be viewed at https://build.nvidia.com/models.

Hope this article helps everyone keep enjoying GitHub Copilot in the era of token anxiety!