Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.routing.run/llms.txt

Use this file to discover all available pages before exploring further.

GitHub Copilot CLI supports custom model providers through BYOK environment variables. Point COPILOT_PROVIDER_BASE_URL at routing.run, set your dashboard rk_ key, and choose a route/… model ID.

Setup

1

Install Copilot CLI

Install the npm package that provides the copilot binary, then verify it is on your PATH.
2

Get your API key

Create an API key at app.routing.run. Copy the full secret. It starts with rk_.
3

Configure routing.run

Set the Copilot BYOK provider variables. Use https://api.routing.run/v1 because Copilot sends OpenAI-compatible chat requests.
4

Start Copilot

Run copilot. GitHub authentication is not required when COPILOT_PROVIDER_BASE_URL is set.

Connection prompt

Use Copy on the block below for a complete setup sequence.

Copilot CLI - connect to routing.run

Manual configuration

Install Copilot CLI with Bun:
bun add --global @github/copilot
copilot --version
For a single shell session, export the provider variables before you start Copilot:
export ROUTING_RUN_API_KEY='rk_REPLACE_ME'
export COPILOT_PROVIDER_BASE_URL='https://api.routing.run/v1'
export COPILOT_PROVIDER_API_KEY="$ROUTING_RUN_API_KEY"
export COPILOT_MODEL='route/deepseek-v4-pro'
export COPILOT_PROVIDER_MAX_PROMPT_TOKENS='500000'
export COPILOT_PROVIDER_MAX_OUTPUT_TOKENS='200000'

copilot
Copilot CLI reads custom provider settings from environment variables. Its normal config.json settings do not persist COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY, or the provider token limits.

Persistent setup without shell exports

If you do not want to keep provider exports in your shell profile, save them in a private env file and use a wrapper named copilot. Create ~/.copilot/provider.env:
COPILOT_PROVIDER_BASE_URL='https://api.routing.run/v1'
COPILOT_PROVIDER_API_KEY='rk_REPLACE_ME'
COPILOT_MODEL='route/deepseek-v4-pro'
COPILOT_PROVIDER_MAX_PROMPT_TOKENS='500000'
COPILOT_PROVIDER_MAX_OUTPUT_TOKENS='200000'
Protect the file:
chmod 600 ~/.copilot/provider.env
Then create a wrapper earlier on your PATH than the installed Copilot binary. For a Bun global install on Linux, this can be ~/.bun/bin/copilot:
#!/usr/bin/env bash
set -euo pipefail

provider_env="${COPILOT_HOME:-$HOME/.copilot}/provider.env"
if [[ -f "$provider_env" ]]; then
  set -a
  source "$provider_env"
  set +a
fi

exec /home/USER/.bun/install/global/node_modules/@github/copilot/npm-loader.js "$@"
Replace /home/USER with your home directory if needed. Make the wrapper executable:
chmod 700 ~/.bun/bin/copilot
copilot --version
Use route/deepseek-v4-pro for Copilot CLI coding sessions:
export COPILOT_MODEL='route/deepseek-v4-pro'
Published model IDs are listed on the models page. Exact access depends on your plan tier and dashboard settings.

Troubleshooting

  • Copilot asks for GitHub loginCOPILOT_PROVIDER_BASE_URL was not loaded before copilot started.
  • 401 or unauthorized — Confirm COPILOT_PROVIDER_API_KEY is a dashboard rk_ key.
  • Wrong host — Confirm COPILOT_PROVIDER_BASE_URL is exactly https://api.routing.run/v1.
  • Invalid model — Keep the full route/ prefix, for example route/deepseek-v4-pro.