• Tech Dev NotesTech Dev Notes
Apps
  • App lookup
  • App compare
Market movement
  • App charts
  • App rankings
Visual proof
  • App screens
  • App listing screenshots
  • App icons
Build intelligence
  • App tech stacks
  • Tool releases
  • Developers
More
  • X feature flags
  • Grokipedia
  • Blog
  • Follow on X
Skip to content
All content/ filesChangelog

cursor-docs/latest/content · Jun 26, 20:20 UTC

pages/account/teams/ai-code-tracking-api.txt

TXT·13.9 KB·293 lines

content/

  • pages

    • api.txt
    • approval-agents.txt
    • bugbot.txt
    • cloud-agent.txt
    • customize-cursor.txt
    • enterprise.txt
    • evals.txt
    • extension-api.txt
    • hooks.txt
    • mcp.txt
    • models-and-pricing.txt
    • plugins.txt
    • rules.txt
  • pages/account

    • regions.txt
    • update-access.txt
  • pages/account/enterprise

    • billing-groups.txt
    • cyber-safeguards.txt
    • service-accounts.txt
  • pages/account/organizations

    • organization-admin-api.txt
  • pages/account/pricing

    • request-based-legacy.txt
  • pages/account/teams

    • admin-api.txt
    • ai-code-tracking-api.txt
    • analytics-api.txt
    • analytics.txt
    • dashboard.txt
    • members.txt
    • pricing.txt
    • scim.txt
    • setup.txt
    • sso.txt
  • pages/agent

    • agent-review.txt
    • agents-window.txt
    • debug-mode.txt
    • design-mode.txt
    • overview.txt
    • plan-mode.txt
    • prompting.txt
    • security.txt
  • pages/agent/security

    • run-modes.txt
  • pages/agent/tools

    • browser.txt
    • canvas.txt
    • search.txt
    • terminal.txt
  • pages/cli

    • acp.txt
    • changelog.txt
    • github-actions.txt
    • headless.txt
    • installation.txt
    • mcp.txt
    • overview.txt
    • shell-mode.txt
    • using.txt
  • pages/cli/reference

    • authentication.txt
    • configuration.txt
    • output-format.txt
    • parameters.txt
    • permissions.txt
    • slash-commands.txt
    • terminal-setup.txt
  • pages/cloud-agent

    • automations.txt
    • best-practices.txt
    • capabilities.txt
    • choose-runtime.txt
    • my-machines.txt
    • private-workers.txt
    • security-network.txt
    • self-hosted-cloud-run.txt
    • self-hosted-k8s.txt
    • self-hosted-pool.txt
    • settings.txt
    • setup.txt
  • pages/cloud-agent/api

    • endpoints.txt
    • webhooks.txt
  • pages/configuration

    • worktrees.txt
  • pages/configuration/migrations

    • vscode.txt
  • pages/cursor-review

    • merge-queue.txt
    • overview.txt
    • pr-inbox.txt
    • pr-page.txt
  • pages/cursor-review/cli

    • authentication.txt
    • parameters.txt
    • stacking.txt
  • pages/customizing

    • aws-bedrock.txt
  • pages/enterprise

    • baa.txt
    • compliance-and-monitoring.txt
    • deployment-patterns.txt
    • endpoint-security.txt
    • identity-and-access-management.txt
    • llm-safety-and-controls.txt
    • model-and-integration-management.txt
    • network-configuration.txt
    • organization-groups.txt
    • organizations.txt
    • pooled-usage.txt
    • privacy-and-data-governance.txt
    • private-connectivity.txt
    • security-hardening.txt
  • pages/get-started

    • quickstart.txt
  • pages/integrations

    • azure-devops.txt
    • bitbucket.txt
    • cursor-blame.txt
    • github.txt
    • gitlab.txt
    • jetbrains.txt
    • jira.txt
    • linear.txt
    • microsoft-teams.txt
    • notion.txt
    • slack.txt
    • xcode.txt
  • pages/mcp

    • install-links.txt
  • pages/models

    • claude-4-5-haiku.txt
    • claude-4-5-sonnet.txt
    • claude-4-6-sonnet.txt
    • claude-4-sonnet-1m.txt
    • claude-4-sonnet.txt
    • claude-fable-5.txt
    • claude-opus-4-5.txt
    • claude-opus-4-6-fast.txt
    • claude-opus-4-6.txt
    • claude-opus-4-7-fast.txt
    • claude-opus-4-7.txt
    • claude-opus-4-8.txt
    • cursor-composer-1-5.txt
    • cursor-composer-1.txt
    • cursor-composer-2-5.txt
    • cursor-composer-2.txt
    • gemini-2-5-flash.txt
    • gemini-3-1-pro.txt
    • gemini-3-5-flash.txt
    • gemini-3-flash.txt
    • gemini-3-pro-image-preview.txt
    • gemini-3-pro.txt
    • glm-5-2.txt
    • gpt-5-1-codex-max.txt
    • gpt-5-1-codex-mini.txt
    • gpt-5-1-codex.txt
    • gpt-5-2-codex.txt
    • gpt-5-2.txt
    • gpt-5-3-codex.txt
    • gpt-5-4-mini.txt
    • gpt-5-4-nano.txt
    • gpt-5-4.txt
    • gpt-5-5.txt
    • gpt-5-codex.txt
    • gpt-5-fast.txt
    • gpt-5-mini.txt
    • gpt-5.txt
    • grok-4-20.txt
    • grok-4-3.txt
    • grok-build-0-1.txt
    • kimi-k2-5.txt
  • pages/reference

    • deeplinks.txt
    • ignore-file.txt
    • keyboard-shortcuts.txt
    • permissions.txt
    • plugins.txt
    • sandbox.txt
    • third-party-hooks.txt
  • pages/sdk

    • python.txt
