GitHub Copilot API Developer Guide: Uptime, Metrics, and Agent Integration
An in-depth developer guide to the GitHub Copilot REST API. Learn how to manage seats programmatically, download daily usage metrics, orchestrate automated repository operations via the Agent Tasks API, and persist analytics in team workspaces.
Why developer teams need the GitHub Copilot REST API
While GitHub Copilot has grown to 4.7 million paid subscribers as of January 2026, enterprise administrators often manage licenses blindly without programmatically evaluating seat activity or developer metrics [Panto 2026 Developer Tooling Report]. The ability to programmatically query license usage, track seat assignments, and automate workflows through the REST API is where organizations find efficiency. Relying solely on IDE-level activity graphs or manual user surveys leads to inaccurate adoption reports and high license waste.
Understanding the API is critical for enterprise developers and team leaders. While individual software developers interact with the coding assistant as an editor extension inside their integrated development environments, organization and enterprise administrators use the official REST API to run the surrounding license lifecycle and metric monitoring operations.
The administration surface is divided into three primary categories:
- Seat Management: Programmatic seat allocations, cancellations, and user list retrieval.
- Usage Metrics: Daily utilization reports containing code acceptance rates and active developer counts.
- Agent Tasks: Direct control and monitoring of cloud-based coding agents executing repository operations.
To access these endpoints, developer teams must authenticate using a Personal Access Token (PAT) or a GitHub App installation. The token must be configured with specific scopes, such as manage_billing:copilot for seat adjustments, or read:org and read:enterprise for accessing usage reports. When constructing API requests, developers should supply the default GitHub API version header:
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/my-organization/copilot/billing
Using these headers ensures consistent API behavior and prevents deprecation warnings. For large organizations, automating this verification process cuts down on manual administration and helps maintain strict compliance controls across engineering departments.
Distinguishing coding client APIs from administrative endpoints
A common mistake among developer teams is conflating the official REST API with client-level LLM model endpoints. The administrative REST API does not provide an interface for sending code snippets or receiving chat completions. Those tasks are handled directly by the proprietary editor extension protocols or the Copilot CLI.
Instead, the administrative endpoints provide the metadata and control planes. You do not query the REST API to autocomplete a block of JavaScript; you query the API to determine whether the user attempting to run the autocomplete has an active license, how many suggestion lines they accepted yesterday, and whether an automated agent can be triggered to refactor a repository in the cloud.
How to manage seat allocations with the GitHub Copilot API
Managing seat licenses at scale requires automated tools. The REST API exposes CRUD endpoints for assigning and removing Copilot seats directly. Rather than logging into the GitHub UI and clicking individual checkmarks, administrators can run custom scripts to reconcile active directory members with Copilot allocations.
To retrieve a list of all active seats within a GitHub organization, query the billing seats endpoint:
GET /orgs/{org}/copilot/billing/seats
The response returns an array of seat assignments, providing details on each user, their assignment date, and their last recorded activity. A key property in this payload is last_activity_at, which tracks the timestamp of the user's last interaction with the coding assistant. It is important to note that this timestamp is dependent on telemetry being enabled in the user's IDE, meaning users who disable local tracking may show a null value.
A typical response payload for an active user contains the following structure:
{
"total_seats": 150,
"seats": [
{
"assignee": {
"login": "octocat",
"id": 1,
"type": "User",
"site_admin": false
},
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z",
"last_activity_at": "2026-07-22T18:45:00Z",
"last_activity_editor": "vscode/1.90.0"
}
]
}
Analyzing this JSON array allows systems to automatically identify underutilized seats. If a seat shows no activity for over 30 days, an automated offboarding script can reclaim the license, saving operational costs.
Automating seat allocations and offboarding procedures
To add seats to your organization, send a POST request containing the usernames to allocate:
POST /orgs/{org}/copilot/billing/seats
The request payload expects a JSON block specifying the target logins:
{
"selected_usernames": ["developer-1", "developer-2"]
}
Removing seats uses a DELETE request to the same path, passing the target logins in the body. When a seat is removed, the user loses license access immediately, and the seat is returned to the available pool. Integrating these requests into employee onboarding and offboarding pipelines reduces license waste by ensuring inactive developers do not hold expensive allocations.
The API returns standard HTTP status codes to indicate success or failure:
- 201 Created: Seat assigned successfully.
- 204 No Content: Seat removed successfully.
- 403 Forbidden: Invalid token scopes or insufficient billing privileges.
- 404 Not Found: The specified user or organization does not exist.
- 422 Unprocessable Entity: User is not a member of the organization.
Extracting team metrics from Copilot usage reports
Evaluating the return on investment for developer tools requires detailed data. While total seat counts indicate licensing costs, they do not show real-world adoption depth. To help organizations analyze engagement trends, GitHub provides dedicated usage metrics report endpoints at the organization and enterprise levels.
Rather than returning large JSON datasets directly inside the API response, these endpoints return time-limited, signed download URLs pointing to Newline Delimited JSON (NDJSON) report files. Because these signed URLs expire quickly, your script must download the payload promptly.
Query the organization team report path to retrieve the signed URL:
GET /orgs/{org}/copilot/metrics/reports/user-teams-1-day
The report payload aggregates activity across several features. It documents the number of IDE completions accepted, chat requests submitted, CLI sessions processed, and coding agent actions triggered. For security administrators, these reports are critical for verifying compliance with public code suggestion policies.
An example of the NDJSON record structure format reveals how detailed the tracking is:
{"day":"2026-07-22","user_id":102938,"editor":"vscode","language":"typescript","suggestions_count":120,"acceptances_count":42,"lines_suggested":480,"lines_accepted":168,"active_chats":5,"chat_messages":12}
Joining disparate user reports to compute team-level metrics
There is no direct API endpoint that returns team-specific metrics. Instead, team leaders must compute these aggregations manually. To perform a team-level analysis, developers download the user-teams report, which maps user IDs to specific organization teams.
After retrieving the team mappings, developers join this dataset with the per-user daily usage report, using user_id and day as the matching keys. Running this join process in memory allows teams to identify which engineering groups are adopting AI features and which require additional training.
Rather than writing custom database logic or running scripts on local hard drives, teams can store these reports in a central workspace. Fastio Workspaces provide shared environments where teams organize documents, exports, and reports. By enabling Intelligence Mode on a workspace, all files are indexed automatically for RAG chat and hybrid search. Developers can ask natural language questions about billing trends and seat activity directly, referencing specific documentation snippets.
For structured metrics, Fastio features Metadata Views, which turn raw files into a structured database. Users define columns in plain English, and the underlying AI extracts values from uploaded JSON, CSV, or NDJSON reports. This allows administrators to track seat allocations, activity timestamps, and license costs in a filterable grid without writing manual parsing code.
Organize your developer metrics in a shared workspace
Upload your Copilot usage reports to an intelligent workspace with built-in RAG search, collaborative note editing, and automated metadata extraction. Starts with a 14-day free trial.
Automating cloud workflows with the Copilot Agent Tasks API
Beyond simple autocomplete features, developer workflows are moving toward automated code modifications. The Copilot Agent Tasks API allows developer teams to programmatically trigger and track cloud-based agent tasks across their repositories.
This API provides a method for launching large-scale modifications, including framework migrations, library updates, and code cleanup. To launch a new agent task, send a POST request specifying the repository and the task configuration:
POST /repos/{owner}/{repo}/copilot/agent/tasks
The body payload details the instruction set and the target branches:
{
"task_type": "refactor",
"instruction": "Upgrade package dependency versions to resolve CVE-2026-1029",
"target_branch": "main",
"agent_model": "copilot-workspace-agent-v2"
}
The agent executes the task in a cloud sandbox, editing files, running tests, and preparing pull requests. Developers monitor the execution status by querying the task ID:
GET /repos/{owner}/{repo}/copilot/agent/tasks/{task_id}
The task status field progresses through queued, running, completed, or failed. To review or resume a task, developers can launch the task in their local workspace. The API provides a launch URL scheme using the ghapp protocol:
https://github.com/copilot/app/launch?open=ghapp%3A%2F%2Fgithub.com%2Fowner%2Frepo%2Ftasks%2Ftask_id
Bridging third-party gateways for custom agent compatibility
Some developer teams use community tools to connect custom agentic scripts with GitHub Copilot services. Open-source reverse proxies, such as caozhiyuan/copilot-api, provide compatibility layers that translate Copilot credentials into standard OpenAI or Anthropic API endpoints.
While these proxies allow teams to use Copilot licenses inside unofficial clients or custom terminal utilities, they are reverse-engineered and subject to sudden breakage if GitHub updates its protocols. Additionally, using unofficial wrappers carries terms of service and security risks, making the official REST API and official SDKs the preferred path for production pipelines.
Connecting GitHub Copilot API data with shared workspaces
Building a system around GitHub Copilot requires coordinating team assets, usage reports, and audit logs. While some organizations store metrics in basic cloud drives or raw databases, these options lack the specialized features needed for collaborative engineering teams.
Fastio serves as the central collaboration layer for agentic teams. While coding assistants generate code and metrics APIs track performance, Fastio organizes the documents, compliance records, and workflow approvals that keep projects moving.
Humans and agents co-edit documentation inside Collaborative Notes, keeping design requirements aligned. Scoped API keys allow teams to integrate coding agents directly, using the Model Context Protocol (MCP) server to read guidelines or output files. Every administrative action and file modification is recorded in Fastio's append-only audit log, ensuring a clear chain of custody.
To start organizing your developer workflows, teams can sign up for a 14-day free trial, which requires a credit card to activate [Fastio Official Pricing]. Fastio plans are structured for teams of all sizes: the Starter plan is priced at $29 monthly, the Business plan is priced at $99 monthly, and the Growth plan is priced at $299 monthly [Fastio Official Pricing]. By using usage-based credits rather than per-seat licensing, Fastio lets you scale storage, bandwidth, and document extraction as your agentic integrations grow.
Setting up automated report exports to team workspaces
Organizations can automate the export of Copilot metrics by building a scheduled task in their deployment pipeline. A GitHub Actions workflow can run daily, query the metrics report API, retrieve the signed NDJSON download link, and fetch the report.
Once downloaded, the Action can upload the file to Fastio using a workspace webhook or the Fastio API. The uploaded file is indexed by Fastio's search engine, allowing team leaders to run semantic queries or extract structured metrics using Metadata Views. This setup keeps compliance logs and usage trends up to date without human intervention.
Frequently Asked Questions
Does GitHub Copilot have an API?
Yes, GitHub Copilot has an official REST API, but it is focused on administration, seat allocation, usage metrics, and cloud agent tasks rather than code generation. To programmatically generate code, developer teams use the official GitHub Copilot CLI or IDE extensions instead of raw HTTP endpoints.
How do I access the GitHub Copilot API?
To access the GitHub Copilot API, you must have an active GitHub organization or enterprise subscription with Copilot enabled. You authenticate your HTTP requests using a Personal Access Token or a GitHub App installation that has been granted the necessary permissions, such as the manage_billing:copilot scope.
What is the Copilot Agent Tasks API?
The Copilot Agent Tasks API is a set of REST endpoints that allows organization administrators to programmatically launch, track, and monitor cloud-based refactoring agents. These agents can perform large-scale repository tasks, such as library migrations, and return the output as pull requests.
Related Resources
Organize your developer metrics in a shared workspace
Upload your Copilot usage reports to an intelligent workspace with built-in RAG search, collaborative note editing, and automated metadata extraction. Starts with a 14-day free trial.