Skip to main content

GitHub Copilot Provider (Deprecated)

Access GitHub Copilot models via OAuth Device Code flow for existing local setups. This provider is now a deprecated compatibility path.
GitHub usage-based Copilot billing begins June 1, 2026. Existing CCS Copilot setups remain available for compatibility, but new setups should prefer Codex or another active provider.

Compatibility Quick Start

Authentication

Device Code Flow

GitHub Copilot uses Device Code flow instead of browser OAuth - ideal for headless servers and remote machines.
1

First Run

Run ccs ghcp "your prompt"
2

Device Code Displayed

CCS displays verification URL and user code
3

Manual Authorization

Open URL in any browser, enter code manually
4

Token Received

CCS polls GitHub API, receives OAuth token when authorized
5

Token Cached

Token saved to ~/.ccs/cliproxy/auth/ghcp-{oauth}-{profile_id}.json
Available since v7.37.1 - Device code and verification URL are also displayed in the CCS Dashboard for convenient access during authentication.
Dashboard Display:
  • Device code shown with copy button
  • Verification URL as clickable link
  • 15-minute expiration timer countdown
  • Auto-refresh on successful authorization

Device Code vs Browser OAuth

GHCP uses Device Code flow because GitHub Copilot OAuth does not support callback servers.

Authentication Commands

Complete authorization in any browser on any device - CCS polls GitHub API for token.

Multi-Account Support

GitHub Copilot supports multiple accounts with filename-based identification:

Account Identification

Pattern: ghcp-{oauth}-{profile_id}.json{oauth}-{profile_id} Example:
  • Token file: ghcp-github-ABC123.json
  • Account ID: github-ABC123
  • Nickname: Auto-generated or custom via --nickname

Account Commands

Configuration

Config Keys

Configure via ~/.ccs/config.yaml:

Account Types

Set account type:

Rate Limiting

GitHub Copilot has rate limits - configure behavior on limit:
Behavior: CCS waits until rate limit resets, then retriesUse Case: Long-running sessions, non-interactive scripts
Custom Rate Limit Threshold:

Environment Variables

Auto-managed by CCS. Manual override rarely needed.

Commands Reference

Basic Usage

Authentication Commands

Account Management

Troubleshooting

Improved OAuth Failure Diagnostics

Available since v7.51.0
CCS now provides specific, actionable error messages when GitHub Copilot OAuth fails — instead of generic “Token not found” errors. Before v7.51: All auth failures showed Token not found After v7.51: Specific errors surfaced from GitHub’s OAuth flow: CCS strips ANSI escape codes and parses multi-line stderr from the GitHub OAuth flow, so errors from nested processes are surfaced cleanly in the terminal.

Device Code Expired

Symptom: “Device code expired” error during authorization Cause: User didn’t complete authorization within 15 minutes Solution: Re-run --auth to get new code:

Rate Limit Exceeded

Symptom: 429 Too Many Requests error Cause: Exceeded GitHub Copilot rate limit Solution 1: Wait for rate limit reset (if wait_on_limit: true) Solution 2: Configure wait behavior:
Solution 3: Increase rate limit threshold (Business accounts):

Wrong Account Type

Symptom: Unexpected rate limits or quota errors Cause: Account type mismatch (Individual vs Business) Solution: Set correct account type:

Token Refresh Failures

Symptom: “Unauthorized” errors after initial auth Cause: OAuth token expired, refresh failed Solution: Re-authenticate:

Storage Locations

Token Structure

GitHub Copilot OAuth token file format:
Filename Pattern: ghcp-{oauth}-{profile_id}.json Account Identification: Extracted from filename (no email field)

Device Code Flow Details

Authorization Flow

  1. CCS requests device code from GitHub API
  2. GitHub returns:
    • device_code (internal use)
    • user_code (user enters in browser)
    • verification_uri (URL to visit)
    • interval (polling frequency)
  3. User visits URL, enters code manually
  4. CCS polls GitHub API every interval seconds
  5. GitHub returns access token when user completes authorization
  6. CCS caches token to auth directory

Polling Behavior

  • Interval: 5 seconds (default from GitHub API)
  • Timeout: 15 minutes (device code expiry)
  • Retry: Stops on authorization or expiry

No Callback Server Needed

Device Code flow eliminates need for:
  • Local HTTP server
  • Port availability
  • Firewall configuration
  • Localhost access
Perfect for:
  • Headless servers
  • Remote SSH sessions
  • Docker containers
  • CI/CD pipelines

Rate Limiting Behavior

Rate Limit Detection

CLIProxyAPI detects rate limits via:
  • HTTP 429 status code
  • X-RateLimit-Remaining: 0 header
  • Retry-After header

Wait Strategy

When wait_on_limit: true:
  1. Detect rate limit (429 response)
  2. Read Retry-After header or calculate reset time
  3. Display wait message with countdown
  4. Sleep until reset (or user abort)
  5. Retry request automatically
User Experience:

Fail Fast Strategy

When wait_on_limit: false:
  1. Detect rate limit (429 response)
  2. Display error message with reset time
  3. Exit immediately with exit code 6 (PROVIDER_ERROR)
User Experience:

Quota Information

CCS tracks GitHub Copilot quota via ccs cliproxy quota and ccs copilot usage:
Reset period: Monthly (shown in ccs copilot usage output)

Cost Information

Rate Limits:
  • Individual: ~100 requests/hour
  • Business: ~200 requests/hour (configurable)
  • Exact limits set by GitHub, vary by account

Advanced Features

Model Mapping

GitHub Copilot models are configured from the CLIProxy provider editor:
  • Open ccs configCLIProxyGitHub Copilot (OAuth).
  • Use Model Config to set the default, Opus, Sonnet, and Haiku routes.
  • claude-sonnet-5 is the default recommended GHCP model.
  • If GitHub rolls out a model before CCS’s static fallback catalog updates, type the full model ID in the picker and select Custom model.
The selected IDs are written to ~/.ccs/ghcp.settings.json as standard ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_*_MODEL values.

Account Registry Integration

GHCP uses same multi-account system as other OAuth providers:
  • Accounts stored in ~/.ccs/cliproxy/accounts.json
  • Nicknames auto-generated from account ID
  • Default account tracked per provider
  • lastUsedAt timestamp for analytics

Session Persistence

GitHub Copilot sessions benefit from CLIProxy session persistence:
  • First ccs ghcp spawns proxy (1-2s startup)
  • Subsequent commands reuse existing proxy (instant)
  • Proxy terminates when last session exits
  • Version mismatch detection → auto-restart on upgrade

Next Steps

Multi-Account Setup

Manage multiple GitHub accounts

Rate Limiting

Configure rate limit behavior

Device Code Flow

Understand headless authentication

CLIProxy Config

Advanced CLIProxy settings