GitHub Copilot CLI
Run GitHub Copilot CLI on Blackfuel's open-source models via its bring-your-own-model endpoint — transparent per-token pricing, and an EU option
Blackfuel serves open-source models on an OpenAI Chat Completions-compatible API, with transparent per-token pricing and an EU option, and you choose which model runs and where. Blackfuel runs in GitHub Copilot CLI — GitHub's agentic command-line coding tool — through its bring-your-own-model configuration, which accepts any Chat Completions-compatible endpoint.
This is a separate setup from VS Code Copilot: the CLI is its own tool with its own configuration, so pointing it at Blackfuel is independent of anything you've configured in the editor — see Separate from VS Code Copilot.
What you get
| Benefit | Detail |
|---|---|
| Transparent pricing | Published per-token rates — you pay for the tokens each request uses. See Available Models. |
| Open-source models | Open-weight models for code generation, edits, and agentic work. |
| EU data residency | Models with an EU variant take a :eu suffix that keeps requests inside EU data centers. See Available Models. |
| Model portability | Switch models — or providers — by editing one environment variable. No lock-in. |
Recommended model
Copilot CLI requires a model that supports tool calling. Use the model ID (the id field) exactly as shown.
| Model | id | Use it for |
|---|---|---|
| MiniMax M2.5 | MiniMaxAI/MiniMax-M2.5 | Code generation and edits |
To use a different model, confirm its supported_parameters includes tools in GET /v1/models before pointing Copilot CLI at it.
Prerequisites
-
A Blackfuel API key (get one here) — it starts with
bf_. -
The
copilotCLI installed — see the Copilot CLI install guide. The quickest path is npm:npm install -g @github/copilot
Step 1: Get a Blackfuel API key
Create a key on the API Keys page of the Blackfuel console and copy it (it starts with bf_). Keep it handy — Step 2 reads it from an environment variable.
Step 2: Configure Copilot CLI
Copilot CLI's bring-your-own-model provider is configured through environment variables. Set these before launching copilot:
export BLACKFUEL_API_KEY=bf_mykey_xxxxxx
export COPILOT_PROVIDER_BASE_URL=https://api.blackfuel.ai/v1
export COPILOT_PROVIDER_API_KEY="$BLACKFUEL_API_KEY"
export COPILOT_MODEL=MiniMaxAI/MiniMax-M2.5
export COPILOT_PROVIDER_TYPE=openaiWhat each variable does:
| Variable | Purpose |
|---|---|
COPILOT_PROVIDER_BASE_URL | Routes Copilot CLI to Blackfuel's OpenAI-compatible endpoint. Include the /v1 suffix. |
COPILOT_PROVIDER_API_KEY | Your Blackfuel API key, sent as the bearer token. |
COPILOT_MODEL | The Blackfuel model ID to run. Swap in any model ID from Available Models that supports tool calling and streaming. |
COPILOT_PROVIDER_TYPE | openai for Blackfuel's Chat Completions endpoint. Optional — openai is the default. |
Persist the configuration
The export approach applies only to the current shell. To make it permanent, add the lines to your shell profile so they apply to every interactive session:
# ~/.bashrc or ~/.zshrc
export BLACKFUEL_API_KEY=bf_mykey_xxxxxx
export COPILOT_PROVIDER_BASE_URL=https://api.blackfuel.ai/v1
export COPILOT_PROVIDER_API_KEY="$BLACKFUEL_API_KEY"
export COPILOT_MODEL=MiniMaxAI/MiniMax-M2.5
export COPILOT_PROVIDER_TYPE=openaiReload it (source ~/.bashrc) or open a new terminal before launching copilot.
Your Blackfuel key is a secret. Keep it out of shared dotfiles repositories, or load it from a secrets manager instead of hardcoding it.
Step 3: Run
copilotYou're now in an interactive Copilot CLI session backed by Blackfuel, with every model request going to the model ID in COPILOT_MODEL.
Separate from VS Code Copilot
Copilot CLI and the VS Code Copilot extension are different tools with independent configuration. The CLI is driven by the COPILOT_PROVIDER_* environment variables above and keeps its own settings and authentication; the VS Code extension stores its Custom Endpoint provider in the editor's own configuration. Setting up one does not change the other.
This cookbook configures the CLI. To run Blackfuel inside VS Code Copilot Chat instead, follow VS Code Copilot.
Tips
- Switch models: change
COPILOT_MODELto any model ID from Available Models whosesupported_parametersincludestoolsand that streams. Append:eufor EU data residency where the model supports it. - Verify the model is live: call
GET /v1/modelsto confirm the model ID before pointing Copilot CLI at it.
Troubleshooting
| Symptom | Fix |
|---|---|
401 Unauthorized | COPILOT_PROVIDER_API_KEY is missing, wrong, or revoked. Re-check the key in the console. |
404 model not found | COPILOT_MODEL doesn't match a live model ID. Confirm it via GET /v1/models. |
429 | Expected on busy sessions. Back off and retry; see the Error Handling guide. |
| Model errors out on tool calling or streaming | The chosen model ID must support both. Switch to a model that does — MiniMaxAI/MiniMax-M2.5 works. |
| Requests not reaching Blackfuel | COPILOT_PROVIDER_BASE_URL is unset or wrong. Set it to exactly https://api.blackfuel.ai/v1. |
For the full list of error types and retry guidance, see the Error Handling guide.
Next steps
- Available Models — full catalog, pricing, and EU variants
- VS Code Copilot — the same Blackfuel models inside VS Code Copilot Chat
- Claude Code — drive Anthropic's CLI agent with Blackfuel
- Chat Completions — full endpoint reference