# API v1

> **Note:**
> This feature is currently in preview and available for all organizations participating in the [Early Access Program (EAP)](ai-settings.html#eap). It may change and become a paid feature later. For more information, see [Plans and pricing](plans-and-pricing.html).

Version 1 (v1) of the Analytics API provides programmatic access to the AI usage data for your organization. Use it to retrieve metrics on AI adoption, activity, credits consumption, and other metrics that may be relevant across your teams and tools.

> **Note:**
> This is the original version of the API that is now superseded by [API version 2 (v2)](analytics-api-v2.html). To ensure future compatibility, consider switching to API v2.

> **Note:**
> To access the Analytics API, make sure that at least one role assigned to the service account you are using to access the API includes the [View AI analytics](roles.html#permissions_view_ai_analytics) permission. The data returned by the API is limited to the scope of the role: an organization-wide role returns data for the whole organization, while a group-scoped role returns data only for members of the groups that the role provides permissions for, including their subgroups.
>
>
>
> For more information on how permissions affect the returned data, see [Data visibility](ai-analytics.html#data-visibility). Note that the [View AI analytics (self)](roles.html#permissions_view_ai_analytics_self) and [Manage organization](roles.html#permissions_manage_org) permissions don't apply to service accounts and are thus not relevant for Analytics API access.

The following groups of endpoints are available:

* [Adoption and usage](#ai-adoption-and-usage): Number of users who have AI enabled and active, quota consumption over time, and data on users who have hit their usage limits.

* [Activity and impact](#ai-activity-and-impact): Data related to shown and accepted code suggestions and AI invocations.

* [Credit consumption](#ai-credits-consumption): AI credit consumption data for users in the organization.

* [Code provenance](#code-provenance): Lines of code and estimated time saved attributable to AI.

## API reference

### Adoption and usage

#### Get AI adoption metrics by date

OpenAPI endpoint: GET /api/v1/adoption/users-adoption/group-by/date

Get AI adoption and usage data for the specified date range, grouped by date. The returned data includes both metrics by day and total numbers for the date range. Filters for `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **groupBy** (Enum): The time frame to group the data by. When grouping by week, month, or year, the date in the response represents the start of the period. Available values:

day

week

month

year
- **day**
- **week**
- **month**
- **year**
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/adoption/users-adoption/group-by/date
    ?fromDate=2026-02-01
    &toDate=2026-03-31
    &groupBy=month
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/adoption/users-adoption/group-by/date\
?fromDate=2026-02-01\
&toDate=2026-03-31\
&groupBy=month" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

AI adoption and usage data for the specified date range.

- **application/json** (UsersAdoptionCollection)
- **items** (Array of UsersAdoptionData, required)
- **enabled** (integer, required): The number of users who have JetBrains AI enabled for the specific date.
- **active** (integer, required): The number of users who have made at least one request to JetBrains AI on the specific date.
- **date** (string date, required): The date for the AI adoption and usage metrics.
- **totalEnabled** (integer, required): The total number of users with JetBrains AI enabled within the specified date range.
- **totalActive** (integer, required): The total number of users who made at least one request to JetBrains AI within the specified date range.

**200**

```JSON
{
  "items": [
    {
      "enabled": 141,
      "active": 135,
      "date": "2026-02-01"
    },
    {
      "enabled": 155,
      "active": 140,
      "date": "2026-03-01"
    }
  ],
  "totalEnabled": 182,
  "totalActive": 170
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get quota consumption metrics by date

OpenAPI endpoint: GET /api/v1/adoption/quota-consumption/group-by/date

Get quota consumption data for the specified date range, grouped by date. The consumption information includes both built-in quota and top-up AI credits. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **groupBy** (Enum): The time frame to group the data by. When grouping by week, month, or year, the date in the response represents the start of the period. Available values:

day

week

month

year
- **day**
- **week**
- **month**
- **year**
- **tool** (string): A comma-separated list of AI tools to filter by. Available tools:

aia (AI Assistant)

junie (Junie)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

opencode_agent (OpenCode Agent)

pi (Pi Coding Agent)

copilot (Copilot)

other (Other AI tools)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/adoption/quota-consumption/group-by/date
    ?fromDate=2026-02-01
    &toDate=2026-03-31
    &tool=aia
    &groupBy=month
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/adoption/quota-consumption/group-by/date\
?fromDate=2026-02-01\
&toDate=2026-03-31\
&tool=aia\
&groupBy=month" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Quota consumption data for the specified date range.

- **application/json** (QuotaConsumptionCollection)
- **items** (Array of QuotaConsumptionData, required)
- **limit** (number double, required): The consumption of AI credits from the built-in quota.
- **topup** (number double, required): The consumption of AI credits from the top-up balance.
- **date** (string date, required): The date for the quota consumption metrics.
- **totalLimit** (number double, required): The total consumption of built-in quota limit for the entire date range.
- **totalTopup** (number double, required): The total consumption of top-up AI credits for the entire date range.

**200**

```JSON
{
  "items": [
    {
      "limit": 498543.88,
      "topup": 220576.5,
      "date": "2026-02-01"
    },
    {
      "limit": 1943776.43,
      "topup": 831301.57,
      "date": "2026-03-01"
    }
  ],
  "totalLimit": 2442320.31,
  "totalTopup": 1051878.07
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get limit hit metrics by date

OpenAPI endpoint: GET /api/v1/adoption/limit-hits/group-by/date

Get data about the number of users who hit their AI credit limits in the specified date range, grouped by date. Filters for `userIds` and `userEmails` are applied together (the API returns only records that match all  criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **groupBy** (Enum): The time frame to group the data by. When grouping by week, month, or year, the date in the response represents the start of the period. Available values:

day

week

month

year
- **day**
- **week**
- **month**
- **year**
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/date
    ?fromDate=2026-03-01
    &toDate=2026-04-20
    &groupBy=month
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/date\
?fromDate=2026-03-01\
&toDate=2026-04-20\
&groupBy=month" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

The data about users who hit their limits in the specified date range.

- **application/json** (LimitHitsCollection): A collection of data points showing the number of users who hit their limits per period.
- **items** (Array of LimitHit, required)
- **count** (integer, required): The number of users who hit their limit on the specified date.
- **date** (string date, required): The date for the limit hit data.
- **maximumDaily** (integer, required): The maximum number of unique users who hit their limits during a single day in the specified date range.
- **totalHits** (integer, required): Total count of unique users who hit their limits for the given time period.

**200**

```JSON
{
  "items": [
    {
      "count": 7,
      "date": "2026-03-01"
    },
    {
      "count": 6,
      "date": "2026-04-01"
    }
  ],
  "maximumDaily": 7,
  "totalHits": 12
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get limit hit metrics by date and user

OpenAPI endpoint: GET /api/v1/adoption/limit-hits/group-by/date-user.cursor

Get a cursor-paginated list of limit hits for each date and user within a specified date range. When `sortKey` is `date` (default), sorting is done by date first, then by user ID. When `sortKey` is `email` or `userName`, sorting is done by user email or username first, then by date. Filters for `userIds` and `userEmails` are applied together (the API returns only records that match all  criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **cursor** (string): The pagination cursor. Use the nextCursor value from the previous response. When nextCursor is null, there are no more pages.
- **limit** (integer): The number of records to show per page.
- **sortOrder** (Enum): The sorting order for the results. The default sorting order is descending.
- **asc**
- **desc**
- **ASC**
- **DESC**
- **sortKey** (Enum): The key to sort the results by. Default value is date. Available values are:

date, DATE

email, EMAIL

userName, USER_NAME
- **date**
- **email**
- **userName**
- **DATE**
- **EMAIL**
- **USER_NAME**

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/date-user.cursor
    ?fromDate=2026-03-01
    &toDate=2026-04-20
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/date-user.cursor\
?fromDate=2026-03-01 \
&toDate=2026-04-20" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Cursor-paginated limit hits per date per user.

- **application/json** (LimitHitsByDateUserCollection): A cursor-paginated collection of limit hits per date per user.
- **nextCursor** (string | null, required): The anchor for retrieving the next page. If null, there are no more pages.
- **items** (Array of LimitHitByDateUser, required)
- **date** (string date, required): The date of the limit hit.
- **user** (User, required): The information about the user.
- **id** (string, required): The unique identifier of the user.
- **name** (string, required): The user's full name.
- **email** (string email | null): The user's email address.

**200**

```JSON
{
  "nextCursor": "2026-03-15,c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",
  "items": [
    {
      "date": "2026-03-18",
      "user": {
        "id": "b3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e",
        "name": "Emma Novak",
        "email": "emma.novak@jetbrains.com"
      }
    },
    {
      "date": "2026-03-15",
      "user": {
        "id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",
        "name": "Luca Ferretti",
        "email": "luca.ferretti@jetbrains.com"
      }
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get limit hit metrics by credits consumed

OpenAPI endpoint: GET /api/v1/adoption/limit-hits/group-by/credits-date-user.cursor

Get a cursor-paginated list of users who hit their AI credit limits, sorted by the amount of AI credits consumed.  The cursor encodes the last seen (`creditsUsed`, `userId`) pair. Filters for `userIds` and `userEmails` are applied together (the API returns only records that match all  criteria). Use this endpoint to identify the consumers who used the most AI credits within the specified date range.

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **cursor** (string): The pagination cursor. Use the nextCursor value from the previous response. When nextCursor is null, there are no more pages.
- **limit** (integer): The number of records to show per page.
- **sortOrder** (Enum): The sorting order for the results. The default sorting order is descending.
- **asc**
- **desc**
- **ASC**
- **DESC**

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/credits-date-user.cursor
    ?fromDate=2026-03-01
    &toDate=2026-04-20
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/credits-date-user.cursor\
?fromDate=2026-03-01\
&toDate=2026-04-20" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Cursor-paginated limit hits per date per user.

- **application/json** (LimitHitsByUserCollection): A cursor-paginated collection of limit hits per date per user, sorted by AI credits consumed.
- **nextCursor** (string | null, required): The anchor for retrieving the next page. If null, there are no more pages.
- **items** (Array of LimitHitByUser, required)
- **date** (string date, required): The date of the limit hit.
- **user** (User, required): The information about the user.
- **id** (string, required): The unique identifier of the user.
- **name** (string, required): The user's full name.
- **email** (string email | null): The user's email address.
- **creditsUsed** (number decimal, required): The number of AI credits used by the user on the date.

**200**

```JSON
{
  "nextCursor": "1250.75,b3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e",
  "items": [
    {
      "date": "2026-03-20",
      "user": {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "name": "Anna Kowalski",
        "email": "anna.kowalski@jetbrains.com"
      },
      "creditsUsed": 1482.50
    },
    {
      "date": "2026-03-18",
      "user": {
        "id": "b3c4d5e6-f7a8-9b0c-1d2e-3f4a5b6c7d8e",
        "name": "Emma Novak",
        "email": "emma.novak@jetbrains.com"
      },
      "creditsUsed": 1250.75
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get limit hit metrics by principal and date

> **Note:**
> To learn more about types of entities that are classified as principals, see [Principal](ai-governance.html#principal).

> **Warning: Deprecated endpoint**
> This endpoint is deprecated. Use the [equivalent API v2 endpoint](analytics-api-v2.html#get-limit-hit-metrics-by-principal-and-date-v2) instead.

OpenAPI endpoint: GET /api/v1/adoption/limit-hits/group-by/date-principal.cursor

Get a cursor-paginated list of limit hits for each date and principal within a specified date range. When `sortKey` is `date` (default), sorting is done by date first, then by principal ID. When `sortKey` is `name`, sorting is done by principal name first, then by date. Filters for `principalIds` and `principalType` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **principalIds** (string): A comma-separated list of principal IDs to filter by.
- **principalType** (Enum): The type of principal to filter by. Available values:

user

serviceAccount
- **user**
- **serviceAccount**
- **USER**
- **SERVICE_ACCOUNT**
- **cursor** (string): The pagination cursor. Use the nextCursor value from the previous response. When nextCursor is null, there are no more pages.
- **limit** (integer): The number of records to show per page.
- **sortOrder** (Enum): The sorting order for the results. The default sorting order is descending.
- **asc**
- **desc**
- **ASC**
- **DESC**
- **sortKey** (Enum): The key to sort the results by. Default value is date. Available values are:

date, DATE

name, NAME
- **date**
- **name**
- **DATE**
- **NAME**

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/date-principal.cursor
    ?fromDate=2026-03-01
    &toDate=2026-04-20
    &principalType=user
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl -X GET "https://api.jetbrains.cloud/metrics/api/v1/adoption/limit-hits/group-by/date-principal.cursor\
?fromDate=2026-03-01 \
&toDate=2026-04-20 \
&principalType=user" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Cursor-paginated limit hits per date per principal.

- **application/json** (LimitHitsByDatePrincipalCollection): A cursor-paginated collection of limit hits per date per principal.
- **nextCursor** (string | null, required): The anchor for retrieving the next page. If null, there are no more pages.
- **items** (Array of LimitHitByDatePrincipal, required)
- **date** (string date, required): The date of the limit hit.
- **principal** (Principal, required): The information about the principal.
- **id** (string, required): The unique identifier of the principal.
- **name** (string, required): The name of the principal.

**200**

```JSON
{
  "nextCursor": null,
  "items": [
    {
      "date": "2026-04-16",
      "principal": {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "name": "service-account service-account"
      }
    },
    {
      "date": "2026-04-05",
      "principal": {
        "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "name": "Jane Smith"
      }
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

### Activity and impact

#### Get total AI activity and impact metrics

OpenAPI endpoint: GET /api/v1/effectiveness/totals

Get total AI activity and impact metrics. The metrics include suggested and accepted lines of code, as well as the number of invocations of AI tools. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **tool** (string): A comma-separated list of tools to filter by. Available tools:

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

pi (Pi Coding Agent)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/effectiveness/totals
    ?fromDate=2026-02-01
    &toDate=2026-03-31
    &tool=junie
    &ide=idea
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/effectiveness/totals\
?fromDate=2026-02-01\
&toDate=2026-03-31\
&tool=junie\
&ide=idea" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Total AI activity and impact metrics.

- **application/json** (EffectivenessMetricsData)
- **suggested** (integer, required): The number of suggested lines of code.
- **accepted** (integer, required): The number of accepted lines of code.
- **invocations** (integer, required): The number of AI tool invocations. For AI tools, invocations are measured as the number of messages sent through AI chat. For in-editor features, interactions are measured as the number of suggestions shown to the user.

**200**

```JSON
{
  "suggested": 77154,
  "accepted": 49434,
  "invocations": 25278
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get AI activity and impact metrics by date

OpenAPI endpoint: GET /api/v1/effectiveness/group-by/date

Get AI activity and impact metrics for the specified date range, grouped by date. The metrics include suggested and accepted lines of code, as well as the number of invocations of AI tools. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **groupBy** (Enum): The time frame to group the data by. When grouping by week, month, or year, the date in the response represents the start of the period. Available values:

day

week

month

year
- **day**
- **week**
- **month**
- **year**
- **tool** (string): A comma-separated list of tools to filter by. Available tools:

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

pi (Pi Coding Agent)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/effectiveness/group-by/date
    ?fromDate=2025-11-17
    &toDate=2025-11-30
    &tool=junie
    &groupBy=week
    &ide=idea
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/effectiveness/group-by/date\
?fromDate=2025-11-17\
&toDate=2025-11-30\
&tool=junie\
&groupBy=week\
&ide=idea" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

AI activity and impact metrics for the specified date range, grouped by date.

- **application/json** (EffectivenessMetricsCollection): A collection of AI activity and impact metrics grouped by date, including per-date data points and totals for the specified date range.
- **totals** (EffectivenessMetricsData, required): Total metrics for the specified date range.
- **suggested** (integer, required): The number of suggested lines of code.
- **accepted** (integer, required): The number of accepted lines of code.
- **invocations** (integer, required): The number of AI tool invocations. For AI tools, invocations are measured as the number of messages sent through AI chat. For in-editor features, interactions are measured as the number of suggestions shown to the user.
- **items** (Array of EffectivenessMetricsDataPoint, required): AI activity and impact data points for the specified date range.
- **metrics** (EffectivenessMetricsData, required)
- **suggested** (integer, required): The number of suggested lines of code.
- **accepted** (integer, required): The number of accepted lines of code.
- **invocations** (integer, required): The number of AI tool invocations. For AI tools, invocations are measured as the number of messages sent through AI chat. For in-editor features, interactions are measured as the number of suggestions shown to the user.
- **date** (string date, required): The date for the AI activity and impact metrics.

**200**

```JSON
{
  "totals": {
    "suggested": 77821,
    "accepted": 27052,
    "invocations": 34422
  },
  "items": [
    {
      "metrics": {
        "suggested": 41005,
        "accepted": 14363,
        "invocations": 17221
      },
      "date": "2025-11-17"
    },
    {
      "metrics": {
        "suggested": 36816,
        "accepted": 12689,
        "invocations": 17201
      },
      "date": "2025-11-24"
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get AI activity and impact metrics by date and tool

OpenAPI endpoint: GET /api/v1/effectiveness/group-by/date-feature

Get a detailed breakdown of AI activity (suggestions, acceptances, and invocations) grouped by both date and specific AI feature such as AI Assistant or Code Completion. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **groupBy** (Enum): The time frame to group the data by. When grouping by week, month, or year, the date in the response represents the start of the period. Available values:

day

week

month

year
- **day**
- **week**
- **month**
- **year**
- **tool** (string): A comma-separated list of tools to filter by. Available tools:

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

pi (Pi Coding Agent)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/effectiveness/group-by/date-feature
    ?fromDate=2025-11-17
    &toDate=2025-11-30
    &tool=claude_agent
    &groupBy=week
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/effectiveness/group-by/date-feature\
?fromDate=2025-11-17\
&toDate=2025-11-30\
&tool=claude_agent\
&groupBy=week" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

AI activity and impact metrics by date and tool.

- **application/json** (EffectivenessMetricsByFeatureCollection): A collection of AI activity and impact metrics grouped by date and feature, including per-date breakdowns and totals.
- **totals** (Array of FeatureEffectivenessMetricsData, required): Total AI activity and impact metrics, grouped by tool.
- **feature** (Enum, required): The name of the AI tool or feature. Available values:

aia (AI Assistant)

junie (Junie)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

pi (Pi Coding Agent)

copilot (Copilot)

nes (Next edit suggestions)

code_completion (Code Completion)
- **aia**
- **junie**
- **claude_agent**
- **codex_agent**
- **gemini_agent**
- **pi**
- **copilot**
- **nes**
- **code_completion**
- **metrics** (EffectivenessMetricsData, required)
- **suggested** (integer, required): The number of suggested lines of code.
- **accepted** (integer, required): The number of accepted lines of code.
- **invocations** (integer, required): The number of AI tool invocations. For AI tools, invocations are measured as the number of messages sent through AI chat. For in-editor features, interactions are measured as the number of suggestions shown to the user.
- **items** (Array of EffectivenessMetricsByFeatureDataPoint, required)
- **tools** (Array of FeatureEffectivenessMetricsData, required)
- **feature** (Enum, required): The name of the AI tool or feature. Available values:

aia (AI Assistant)

junie (Junie)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

pi (Pi Coding Agent)

copilot (Copilot)

nes (Next edit suggestions)

code_completion (Code Completion)
- **aia**
- **junie**
- **claude_agent**
- **codex_agent**
- **gemini_agent**
- **pi**
- **copilot**
- **nes**
- **code_completion**
- **metrics** (EffectivenessMetricsData, required)
- **suggested** (integer, required): The number of suggested lines of code.
- **accepted** (integer, required): The number of accepted lines of code.
- **invocations** (integer, required): The number of AI tool invocations. For AI tools, invocations are measured as the number of messages sent through AI chat. For in-editor features, interactions are measured as the number of suggestions shown to the user.
- **date** (string date, required): The date for the AI activity and impact metrics.

**200**

```JSON
{
  "totals": [
    {
      "feature": "claude_agent",
      "metrics": {
        "suggested": 794131,
        "accepted": 281302,
        "invocations": 10741
      }
    }
  ],
  "items": [
    {
      "tools": [
        {
          "feature": "claude_agent",
          "metrics": {
            "suggested": 402533,
            "accepted": 143956,
            "invocations": 5622
          }
        }
      ],
      "date": "2025-11-17"
    },
    {
      "tools": [
        {
          "feature": "claude_agent",
          "metrics": {
            "suggested": 391598,
            "accepted": 137346,
            "invocations": 5119
          }
        }
      ],
      "date": "2025-11-24"
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get AI activity and impact metrics by user

OpenAPI endpoint: GET /api/v1/effectiveness/group-by/user.cursor

Get per-user AI activity and impact metrics for the specified date range. Each result item represents one specific combination of: a user, a date, and an AI tool. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **tool** (string): A comma-separated list of tools to filter by. Available tools:

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

pi (Pi Coding Agent)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)
- **cursor** (string): The pagination cursor. Use the nextCursor value from the previous response. When nextCursor is null, there are no more pages.
- **limit** (integer): The number of records to show per page.
- **sortOrder** (Enum): The sorting order for the results. The default sorting order is ascending.
- **asc**
- **desc**
- **ASC**
- **DESC**

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/effectiveness/group-by/user.cursor
    ?fromDate=2025-11-24
    &toDate=2025-11-30
    &tool=junie
    &userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d
    &cursor=2025-11-28,1a2b3c4d-5e6f-7485-9607-18293a4b5c6d,junie
    &limit=2
    &sortOrder=DESC
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/effectiveness/group-by/user.cursor\
?fromDate=2025-11-24\
&toDate=2025-11-30\
&tool=junie\
&userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d\
&cursor=2025-11-28,1a2b3c4d-5e6f-7485-9607-18293a4b5c6d,junie\
&limit=2\
&sortOrder=DESC" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Per-user AI activity and impact metrics for the specified date range.

- **application/json** (EffectivenessMetricsByUserCollection): A cursor-paginated collection of AI activity and impact metrics per user.
- **nextCursor** (string, required): The anchor for retrieving the next page. If null, there are no more pages.
- **items** (Array of UserEffectivenessMetricsData, required)
- **user** (User, required): The details about the user.
- **id** (string, required): The unique identifier of the user.
- **name** (string, required): The user's full name.
- **email** (string email | null): The user's email address.
- **date** (string date, required): The date for the AI activity and impact metrics.
- **feature** (string, required): The name of the AI tool or feature that the user used.
- **metrics** (EffectivenessMetricsData, required)
- **suggested** (integer, required): The number of suggested lines of code.
- **accepted** (integer, required): The number of accepted lines of code.
- **invocations** (integer, required): The number of AI tool invocations. For AI tools, invocations are measured as the number of messages sent through AI chat. For in-editor features, interactions are measured as the number of suggestions shown to the user.

**200**

```JSON
{
  "nextCursor": "2025-11-24,1a2b3c4d-5e6f-7485-9607-18293a4b5c6d,junie",
  "items": [
    {
      "user": {
        "id": "1a2b3c4d-5e6f-7485-9607-18293a4b5c6d",
        "name": "Mike Lee",
        "email": "mike.lee@jetbrains.com"
      },
      "date": "2025-11-26",
      "feature": "junie",
      "metrics": {
        "suggested": 2595,
        "accepted": 1150,
        "invocations": 5
      }
    },
    {
      "user": {
        "id": "1a2b3c4d-5e6f-7485-9607-18293a4b5c6d",
        "name": "Mike Lee",
        "email": "mike.lee@jetbrains.com"
      },
      "date": "2025-11-24",
      "feature": "junie",
      "metrics": {
        "suggested": 2069,
        "accepted": 1120,
        "invocations": 26
      }
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

### Credit consumption

#### Get AI credit consumption data by user

OpenAPI endpoint: GET /api/v1/credits-usage/group-by/user.paged

Get a paginated list of total AI credits consumption for each user within the specified date range. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **tool** (string): A comma-separated list of AI tools to filter by. Available tools:

aia (AI Assistant)

junie (Junie)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

opencode_agent (OpenCode Agent)

pi (Pi Coding Agent)

copilot (Copilot)

other (Other AI tools)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)
- **page** (integer): The number of the page to get.
- **limit** (integer): The number of records to show per page.
- **sortKey** (Enum): The key to sort the results by. Sorted by usage in descending order by default.
- **user**
- **usage**
- **USER**
- **USAGE**
- **sortOrder** (Enum): The sorting order for the results. The default sorting order is ascending.
- **asc**
- **desc**
- **ASC**
- **DESC**

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/credits-usage/group-by/user.paged
    ?fromDate=2025-11-17
    &toDate=2025-11-30
    &tool=junie
    &userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d,a1b2c3d4-e5f6-4758-6970-8192a3b4c5d6
    &page=1
    &limit=2
    &sortKey=user
    &sortOrder=DESC
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/credits-usage/group-by/user.paged\
?fromDate=2025-11-17\
&toDate=2025-11-30\
&tool=junie\
&userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d,a1b2c3d4-e5f6-4758-6970-8192a3b4c5d6\
&page=1\
&limit=2\
&sortKey=user\
&sortOrder=DESC" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

A paginated list of AI credits usage data per user.

- **application/json** (UserCreditsUsageCollectionPaged): A paginated collection of total AI credits consumption data per user.
- **items** (Array of UserCreditsUsageData, required)
- **user** (User, required): The detailed information about the user.
- **id** (string, required): The unique identifier of the user.
- **name** (string, required): The user's full name.
- **email** (string email | null): The user's email address.
- **usage** (UsageData, required): The total AI credits consumption for the user.
- **total** (number double, required): Total AI credits consumption for the user.
- **page** (integer, required): Current page number.
- **total** (integer, required): The total number of returned records across all pages.

**200**

```JSON
{
  "items": [
    {
      "user": {
        "id": "1a2b3c4d-5e6f-7485-9607-18293a4b5c6d",
        "name": "Mike Lee",
        "email": "mike.lee@jetbrains.com"
      },
      "usage": {
        "total": 22.39
      }
    },
    {
      "user": {
        "id": "a1b2c3d4-e5f6-4758-6970-8192a3b4c5d6",
        "name": "Jess Hoffler",
        "email": "jess.hoffler@jetbrains.com"
      },
      "usage": {
        "total": 15.53
      }
    }
  ],
  "page": 1,
  "total": 2
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get AI credit consumption data by tool

OpenAPI endpoint: GET /api/v1/credits-usage/group-by/tool

Get AI credits usage data grouped by tool for the specified date range. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **tool** (string): A comma-separated list of AI tools to filter by. Available tools:

aia (AI Assistant)

junie (Junie)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

opencode_agent (OpenCode Agent)

pi (Pi Coding Agent)

copilot (Copilot)

other (Other AI tools)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/credits-usage/group-by/tool
    ?fromDate=2025-11-17
    &toDate=2025-11-30
    &tool=aia
    &userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/credits-usage/group-by/tool\
?fromDate=2025-11-17\
&toDate=2025-11-30\
&tool=aia\
&userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

AI credits usage grouped by tool.

- **application/json** (CreditsUsageByToolCollection): A collection of AI credits usage data grouped by tool.
- **items** (Array of ToolUsageData, required)
- **tool** (string, required): The name of the tool.
- **tariff** (number double, required): Built-in quota usage for the user, expressed in AI credits. For more information, see AI quota.
- **topup** (number double, required): Top-up AI credits usage for the user. For more information, see Top-up AI credits.

**200**

```JSON
{
  "items": [
    {
      "tool": "aia",
      "tariff": 177149.31,
      "topup": 75937.31
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get AI credit consumption data by user and tool

OpenAPI endpoint: GET /api/v1/credits-usage/group-by/user-tool.paged

Get a paginated list of AI credits consumption data per user and tool. Returns a breakdown of AI credits per tool per user, whereas the `/api/v1/credits-usage/group-by/user.paged` endpoint returns a single total per user. Filters for `tool`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **tool** (string): A comma-separated list of AI tools to filter by. Available tools:

aia (AI Assistant)

junie (Junie)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

opencode_agent (OpenCode Agent)

pi (Pi Coding Agent)

copilot (Copilot)

other (Other AI tools)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)
- **page** (integer): The number of the page to get.
- **limit** (integer): The number of records to show per page.
- **sortKey** (Enum): The key to sort the results by. Sorted by usage in descending order by default.
- **user**
- **usage**
- **USER**
- **USAGE**
- **sortOrder** (Enum): The sorting order for the results. The default sorting order is ascending.
- **asc**
- **desc**
- **ASC**
- **DESC**

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/credits-usage/group-by/user-tool.paged
    ?fromDate=2025-11-17
    &toDate=2025-11-30
    &tool=junie
    &userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d,a1b2c3d4-e5f6-4758-6970-8192a3b4c5d6
    &page=1
    &limit=2
    &sortKey=user
    &sortOrder=ASC
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/credits-usage/group-by/user-tool.paged\
?fromDate=2025-11-17\
&toDate=2025-11-30\
&tool=junie\
&userIds=1a2b3c4d-5e6f-7485-9607-18293a4b5c6d,a1b2c3d4-e5f6-4758-6970-8192a3b4c5d6\
&page=1\
&limit=2\
&sortKey=user\
&sortOrder=ASC" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

A paginated list of AI credits usage data grouped by user and tool.

- **application/json** (UserCreditsUsageByToolCollectionPaged): A paginated collection of AI credits consumption data per user, broken down by tool.
- **items** (Array of UserCreditsUsageByToolData, required)
- **user** (User, required): The detailed information about the user.
- **id** (string, required): The unique identifier of the user.
- **name** (string, required): The user's full name.
- **email** (string email | null): The user's email address.
- **items** (Array of ToolUsageData, required)
- **tool** (string, required): The name of the tool.
- **tariff** (number double, required): Built-in quota usage for the user, expressed in AI credits. For more information, see AI quota.
- **topup** (number double, required): Top-up AI credits usage for the user. For more information, see Top-up AI credits.
- **page** (integer, required): Current page number.
- **total** (integer, required): Total number of records across all pages.

**200**

```JSON
{
  "items": [
    {
      "user": {
        "id": "1a2b3c4d-5e6f-7485-9607-18293a4b5c6d",
        "name": "Mike Lee",
        "email": "mike.lee@jetbrains.com"
      },
      "items": [
        {
          "tool": "junie",
          "tariff": 15.98,
          "topup": 4.64
        }
      ]
    },
    {
      "user": {
        "id": "a1b2c3d4-e5f6-4758-6970-8192a3b4c5d6",
        "name": "Jess Hoffler",
        "email": "jess.hoffler@jetbrains.com"
      },
      "items": [
        {
          "tool": "junie",
          "tariff": 11.8,
          "topup": 4.46
        }
      ]
    }
  ],
  "page": 1,
  "total": 141
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

### Code provenance

#### Get code provenance metrics by date and feature

OpenAPI endpoint: GET /api/v1/code-provenance/group-by/date-feature

Get the number of lines generated by humans or AI tools, and time saved by AI within a specified date range, grouped by date and feature. Filters for `feature`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **groupBy** (Enum): The time frame to group the data by. When grouping by week, month, or year, the date in the response represents the start of the period. Available values:

day

week

month

year
- **day**
- **week**
- **month**
- **year**
- **feature** (string): A comma-separated list of features to filter by. Available features:

human (human-written lines)

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)

other (Other AI tools)

uncategorized (Unknown source)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/code-provenance/group-by/date-feature
    ?fromDate=2026-03-24
    &toDate=2026-03-31
    &groupBy=week
    &feature=junie
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/code-provenance/group-by/date-feature\
?fromDate=2026-03-24\
&toDate=2026-03-31\
&groupBy=week\
&feature=junie" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Code provenance metrics grouped by date and feature.

- **application/json** (CodeProvenanceByFeatureCollection)
- **totals** (Array of CodeProvenanceFeatureData, required): Total number of generated lines and time saved by feature.
- **feature** (Enum, required): The name of the feature. Available features:

human (human-written lines)

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)

other (Other AI tools)

uncategorized (Unknown source)
- **human**
- **junie**
- **aia**
- **claude_agent**
- **codex_agent**
- **gemini_agent**
- **copilot**
- **code_completion**
- **nes**
- **other**
- **uncategorized**
- **loc** (integer, required): Lines of code attributed to the feature.
- **timeSavedS** (integer, required): Time saved in seconds compared to writing code manually. Applies only to AI features.
- **items** (Array of CodeProvenanceByFeatureDataPoint, required): Individual data points for code provenance metrics.
- **date** (string date, required): The date for the code provenance metrics.
- **features** (Array of CodeProvenanceFeatureData, required): Code provenance metrics for each feature.
- **feature** (Enum, required): The name of the feature. Available features:

human (human-written lines)

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)

other (Other AI tools)

uncategorized (Unknown source)
- **human**
- **junie**
- **aia**
- **claude_agent**
- **codex_agent**
- **gemini_agent**
- **copilot**
- **code_completion**
- **nes**
- **other**
- **uncategorized**
- **loc** (integer, required): Lines of code attributed to the feature.
- **timeSavedS** (integer, required): Time saved in seconds compared to writing code manually. Applies only to AI features.

**200**

```JSON
{
  "totals": [
    {
      "feature": "junie",
      "loc": 302221,
      "timeSavedS": 211556
    }
  ],
  "items": [
    {
      "date": "2026-03-23",
      "features": [
        {
          "feature": "junie",
          "loc": 265595,
          "timeSavedS": 183946
        }
      ]
    },
    {
      "date": "2026-03-30",
      "features": [
        {
          "feature": "junie",
          "loc": 36626,
          "timeSavedS": 27610
        }
      ]
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

#### Get total code provenance metrics

OpenAPI endpoint: GET /api/v1/code-provenance/totals

Get the total number of lines generated by humans or AI tools, and time saved within a specified date  range, grouped by feature. Filters for `feature`, `userIds`, `userEmails`, and `ide` are applied together (the API returns only records that match all criteria).

##### Request parameters

**Request**

Security

- **HTTP** (Bearer): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

Query

- **fromDate** (string date, required): The starting date to filter the data from (ISO 8601 format). The returned result includes data for the specified date.
- **toDate** (string date, required): The end date to filter the data to (ISO 8601 format). The returned result includes data for the specified date.
- **feature** (string): A comma-separated list of features to filter by. Available features:

human (human-written lines)

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)

other (Other AI tools)

uncategorized (Unknown source)
- **userIds** (string): A comma-separated list of user IDs to filter by. If not used or left blank, the data for all users is returned.
- **userEmails** (string): A comma-separated list of user emails to filter by. If not used or left blank, the data for all users is returned.
- **ide** (string): A comma-separated list of IDEs to filter by. Available values:

air (Air)

air_cloud (Air Cloud)

air_automations (Air Automations)

clion (CLion)

datagrip (DataGrip)

dataspell (DataSpell)

goland (GoLand)

idea (IntelliJ IDEA)

phpstorm (PhpStorm)

pycharm (PyCharm)

rider (Rider)

rubymine (RubyMine)

rustrover (RustRover)

webstorm (WebStorm)

wire (JetBrains Central CLI)

unknown (Unknown)

Header

- **Authorization** (string, required): Bearer token used for authentication. Provide as Bearer <ACCESS_TOKEN> in the Authorization header.

**HTTP**

```HTTP_REQUEST
GET https://api.jetbrains.cloud/metrics/api/v1/code-provenance/totals
    ?fromDate=2026-03-01
    &toDate=2026-04-01
    &feature=aia,junie
    &ide=idea
Accept: application/json
Authorization: Bearer <ACCESS_TOKEN>
```

**cURL**

```BASH
curl "https://api.jetbrains.cloud/metrics/api/v1/code-provenance/totals\
?fromDate=2026-03-01\
&toDate=2026-04-01\
&feature=aia,junie\
&ide=idea" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
```

##### Responses

**Response 200**

Content type: application/json

Total code provenance metrics by feature.

- **application/json** (CodeProvenanceTotalsCollection): A collection of total code provenance metrics grouped by feature.
- **totals** (Array of CodeProvenanceFeatureData, required)
- **feature** (Enum, required): The name of the feature. Available features:

human (human-written lines)

junie (Junie)

aia (AI Assistant)

claude_agent (Claude Agent)

codex_agent (Codex)

gemini_agent (Gemini)

copilot (Copilot)

code_completion (Code Completion)

nes (Next edit suggestions)

other (Other AI tools)

uncategorized (Unknown source)
- **human**
- **junie**
- **aia**
- **claude_agent**
- **codex_agent**
- **gemini_agent**
- **copilot**
- **code_completion**
- **nes**
- **other**
- **uncategorized**
- **loc** (integer, required): Lines of code attributed to the feature.
- **timeSavedS** (integer, required): Time saved in seconds compared to writing code manually. Applies only to AI features.

**200**

```JSON
{
  "totals": [
    {
      "feature": "aia",
      "loc": 161313,
      "timeSavedS": 93705
    },
    {
      "feature": "junie",
      "loc": 164368,
      "timeSavedS": 99292
    }
  ]
}
```

**Response 401**

Unauthorized. Missing or invalid authentication token.

**Response 400**

Bad Request. Invalid query parameters.

