# GitHub Copilot 設定指南

> 用 Copilot CLI 或 Copilot 應用程式的 BYOK，把自訂 OpenAI 相容端點指向 LLMoxy。

網址：[https://github.com/features/copilot](https://github.com/features/copilot)

GitHub Copilot 補全預設走 GitHub 託管模型。要把請求導向 LLMoxy，請使用 **BYOK**（自帶 Key）。VS Code 聊天視窗見 [VS Code Agents 視窗設定教學](https://tw.llmoxy.com/docs/code-tutorials/vscode-agents)。

開始前請準備一把 [LLMoxy 權杖](https://tw.llmoxy.com/docs/get-started/get-token)，建議使用 **auto** 分組。模型需要支援 tool calling 和串流輸出。

## Copilot CLI

```bash
export COPILOT_PROVIDER_TYPE=openai
export COPILOT_PROVIDER_BASE_URL=https://llmoxy.com/v1
export COPILOT_PROVIDER_API_KEY=您的LLMoxy API Key
export COPILOT_MODEL=grok-4.7
copilot
```

| 變數 | 值 |
| --- | --- |
| `COPILOT_PROVIDER_BASE_URL` | `https://llmoxy.com/v1` |
| `COPILOT_PROVIDER_API_KEY` | LLMoxy 權杖 |
| `COPILOT_MODEL` | 控制檯中的準確 ID |
| `COPILOT_PROVIDER_TYPE` | `openai`（預設） |

Claude 系列可改為：

```bash
export COPILOT_PROVIDER_TYPE=anthropic
export COPILOT_PROVIDER_BASE_URL=https://llmoxy.com
export COPILOT_PROVIDER_API_KEY=您的LLMoxy API Key
export COPILOT_MODEL=claude-opus-5-5
```

## Copilot 應用程式

1. 開啟 GitHub Copilot 應用程式。
2. **Settings → Model Providers → Add provider**。
3. 選擇 OpenAI-compatible（或任意相容 HTTP 端點）。
4. Base URL 填入 `https://llmoxy.com/v1`，貼上 API Key，保存。
5. 在會話的模型選擇器中選擇剛新增的模型。

本文是 https://tw.llmoxy.com/docs/code-tutorials/github-copilot 的 markdown 版本。
