GitHub Copilot routing

GitHub Copilot router for subscription-authorized coding agents

Use Sage Router as the policy layer around GitHub Copilot-compatible endpoints. Keep GITHUB_COPILOT_TOKEN under your custody, expose one OpenAI-compatible endpoint to agents, and fail over to other authorized coding routes when a token, model, or provider path is unhealthy.

Create API key Read quickstart Codex setup Coding agents

Copilot token custody

Configure GitHub Copilot as an authorized provider route using your own GITHUB_COPILOT_TOKEN. Sage Router does not grant unauthorized GitHub Copilot access or bypass GitHub subscription terms.

OpenAI-compatible setup

Point Codex, Cursor, Aider, Continue, OpenHands, and OpenAI SDK clients at https://api.sagerouter.dev/v1 while the router chooses Copilot-compatible, OpenAI, Anthropic, Gemini, Ollama, NVIDIA NIM, or private routes by policy.

429 failover

When a Copilot token, model route, or fallback provider rate-limits, Sage Router can choose another eligible authorized route instead of making every coding agent own failover logic.

60-second GitHub Copilot setup

export OPENAI_BASE_URL=https://api.sagerouter.dev/v1
export OPENAI_API_KEY=sk_sage_your_generated_key
export GITHUB_COPILOT_TOKEN=ghu_your_authorized_token

curl "$OPENAI_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sage-router/agentic",
    "messages": [{"role": "user", "content": "Use Copilot-compatible routing if it is the best healthy authorized coding route"}]
  }'

Credential load balancing

Credential pools can distribute traffic across authorized tokens and fail over when one route is exhausted, revoked, rate-limited, or unhealthy.

Multimodal safeguards

Image, audio, video, and document inputs route only to capable models, so coding profiles do not send multimodal work to incompatible text-only routes.

Route telemetry

Hosted routing records privacy-safe activation and route metadata so operators can see which authorized path served a request without exposing tokens.

Why route Copilot-compatible traffic?

Copilot is useful inside coding workflows, but production agent stacks still need key custody, 429 failover, route observability, local Ollama escape hatches, multimodal capability gates, and one endpoint for every tool. Sage Router keeps Copilot-compatible routes in the matrix without making them the only path.

Next steps

Create an API key, copy the hosted quickstart, configure Codex, or estimate routing fit.