route: /docs/account/teams/ai-code-tracking-api
title: AI Code Tracking API
description: Track AI-generated code contributions across your team with the API.

AI Code Tracking API
The AI Code Tracking API lets you track AI-generated code contributions across your team's repositories, including per-commit AI usage and granular accepted AI changes.
The AI Code Tracking API uses Basic Authentication with your API key as the username, the same method as the Admin API.
For details on creating API keys, authentication methods, rate limits, and best practices, see the API Overview.
Availability: Enterprise only, contact sales to get access
Status: Alpha (response shapes and fields may change)
Workspace limitation: Metrics are only calculated for the git repository at the top level of the workspace root. Multi-root workspaces are not currently supported.
Endpoints
Get AI Commit Metrics (JSON, paginated)
GET/analytics/ai-code/commits
Retrieve aggregated per-commit metrics that attribute lines to TAB, COMPOSER, and non-AI.
Parameters
startDate string | date
ISO date string, the literal "now", or relative days like "7d" (means now - 7 days). Default: now - 7 days
endDate string | date
ISO date string, the literal "now", or relative days like "0d". Default: now
page number
Page number (1-based). Default: 1
pageSize number
Results per page. Default: 100, Max: 1000
user string
Optional filter by a single user. Accepts email (e.g., [email protected]), encoded ID (e.g., user_abc123...), or numeric ID (e.g., 42)
Response 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
commitSource
"ide" | "cli" | "cloud"
Where the commit originated.
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)
curl -X GET "https://api.cursor.com/analytics/ai-code/commits?startDate=7d&endDate=now&page=1&pageSize=100" \
-u YOUR_API_KEY:
Response:
{
"items": [
{
"commitHash": "a1b2c3d4",
"userId": "user_3k9x8q...",
"userEmail": "[email protected]",
"repoName": "company/repo",
"branchName": "main",
"isPrimaryBranch": true,
"commitSource": "ide",
"totalLinesAdded": 120,
"totalLinesDeleted": 30,
"tabLinesAdded": 50,
"tabLinesDeleted": 10,
"composerLinesAdded": 40,
"composerLinesDeleted": 5,
"nonAiLinesAdded": 30,
"nonAiLinesDeleted": 15,
"message": "Refactor: extract analytics client",
"commitTs": "2025-07-30T14:12:03.000Z",
"createdAt": "2025-07-30T14:12:30.000Z"
}
],
"totalCount": 42,
"page": 1,
"pageSize": 100
}
Download AI Commit Metrics (CSV, streaming)
GET/analytics/ai-code/commits.csv
Download commit metrics data in CSV format for large data extractions.
Parameters
startDate string | date
ISO date string, the literal "now", or relative days like "7d" (means now - 7 days). Default: now - 7 days
endDate string | date
ISO date string, the literal "now", or relative days like "0d". Default: now
user string
Optional filter by a single user. Accepts email (e.g., [email protected]), encoded ID (e.g., user_abc123...), or numeric ID (e.g., 42)
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
commit_source
string
Where the commit originated (ide, cli, or cloud)
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)
curl -L "https://api.cursor.com/analytics/ai-code/commits.csv?startDate=2025-07-01T00:00:00Z&endDate=now&user=user_3k9x8q..." \
-u YOUR_API_KEY: \
-o commits.csv
Sample CSV Output:
commit_hash,commit_source,user_id,user_email,repo_name,branch_name,is_primary_branch,total_lines_added,total_lines_deleted,tab_lines_added,tab_lines_deleted,composer_lines_added,composer_lines_deleted,non_ai_lines_added,non_ai_lines_deleted,message,commit_ts,created_at
a1b2c3d4,ide,user_3k9x8q...,[email protected],company/repo,main,true,120,30,50,10,40,5,30,15,"Refactor: extract analytics client",2025-07-30T14:12:03.000Z,2025-07-30T14:12:30.000Z
e5f6g7h8,cloud,user_3k9x8q...,[email protected],company/repo,feature-branch,false,85,15,30,5,25,3,30,7,"Add error handling",2025-07-30T13:45:21.000Z,2025-07-30T13:45:45.000Z
Get AI Code Change Metrics (JSON, paginated)
GET/analytics/ai-code/changes
Retrieve granular accepted AI changes, grouped by deterministic changeId. Useful to analyze accepted AI events independent of commits.
Parameters
startDate string | date
ISO date string, the literal "now", or relative days like "7d" (means now - 7 days). Default: now - 7 days
endDate string | date
ISO date string, the literal "now", or relative days like "0d". Default: now
page number
Page number (1-based). Default: 1
pageSize number
Results per page. Default: 100, Max: 1000
user string
Optional filter by a single user. Accepts email (e.g., [email protected]), encoded ID (e.g., user_abc123...), or numeric ID (e.g., 42)
Response 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)
curl -X GET "https://api.cursor.com/analytics/ai-code/changes?startDate=14d&endDate=now&page=1&pageSize=200" \
-u YOUR_API_KEY:
Response:
{
"items": [
{
"changeId": "749356201",
"userId": "user_3k9x8q...",
"userEmail": "[email protected]",
"source": "COMPOSER",
"model": null,
"totalLinesAdded": 18,
"totalLinesDeleted": 4,
"createdAt": "2025-07-30T15:10:12.000Z",
"metadata": [
{
"fileName": "src/analytics/report.ts",
"fileExtension": "ts",
"linesAdded": 12,
"linesDeleted": 3
},
{
"fileName": "src/analytics/ui.tsx",
"fileExtension": "tsx",
"linesAdded": 6,
"linesDeleted": 1
}
]
}
],
"totalCount": 128,
"page": 1,
"pageSize": 200
}
Download AI Code Change Metrics (CSV, streaming)
GET/analytics/ai-code/changes.csv
Download change metrics data in CSV format for large data extractions.
Parameters
startDate string | date
ISO date string, the literal "now", or relative days like "7d" (means now - 7 days). Default: now - 7 days
endDate string | date
ISO date string, the literal "now", or relative days like "0d". Default: now
user string
Optional filter by a single user. Accepts email (e.g., [email protected]), encoded ID (e.g., user_abc123...), or numeric ID (e.g., 42)
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 use
…
Previouspages/account/teams/admin-api.txtNextpages/account/teams/analytics-api.txt

© 2026 Tech Dev Notes

RSSAboutAPIPrivacyTermsSitemap@techdevnotes