# Hướng dẫn cấu hình GitHub Copilot

> Dùng BYOK của Copilot CLI hoặc ứng dụng Copilot để trỏ điểm cuối tùy chỉnh tương thích OpenAI sang LLMoxy.

Trang web: [https://github.com/features/copilot](https://github.com/features/copilot)

Tính năng hoàn thành mã của GitHub Copilot mặc định dùng mô hình do GitHub lưu trữ. Để chuyển yêu cầu sang LLMoxy, hãy dùng **BYOK** (tự mang Key). Về cửa sổ chat của VS Code, xem [Hướng dẫn cấu hình cửa sổ Agents VS Code](https://vi.llmoxy.com/docs/code-tutorials/vscode-agents).

Trước khi bắt đầu, hãy chuẩn bị một [mã thông báo LLMoxy](https://vi.llmoxy.com/docs/get-started/get-token), nên dùng nhóm **auto**. Mô hình cần hỗ trợ tool calling và đầu ra streaming.

## Copilot CLI

```bash
export COPILOT_PROVIDER_TYPE=openai
export COPILOT_PROVIDER_BASE_URL=https://llmoxy.com/v1
export COPILOT_PROVIDER_API_KEY=API Key LLMoxy của bạn
export COPILOT_MODEL=grok-4.7
copilot
```

| Biến | Giá trị |
| --- | --- |
| `COPILOT_PROVIDER_BASE_URL` | `https://llmoxy.com/v1` |
| `COPILOT_PROVIDER_API_KEY` | Mã thông báo LLMoxy |
| `COPILOT_MODEL` | ID chính xác trong bảng điều khiển |
| `COPILOT_PROVIDER_TYPE` | `openai` (mặc định) |

Dòng Claude có thể đổi thành:

```bash
export COPILOT_PROVIDER_TYPE=anthropic
export COPILOT_PROVIDER_BASE_URL=https://llmoxy.com
export COPILOT_PROVIDER_API_KEY=API Key LLMoxy của bạn
export COPILOT_MODEL=claude-opus-5-5
```

## Ứng dụng Copilot

1. Mở ứng dụng GitHub Copilot.
2. **Settings → Model Providers → Add provider**.
3. Chọn OpenAI-compatible (hoặc bất kỳ điểm cuối HTTP tương thích nào).
4. Điền Base URL là `https://llmoxy.com/v1`, dán API Key, rồi lưu.
5. Chọn mô hình vừa thêm trong bộ chọn mô hình của phiên.

Đây là bản markdown của https://vi.llmoxy.com/docs/code-tutorials/github-copilot.
