Copilot setup
GitHub Copilot CLI can connect to BRUCEAI through its OpenAI-compatible provider mode. You only need a few environment variables in the current terminal.
If you already have your own GitHub Copilot login, these variables only affect the copilot command in the current terminal session; close the window and you are back to your usual setup.
OpenAI, Grok and DeepSeek keys all work. The only difference is that COPILOT_MODEL must be a model id of the same provider as the key.
Copy these model IDs into config files, API request bodies, or any OpenAI-compatible client that asks for a model name. Each group needs the matching key type.
Prepare your API key
After signing in, open the API key page to create or copy a key. It looks like sk-or-v1-xxxxxxxxxxxx. Treat it like a password.
Create API keyCopilot uses the OpenAI-compatible interface, so this Base URL must include /v1.
Click Create API key, give it a name you will recognize, then pick the key type by the models you plan to call:
- OpenAI key
- Serves gpt-6.1-sol, gpt-6-astra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna and gpt-5.5. Works with Codex, GitHub Copilot and any OpenAI-compatible client.
- Grok key
- Serves grok-4.7, grok-4.6 and grok-4.5. Works with Grok Build, Codex and any OpenAI-compatible client.
- DeepSeek key
- Serves deepseek-v4.1-flash: 1M context, thinking mode, tool calling and image input. Works with Codex and any OpenAI-compatible client.
A key only serves its own provider's models. Sending a GPT model id with a Grok key, or a Grok id with an OpenAI key, is refused with a 400. Create one key per provider if you use several.
Do not share your API key with anyone, and do not commit it to GitHub, GitLab, or any public repository.
The commands below switch to the system you choose.
Install Copilot CLI
Run this only if Copilot CLI is not installed yet.
npm install -g @github/copilotConfigure and start with an OpenAI key
Replace sk-or-v1-your-key with your OpenAI key. COPILOT_MODEL can be any GPT model id; gpt-5.6-terra is a balanced default.
export COPILOT_PROVIDER_TYPE=openai
export COPILOT_PROVIDER_BASE_URL="https://api.bruceai.net/v1"
export COPILOT_PROVIDER_API_KEY="sk-or-v1-your-key"
export COPILOT_MODEL="gpt-5.6-terra"
copilotUse Grok or DeepSeek instead
Swap in a Grok key and set COPILOT_MODEL to grok-4.6 (or grok-4.7 / grok-4.5); with a DeepSeek key use deepseek-v4.1-flash. The key and the model id must belong to the same provider.
export COPILOT_PROVIDER_TYPE=openai
export COPILOT_PROVIDER_BASE_URL="https://api.bruceai.net/v1"
export COPILOT_PROVIDER_API_KEY="sk-or-v1-your-grok-key"
export COPILOT_MODEL="grok-4.6"
copilotTroubleshooting
401 / invalid token: make sure the key is complete, has no extra spaces, and starts with sk-or-v1-.
400 / unsupported_model: COPILOT_MODEL and the key belong to different providers, for example grok-4.6 with an OpenAI key.
Still using GitHub's own models: make sure all four variables are set in the same terminal window and COPILOT_PROVIDER_TYPE is openai.