Connect GitHub Copilot CLI
Launch GitHub Copilot CLI with an OpenAI-compatible provider, a service key and an explicit model selection.
https://aelder.dev/v1LOCAL CONFIGURATION
Let my agent set this up
Copy this task to an agent already running on your computer. Enter your API key locally when asked.
Help me connect GitHub Copilot CLI to AELDER using this guide: https://aelder.dev/docs/github-copilot-cli/
Service Base URL: https://aelder.dev/v1
First inspect my installed version, active profile and configuration. Explain any mismatch with the guide before changing anything.
Use the documented local configuration or CLI method. Do not automate the GUI, install software or change permissions without asking.
Preserve existing accounts, providers, models, defaults, permissions and unrelated settings. Propose the smallest change, show a redacted diff, and back up any files before editing.
Have me enter my API key locally using the tool's secret storage or an environment variable. Never ask me to paste a key into chat, print it, or include it in a command, diff, log or commit.
Use the exact model ID I choose from my account's model list. Do not invent model IDs or assume every model supports every API format or tool feature.
Validate syntax and configuration loading before making any generation request. If there is no dry-run, say so.
Explain any proposed paid test, the model and what it sends, and ask for approval before running it. Do not send project files or private conversation history as a test.
Finish with the settings changed, checks performed and steps to restore the backup.GitHub Copilot CLI supports external OpenAI-compatible providers through its BYOK settings. This guide is for the copilot terminal command, separate from VS Code’s built-in chat.
Choose an exact service model ID from our models endpoint. Copilot CLI requires streaming and tool calling. GitHub recommends a context window of at least 128k tokens; confirm the selected model’s actual limit rather than assuming it. See GitHub’s BYOK guide.
1. Check the installed configuration mode
Run:
copilot --version
copilot help providersThe recipe below uses the documented environment-variable mode. Current releases also support providers.json: a nonempty provider/model registry takes precedence over these provider variables. Its default location is ~/.copilot/providers.json, or the file selected by COPILOT_PROVIDERS_CONFIG under your configured Copilot home. If you already use that registry, preserve it and follow the registry workflow from your installed provider help instead of expecting environment variables to replace it. GitHub documents this precedence.
2. Launch with the service connection
For Bash or Zsh on macOS/Linux/WSL, copy this block into your local terminal. At the prompts, enter the Base URL above including /v1, your exact model ID and your service key:
printf 'Service Base URL: '
IFS= read -r SERVICE_API_BASE
printf 'Model ID: '
IFS= read -r SERVICE_MODEL_ID
printf 'Service API key: '
IFS= read -r -s SERVICE_API_KEY
printf '\n'
(
unset COPILOT_PROVIDER_BEARER_TOKEN COPILOT_PROVIDER_MODEL_ID
COPILOT_PROVIDER_TYPE=openai \
COPILOT_PROVIDER_BASE_URL="$SERVICE_API_BASE" \
COPILOT_PROVIDER_API_KEY="$SERVICE_API_KEY" \
COPILOT_PROVIDER_WIRE_API=completions \
COPILOT_PROVIDER_WIRE_MODEL="$SERVICE_MODEL_ID" \
copilot --model "$SERVICE_MODEL_ID"
)
unset SERVICE_API_BASE SERVICE_MODEL_ID SERVICE_API_KEYcompletions is the CLI’s Chat Completions wire format, using /chat/completions; it does not mean the legacy /completions endpoint. Keep the Base URL at /v1. WIRE_MODEL explicitly sends the exact service ID without a local provider prefix. The subshell clears inherited bearer-token and capability-model overrides for this launch. The API key is supplied without Bearer and is entered without becoming a literal command-history value. The CLI BYOK guide documents these variables, and GitHub’s BYOK protocol reference distinguishes the wire formats.
These values apply to this process. For repeated launches, use your secret manager and a local launcher rather than saving a plaintext key in a shell profile. Leave existing accounts, directory trust and tool permissions in place.
3. Verify the request
In the new session, ask:
Reply with CONNECTION_OK. Do not run tools or modify files.Check the reply and matching request in the service dashboard. Then test a small file read with normal approvals if you need agent tools. Each prompt uses API balance; provider help and saved settings do not prove authentication succeeded.
If the wrong provider is active, check registry precedence and other inherited COPILOT_PROVIDER_* variables. Unknown model limits can require explicit COPILOT_PROVIDER_MAX_PROMPT_TOKENS and COPILOT_PROVIDER_MAX_OUTPUT_TOKENS; use verified values only. Reasoning behavior and vendor-specific features still depend on the model and CLI implementation. See our API troubleshooting for service errors.
Need the key? Open your AELDER dashboard. For direct API calls, see the API reference.

