Use Xantly with GitHub Copilot CLI
Skip the
Skip the On April 7, 2026, GitHub shipped BYOK support for the Copilot CLI, four environment variables and no GitHub auth required. Point them at Xantly and you get Copilot's coding agent with Xantly's routing, semantic cache, and memory underneath. Your tokens, your margins, no subscription on top. This is the cleanest "escape hatch" integration in the ecosystem right now. 2-minute setup. Export four environment variables and the Copilot CLI will route every request through Xantly instead of GitHub's proxy: Drop those in your Run The CLI will call Xantly, which routes to a cost-optimal model, returns the answer, and logs the request in your Xantly dashboard. Open the dashboard, you'll see the request, the model it landed on, the cache status, and the cost in USD. A developer running ~200 Copilot CLI requests/day on Copilot Pro at You break even vs Copilot Pro around 30-50 requests/day. Power users routinely save 40-60%. Rate-limit errors from Xantly. Set Model not found. Make sure the model ID is in Prerequisites
gh extension install github/gh-copilot (requires the gh CLI)Setup
export COPILOT_PROVIDER_BASE_URL="https://api.xantly.com/v1"
export COPILOT_PROVIDER_API_KEY="xantly_sk_..." # your Xantly key
export COPILOT_MODEL="xantly/auto-quality" # or a specific model
export COPILOT_PROVIDER_TYPE="openai" # Xantly speaks OpenAI-compatible
~/.zshrc or ~/.bashrc to make them persistent.Model choice
COPILOT_MODEL accepts any model ID from Xantly's catalog. Recommended:Setting Behavior xantly/auto-qualityBaRP routes from the T1 pool (Claude Sonnet, GPT-5.x, etc.). Best for complex refactors. xantly/auto-valueT2 pool, balanced cost/quality. Best default for daily use. xantly/auto-speedT3 pool, fastest, cheapest. Best for git commit messages, quick edits.anthropic/claude-sonnet-4.6Pin to a specific Anthropic model. Xantly honors it exactly, no re-routing. openai/gpt-5.4Pin to OpenAI. Xantly passes through. curl https://api.xantly.com/v1/models -H "Authorization: Bearer $COPILOT_PROVIDER_API_KEY" to see the full live catalog.Verify
gh copilot suggest "a command that finds all files larger than 1MB"
What you get that stock Copilot CLI doesn't
gh copilot suggest with slight variations) hit L1/L2 cache and return instantly at near-zero cost.X-Xantly-Memory-Mode: recall.Cost comparison
xantly/auto-speed (cents/day)xantly/auto-valuexantly/auto-qualityTroubleshooting
COPILOT_PROVIDER_BASE_URL is ignored. Make sure you're on gh copilot version 1.4.0+ (released April 7, 2026). Run gh copilot --version to check.COPILOT_MODEL=xantly/auto-speed to get into the high-throughput T3 pool, or upgrade your Xantly plan.GET /v1/models. The CLI doesn't pre-validate; Xantly returns 400 with the list of valid IDs if you typo a slug.Next steps
X-Xantly-Intelligence-Mode header.