| summary | read_when | ||
|---|---|---|---|
Copilot provider data sources: GitHub device flow + Copilot internal usage API. |
|
Copilot uses GitHub OAuth device flow and the Copilot internal usage API. No browser cookies.
-
GitHub OAuth device flow (user initiated)
- Device code request:
POST https://github.com/login/device/code
- Token polling:
POST https://github.com/login/oauth/access_token
- Scope:
read:user. - Token stored in config:
~/.codexbar/config.json→providers[].apiKeyforcopilot
- Device code request:
-
Usage fetch
GET https://api.github.com/copilot_internal/user- Headers:
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-01
- Primary:
quotaSnapshots.premiumInteractionspercent remaining → used percent. - Secondary:
quotaSnapshots.chatpercent remaining → used percent. - Reset dates are not provided by the API.
- Plan label from
copilotPlan.
Sources/CodexBarCore/Providers/Copilot/CopilotUsageFetcher.swiftSources/CodexBarCore/Providers/Copilot/CopilotDeviceFlow.swiftSources/CodexBar/Providers/Copilot/CopilotLoginFlow.swiftSources/CodexBar/CopilotTokenStore.swift(legacy migration helper)