# 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://llmoxy.com/docs/code-tutorials/vscode-agents)。

开始前准备一把 [LLMoxy 令牌](https://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://llmoxy.com/docs/code-tutorials/github-copilot 的 markdown 版本。
