docs/copilot.md
Copilot uses GitHub OAuth device flow and the Copilot internal usage API. No browser cookies.
GitHub OAuth device flow (user initiated)
POST https://github.com/login/device/codePOST https://github.com/login/oauth/access_tokenenterpriseHost in ~/.codexbar/config.json or the provider settings UIhttps://octocorp.ghe.com/login to octocorp.ghe.comhttps://<enterpriseHost>/login/...read:user.~/.codexbar/config.json → providers[].apiKey for copilotproviders[].tokenAccountsUsage fetch
GET https://api.github.com/copilot_internal/userapi.<enterpriseHost>.Authorization: token <github_oauth_token>Accept: application/jsonEditor-Version: vscode/1.96.2Editor-Plugin-Version: copilot-chat/0.26.7User-Agent: GitHubCopilotChat/0.26.7X-Github-Api-Version: 2025-04-01quotaSnapshots.premiumInteractions percent remaining → used percent.quotaSnapshots.chat percent remaining → used percent.copilotPlan.Sources/CodexBarCore/Providers/Copilot/CopilotUsageFetcher.swiftSources/CodexBarCore/Providers/Copilot/CopilotDeviceFlow.swiftSources/CodexBar/Providers/Copilot/CopilotLoginFlow.swiftSources/CodexBar/CopilotTokenStore.swift (legacy migration helper)