GetCoAuthorSummary
usage.get_co_author_summary(UsageGetCoAuthorSummaryParams**kwargs) -> UsageGetCoAuthorSummaryResponse
POST/gitpod.v1.UsageService/GetCoAuthorSummary
Gets aggregated co-author summary for the organization or a specific project.
Use this method to:
- Measure AI-assisted commits and line changes
- Scope co-author insights to a project, user, or team
- Compare the requested date range against the previous period
Example
dateRange:
startTime: "2024-01-01T00:00:00Z"
endTime: "2024-02-01T00:00:00Z"
projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"ParametersExpand Collapse
ReturnsExpand Collapse
class UsageGetCoAuthorSummaryResponse: …
class UsageGetCoAuthorSummaryResponse: …
summary: Optional[CoAuthorSummary]Summary totals and trends for the requested date range.
summary: Optional[CoAuthorSummary]
Summary totals and trends for the requested date range.
distinct_authors_trend: Optional[float]
Fractional change in distinct_authors compared to the previous period.
formatdouble
total_commits_trend: Optional[float]
Fractional change in total_commits compared to the previous period of equal length. Computed as (current - previous) / previous. Zero when there is no previous data.
formatdouble
GetCoAuthorSummary
import os
from datetime import datetime
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
response = client.usage.get_co_author_summary(
date_range={
"end_time": datetime.fromisoformat("2024-02-01T00:00:00"),
"start_time": datetime.fromisoformat("2024-01-01T00:00:00"),
},
project_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
)
print(response.sparkline){
"sparkline": [
{
"time": "2019-12-27T18:11:19.117Z",
"value": 0
}
],
"summary": {
"byTool": [
{
"commits": "commits",
"distinctAuthors": "distinctAuthors",
"linesAdded": "linesAdded",
"linesRemoved": "linesRemoved",
"tool": "CO_AUTHOR_TOOL_UNSPECIFIED"
}
],
"distinctAuthors": "distinctAuthors",
"distinctAuthorsTrend": 0,
"totalCommits": "totalCommits",
"totalCommitsTrend": 0,
"totalLinesAdded": "totalLinesAdded",
"totalLinesAddedTrend": 0,
"totalLinesRemoved": "totalLinesRemoved",
"totalLinesRemovedTrend": 0
}
}Returns Examples
{
"sparkline": [
{
"time": "2019-12-27T18:11:19.117Z",
"value": 0
}
],
"summary": {
"byTool": [
{
"commits": "commits",
"distinctAuthors": "distinctAuthors",
"linesAdded": "linesAdded",
"linesRemoved": "linesRemoved",
"tool": "CO_AUTHOR_TOOL_UNSPECIFIED"
}
],
"distinctAuthors": "distinctAuthors",
"distinctAuthorsTrend": 0,
"totalCommits": "totalCommits",
"totalCommitsTrend": 0,
"totalLinesAdded": "totalLinesAdded",
"totalLinesAddedTrend": 0,
"totalLinesRemoved": "totalLinesRemoved",
"totalLinesRemovedTrend": 0
}
}