Unary · Usage
Gets co-author contribution data as a time series.
Use this method to:
- Chart AI-assisted commits and line changes over time
- Select hourly, daily, weekly, or monthly buckets
- Scope co-author insights to a project, user, or team
Example
dateRange:
startTime: "2024-01-01T00:00:00Z"
endTime: "2024-02-01T00:00:00Z"
resolution: RESOLUTION_WEEKLY
projectId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
Endpoint
POST /api/gitpod.v1.UsageService/GetCoAuthorTimeSeries
https://app.ona.com with that domain.
Request example
export ONA_HOST=https://app.ona.com
export ONA_API_KEY=<your-token>
curl --request POST \
--url "$ONA_HOST/api/gitpod.v1.UsageService/GetCoAuthorTimeSeries" \
--header "Authorization: Bearer $ONA_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"dateRange": {
"endTime": "2026-01-01T00:00:00Z",
"startTime": "2026-01-01T00:00:00Z"
}
}'
import gitpod.v1.usage_pb2 as usage_pb2
import google.protobuf.timestamp_pb2 as timestamp_pb2
from ona_sdk import create_client_from_env
ona = create_client_from_env()
request = usage_pb2.GetCoAuthorTimeSeriesRequest(
date_range=usage_pb2.DateRange(
start_time=timestamp_pb2.Timestamp(seconds=1767225600),
end_time=timestamp_pb2.Timestamp(seconds=1767225600),
),
)
response = ona.services.usage.get_co_author_time_series(request)
print(response)
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { GetCoAuthorTimeSeriesRequestSchema } from "@gitpod/sdk/gitpod/v1/usage_pb";
import { timestampFromDate } from "@bufbuild/protobuf/wkt";
async function main() {
const ona = createClientFromEnv();
const request = create(GetCoAuthorTimeSeriesRequestSchema, {
dateRange: {
startTime: timestampFromDate(new Date("2026-01-01T00:00:00Z")),
endTime: timestampFromDate(new Date("2026-01-01T00:00:00Z")),
},
});
const response = await ona.services.usage.getCoAuthorTimeSeries(request);
console.log(response);
}
main().catch(console.error);
package main
import (
"context"
"fmt"
"log"
"connectrpc.com/connect"
"github.com/gitpod-io/gitpod-sdk-go/sdk"
gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
func main() {
ona, err := sdk.NewFromEnv()
if err != nil {
log.Fatal(err)
}
request := connect.NewRequest(&gitpodpb.GetCoAuthorTimeSeriesRequest{
DateRange: &gitpodpb.DateRange{
StartTime: ×tamppb.Timestamp{Seconds: 1767225600},
EndTime: ×tamppb.Timestamp{Seconds: 1767225600},
},
})
response, err := ona.Services.Usage.GetCoAuthorTimeSeries(context.Background(), request)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Msg)
}
{
"dateRange": {
"endTime": "2026-01-01T00:00:00Z",
"startTime": "2026-01-01T00:00:00Z"
}
}
Request
gitpod.v1.GetCoAuthorTimeSeriesRequest
| Field | Type | Required | Description |
|---|---|---|---|
dateRange | DateRange | Yes | Date range to query within. Constraints: required=true. |
projectId | string | No | Optional project ID to scope results. |
resolution | Resolution | No | Time resolution for the series data. Constraints: enum.defined_only=true. |
userId | string | No | Optional user ID to scope results to a specific user. Mutually exclusive with team_id. |
teamId | string | No | Optional team ID to scope results to a specific team. Mutually exclusive with user_id. |
Response
gitpod.v1.GetCoAuthorTimeSeriesResponse
| Field | Type | Required | Description |
|---|---|---|---|
timeSeries | array of CoAuthorTimeBucket | No | Time series of contribution stats, bucketed by the requested resolution. |
Related types
CoAuthorTimeBucket
CoAuthorTimeBucket
CoAuthorTimeBucket contains stats for a single time period.
gitpod.v1.CoAuthorTimeBucket| Field | Type | Required | Description |
|---|---|---|---|
startTime | RFC 3339 timestamp | No | Start of this time bucket. |
byTool | array of ToolBreakdown | No | Per-tool breakdown for this bucket. |
totalLinesAdded | 64-bit integer string | No | Total lines added in this bucket (across all tools). |
totalLinesRemoved | 64-bit integer string | No | Total lines removed in this bucket (across all tools). |
aiRatio | number | No | Ratio of AI-assisted lines added to total lines added (0.0–1.0). |
totalCommits | 64-bit integer string | No | Total number of commits in this bucket (across all tools). |
distinctAuthors | 64-bit integer string | No | Number of distinct authors (by author_hash) in this bucket. |
DateRange
DateRange
DateRange specifies a time period for queries.
gitpod.v1.DateRange| Field | Type | Required | Description |
|---|---|---|---|
startTime | RFC 3339 timestamp | Yes | Start time of the date range (inclusive). Constraints: required=true. |
endTime | RFC 3339 timestamp | Yes | End time of the date range (exclusive). Constraints: required=true. |
ToolBreakdown
ToolBreakdown
ToolBreakdown contains stats for a single AI tool (or human).
gitpod.v1.ToolBreakdown| Field | Type | Required | Description |
|---|---|---|---|
tool | CoAuthorTool | No | The tool these stats are for. |
commits | 64-bit integer string | No | Number of commits attributed to this tool. |
linesAdded | 64-bit integer string | No | Lines added by this tool. |
linesRemoved | 64-bit integer string | No | Lines removed by this tool. |
distinctAuthors | 64-bit integer string | No | Distinct authors who used this tool. |
CoAuthorTool
CoAuthorTool
CoAuthorTool identifies the AI tool that co-authored a commit.
UNSPECIFIED (0) is the proto default and must not appear in reported data.
Use HUMAN for commits with no AI co-author.
| Value | Number | Description |
|---|---|---|
CO_AUTHOR_TOOL_UNSPECIFIED | 0 | |
CO_AUTHOR_TOOL_NO_COAUTHOR | 1 | Commit has no Co-authored-by trailer at all (solo commit). |
CO_AUTHOR_TOOL_HUMAN_COAUTHOR | 2 | Commit has a Co-authored-by trailer, but the co-author is human. |
CO_AUTHOR_TOOL_ONA | 3 | Ona agent. |
CO_AUTHOR_TOOL_GITHUB_COPILOT | 4 | GitHub Copilot. |
CO_AUTHOR_TOOL_CURSOR | 5 | Cursor. |
CO_AUTHOR_TOOL_OTHER | 6 | An AI tool not in the known list. |
CO_AUTHOR_TOOL_CLAUDE | 7 | Claude (Anthropic). |
CO_AUTHOR_TOOL_CODEX | 8 | Codex. |
Resolution
Resolution
Resolution specifies the time granularity for time series data.
| Value | Number | Description |
|---|---|---|
RESOLUTION_UNSPECIFIED | 0 | |
RESOLUTION_HOURLY | 1 | |
RESOLUTION_DAILY | 2 | |
RESOLUTION_WEEKLY | 3 | |
RESOLUTION_MONTHLY | 4 |