# Github Copilot

Follow these steps to enable Copilot Metrics API access and generate a Personal Access Token (PAT) for integration.

***

#### Prerequisites - Before You Begin

* You must be an **organization owner** (or enterprise owner/billing manager if your org is part of an enterprise).
* **Copilot Metrics API access policy** must be enabled for your organization.
  * If it is not enabled, API calls for Copilot metrics will return a `422` error. [*Refer here*](https://docs.github.com/en/rest/copilot/copilot-metrics?apiVersion=2022-11-28)

***

#### Step 1: Enable Copilot Metrics API Access

1. Navigate to your **organization** or **enterprise settings**.
2. Locate the **Copilot** or **Copilot Metrics policy**.
3. Ensure that **API access** is set to **Enabled** (or left as *No policy*).

***

#### Step 2: Generate a Personal Access Token (Classic)

1. Log into GitHub with your **admin account**.
2. Click your **profile avatar** (upper-right) → **Settings**.
3. In the left sidebar, open **Developer settings** → **Tokens (classic)**.
4. Click **Generate new token (classic)**.
   * Add a descriptive note (e.g., *“Typo Copilot Metrics Access”*).
   * Set an expiration (recommended for security).
5. Select the following scopes:
   * `manage_billing:copilot` → required for Copilot metrics access
   * `read:org` → required to read organization members
6. Click **Generate token**.
7. Copy and **securely store** the token immediately - you won’t be able to see it again.
8. Connect to Typo dashboard: Go to the [AI Coding](https://app.typoapp.io/gen-ai-impact) module or [Integrations](https://app.typoapp.io/settings/integration), click on Connect Copilot, enter your API key, and click Connect.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://typo.gitbook.io/typo-help-docs/getting-started/integrations/ai-coding-assistants/github-copilot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
