Skip to content

Add ai_credits_used and update API schema output#44994

Open
imranmaszeri wants to merge 1 commit into
github:mainfrom
imranmaszeri:main
Open

Add ai_credits_used and update API schema output#44994
imranmaszeri wants to merge 1 commit into
github:mainfrom
imranmaszeri:main

Conversation

@imranmaszeri

Copy link
Copy Markdown

Why:

This PR updates the API output documentation to include new columns announced in https://github.blog/changelog/2026-06-19-ai-credits-consumed-per-user-now-in-the-copilot-usage-metrics-api/ and also other columns that exist when comparing with real examples.

Additionally, example API schema is showing outputs that are not similar to real examples. Columns like etl_id, day_partition, and entity_id_partition only exists when exporting data through the web UI download link which is exported into NDJSON data, but the API output does not provide these columns. Since the title of the documentation is "example schema of the data returned by the Copilot usage metrics API", I believe this change should help accurately reflect the actual output of the data.

Closes: #44908

What's being changed (if available, include any code snippets, screenshots, or gifs):

In https://docs.github.com/en/copilot/reference/copilot-usage-metrics/copilot-usage-metrics#per-user-report-fields

+ | `ai_credits_used` | `number` | No | Total AI credits consumed by the user on this day. |
+ | `used_copilot_cloud_agent` | `boolean` | No | Whether the user used Copilot cloud agent that day. |
+ | `used_copilot_coding_agent` | `boolean` | No | Whether the user used Copilot cloud agent that day. Carries the same value as `used_copilot_cloud_agent`; both names are retained for backward compatibility. |

In https://docs.github.com/en/copilot/reference/copilot-usage-metrics/example-schema

+ "used_copilot_coding_agent": false,
+ "used_copilot_cloud_agent": false,
+ "ai_adoption_phase": {
+    "phase_number": 2,
+    "phase": "Phase 2",
+    "version": "v1"
+ },
- "etl_id": "green",
- "day_partition": "2025-10-01",
- "entity_id_partition": 1
+ "ai_credits_used": 500

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

Copilot AI review requested due to automatic review settings June 30, 2026 07:13
@welcome

welcome Bot commented Jun 30, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md fpt
ghec
fpt
ghec
copilot/reference/copilot-usage-metrics/example-schema.md fpt
ghec
fpt
ghec

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Copilot usage metrics API documentation to better match the actual API response schema, including newly announced ai_credits_used and removing fields that appear only in UI export formats.

Changes:

  • Add ai_credits_used to the per-user report fields documentation.
  • Update the example schema to include ai_adoption_phase and agent-related usage fields, and remove export-only partition/ETL fields.
  • Clean up enterprise-level schema examples to omit non-API fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
content/copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md Documents the new ai_credits_used field, but currently duplicates agent-related field rows (needs cleanup).
content/copilot/reference/copilot-usage-metrics/example-schema.md Updates the example API response schema to better reflect real API output and removes non-API export fields.

Comment on lines +114 to +116
| `ai_credits_used` | `number` | No | Total AI credits consumed by the user on this day. |
| `used_copilot_cloud_agent` | `boolean` | No | Whether the user used Copilot cloud agent that day. |
| `used_copilot_coding_agent` | `boolean` | No | Whether the user used Copilot cloud agent that day. Carries the same value as `used_copilot_cloud_agent`; both names are retained for backward compatibility. |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copilot usage metrics docs missing ai_credits_used field

2 participants