BLACKFUEL
Cookbooks

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

BenefitDetail
Transparent pricingPublished per-token rates — you pay for the tokens each request uses. See Available Models.
Open-source modelsOpen-weight models for code generation, edits, and agentic work.
EU data residencyModels with an EU variant take a :eu suffix that keeps requests inside EU data centers. See Available Models.
Model portabilitySwitch models — or providers — by editing one environment variable. No lock-in.

Copilot CLI requires a model that supports tool calling. Use the model ID (the id field) exactly as shown.

ModelidUse it for
MiniMax M2.5MiniMaxAI/MiniMax-M2.5Code 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

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=openai

What each variable does:

VariablePurpose
COPILOT_PROVIDER_BASE_URLRoutes Copilot CLI to Blackfuel's OpenAI-compatible endpoint. Include the /v1 suffix.
COPILOT_PROVIDER_API_KEYYour Blackfuel API key, sent as the bearer token.
COPILOT_MODELThe Blackfuel model ID to run. Swap in any model ID from Available Models that supports tool calling and streaming.
COPILOT_PROVIDER_TYPEopenai 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=openai

Reload 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

copilot

You'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_MODEL to any model ID from Available Models whose supported_parameters includes tools and that streams. Append :eu for EU data residency where the model supports it.
  • Verify the model is live: call GET /v1/models to confirm the model ID before pointing Copilot CLI at it.

Troubleshooting

SymptomFix
401 UnauthorizedCOPILOT_PROVIDER_API_KEY is missing, wrong, or revoked. Re-check the key in the console.
404 model not foundCOPILOT_MODEL doesn't match a live model ID. Confirm it via GET /v1/models.
429Expected on busy sessions. Back off and retry; see the Error Handling guide.
Model errors out on tool calling or streamingThe chosen model ID must support both. Switch to a model that does — MiniMaxAI/MiniMax-M2.5 works.
Requests not reaching BlackfuelCOPILOT_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

On this page