Use Xantly with GitHub Copilot CLI

Skip the $10/mo Copilot subscription. Four env vars and Copilot CLI routes through Xantly for smart model selection, semantic cache, and cost control, no GitHub auth required.

Skip the $10/mo Copilot subscription. Keep the agent. Own your tokens.

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.

Prerequisites

Setup

Export four environment variables and the Copilot CLI will route every request through Xantly instead of GitHub's proxy:

export COPILOT_PROVIDER_BASE_URL="https://api.xantly.com/v1"
export COPILOT_PROVIDER_API_KEY="sk-..."   # your Xantly key
export COPILOT_MODEL="xantly/auto-quality"         # or a specific model
export COPILOT_PROVIDER_TYPE="openai"              # Xantly speaks OpenAI-compatible

Drop those in your ~/.zshrc or ~/.bashrc to make them persistent.

Model choice

COPILOT_MODEL accepts any model ID from Xantly's catalog. Recommended:

SettingBehavior
xantly/auto-qualityBaRP routes from the most capable models (Claude Sonnet, GPT-5.x, etc.). Best for complex refactors.
xantly/auto-valuebalanced models, balanced cost/quality. Best default for daily use.
xantly/auto-speedLowest measured latency that still clears the quality bar. Best for git commit messages, quick edits.
bedrock/claude-sonnet-4-6/us-east-1Pin to a specific Anthropic model. Xantly honors it exactly, no re-routing.
bedrock/gpt-oss-120b-1/us-east-1Pin to OpenAI. Xantly passes through.

Run 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"

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.

What you get that stock Copilot CLI doesn't

Cost comparison

A developer running ~200 Copilot CLI requests/day on Copilot Pro at $10/mo pays flat regardless of usage. The same pattern through Xantly at smart routing:

You break even vs Copilot Pro around 30-50 requests/day. Power users routinely save 40-60%.

Troubleshooting

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.

Rate-limit errors from Xantly. Set COPILOT_MODEL=xantly/auto-speed to prefer the lowest-latency models, or upgrade your Xantly plan.

Model not found. Make sure the model ID is in 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