The API is in its first release. We’re expanding capabilities based on feedback - let us know what endpoints you need!
- Availability: Only for enterprise teams
- Status: Alpha (response shapes and fields may change)
Authentication
All API requests require authentication using an API key. This API uses the same Admin API authentication as other endpoints. For detailed authentication instructions, see Admin API authentication.Base URL
All API endpoints use:Rate Limits
- 5 requests per minute per team, per endpoint
Query Parameters
All endpoints below accept the same query parameters via query string:Parameter | Type | Required | Description |
---|---|---|---|
startDate | string | date | No | ISO date string, the literal “now”, or relative days like “7d” (means now - 7 days). Default: now - 7 days |
endDate | string | date | No | ISO date string, the literal “now”, or relative days like “0d”. Default: now |
page | number | No | Page number (1-based). Default: 1 |
pageSize | number | No | Results per page. Default: 100, Max: 1000 |
user | string | No | Optional filter by a single user. Accepts email (e.g., developer@company.com), encoded ID (e.g., user_abc123…), or numeric ID (e.g., 42) |
Responses return userId as an encoded external ID with the prefix user_. This is stable for API consumption.
Semantics and How Metrics Are Computed
- Sources: “TAB” represents inline completions that were accepted; “COMPOSER” represents accepted diffs from Composer
- Lines metrics: tabLinesAdded/Deleted and composerLinesAdded/Deleted are separately counted; nonAiLinesAdded/Deleted are derived as max(0, totalLines - AI lines)
- Privacy mode: If enabled in the client, some metadata (like fileName) may be omitted
- Branch info: isPrimaryBranch is true when the current branch equals the repo’s default branch; may be undefined if repo info is unavailable
Endpoints
Get AI Commit Metrics (JSON, paginated)
Retrieve aggregated per-commit metrics that attribute lines to TAB, COMPOSER, and non-AI.Response
AiCommitMetric Fields
Field | Type | Description |
---|---|---|
commitHash | string | Git commit hash |
userId | string | Encoded user ID (e.g., user_abc123) |
userEmail | string | User’s email address |
repoName | string | null | Repository name |
branchName | string | null | Branch name |
isPrimaryBranch | boolean | null | Whether this is the primary branch |
totalLinesAdded | number | Total lines added in commit |
totalLinesDeleted | number | Total lines deleted in commit |
tabLinesAdded | number | Lines added via TAB completions |
tabLinesDeleted | number | Lines deleted via TAB completions |
composerLinesAdded | number | Lines added via Composer |
composerLinesDeleted | number | Lines deleted via Composer |
nonAiLinesAdded | number | null | Non-AI lines added |
nonAiLinesDeleted | number | null | Non-AI lines deleted |
message | string | null | Commit message |
commitTs | string | null | Commit timestamp (ISO format) |
createdAt | string | Ingestion timestamp (ISO format) |
Example Response
Example Requests
Basic request:Download AI Commit Metrics (CSV, streaming)
Download commit metrics data in CSV format for large data extractions.Response
Headers:- Content-Type: text/csv; charset=utf-8
CSV Columns
Column | Type | Description |
---|---|---|
commit_hash | string | Git commit hash |
user_id | string | Encoded user ID |
user_email | string | User’s email address |
repo_name | string | Repository name |
branch_name | string | Branch name |
is_primary_branch | boolean | Whether this is the primary branch |
total_lines_added | number | Total lines added in commit |
total_lines_deleted | number | Total lines deleted in commit |
tab_lines_added | number | Lines added via TAB completions |
tab_lines_deleted | number | Lines deleted via TAB completions |
composer_lines_added | number | Lines added via Composer |
composer_lines_deleted | number | Lines deleted via Composer |
non_ai_lines_added | number | Non-AI lines added |
non_ai_lines_deleted | number | Non-AI lines deleted |
message | string | Commit message |
commit_ts | string | Commit timestamp (ISO format) |
created_at | string | Ingestion timestamp (ISO format) |
Sample CSV Output
Example Request
Get AI Code Change Metrics (JSON, paginated)
Retrieve granular accepted AI changes, grouped by deterministic changeId. Useful to analyze accepted AI events independent of commits.Response
AiCodeChangeMetric Fields
Field | Type | Description |
---|---|---|
changeId | string | Deterministic ID for the change |
userId | string | Encoded user ID (e.g., user_abc123) |
userEmail | string | User’s email address |
source | ”TAB” | “COMPOSER” | Source of the AI change |
model | string | null | AI model used |
totalLinesAdded | number | Total lines added |
totalLinesDeleted | number | Total lines deleted |
createdAt | string | Ingestion timestamp (ISO format) |
metadata | Array | File metadata (fileName may be omitted in privacy mode) |
Example Response
Example Requests
Basic request:Download AI Code Change Metrics (CSV, streaming)
Download change metrics data in CSV format for large data extractions.Response
Headers:- Content-Type: text/csv; charset=utf-8
CSV Columns
Column | Type | Description |
---|---|---|
change_id | string | Deterministic ID for the change |
user_id | string | Encoded user ID |
user_email | string | User’s email address |
source | string | Source of the AI change (TAB or COMPOSER) |
model | string | AI model used |
total_lines_added | number | Total lines added |
total_lines_deleted | number | Total lines deleted |
created_at | string | Ingestion timestamp (ISO format) |
metadata_json | string | JSON stringified array of metadata entries |
Notes
- metadata_json is a JSON stringified array of metadata entries (may omit fileName under privacy mode)
- When consuming CSV, be sure to parse quoted fields
Sample CSV Output
Example Request
Tips
- Use
user
parameter to quickly filter a single user across all endpoints - For large data extractions, prefer CSV endpoints—they stream in pages of 10,000 records server-side
isPrimaryBranch
may be undefined if the client couldn’t resolve the default branchcommitTs
is the commit timestamp;createdAt
is the ingestion time on our servers- Some fields may be absent when privacy mode is enabled on the client
Changelog
- Alpha release: Initial endpoints for commits and changes. Response shapes may evolve based on feedback