Usage Metrics API

Programmatic access to usage metrics across an organization

The Usage API (released with 5.18.0) provides programmatic access to usage metrics across an organization. It complements existing enterprise reporting options—UI-based usage reports and CSV exports—by enabling integration into internal dashboards and tools via API.

The Usage API is available to all Enterprise customers on both Enterprise SaaS (console.tabnine.com) and Private Installations.

The APIs return JSON with parameter details and example responses.

OpenAPI reference

Organization

Get current organization ID and high-level settings

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
chevron-right
200

Successful response with organization structure.

application/json
publicKeystringOptional

Public key in PEM format.

samlEnabledbooleanOptional
smtpConfiguredbooleanOptional
usernamePasswordEnabledbooleanOptional
namestringRequired
domainsstring[]Optional
planTypestringOptional
idstringRequired
GET
/api/v1/organization

Get list of teams for the given organization

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
offsetintegerOptional

Skips a number of items before starting to return results.

Default: 0
limitintegerOptional

Maximum number of items to return.

Default: 0
Responses
chevron-right
200

Successful response with list of teams.

application/json
GET
/api/v1/organization/teams

Get account utilization info (monthly)

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
startDatestringOptional

Start date for showing utilization (YYYY-MM). Default: last 12 months.

Example: 2025-01Pattern: ^\d{4}-\d{2}$
Responses
chevron-right
200

Successful response with monthly utilization array.

application/json
yearinteger · min: 1970Required
monthinteger · max: 11Required

Zero-based month (0=January, 11=December).

registeredintegerRequired
deactivatedintegerRequired
activeintegerRequired
pendingintegerRequired
GET
/api/v1/organization/account-utilizations

Get organization-level usage

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
organizationIdstringRequired

The unique identifier of the organization

fromstring · date-timeRequired

Filter usage data from this date (ISO 8601).

tostring · date-timeRequired

Filter usage data until this date (ISO 8601).

granularitystring · enumRequired

Time resolution at which usage data is aggregated and returned.

Possible values:
Responses
chevron-right
200

Successful response with organization usage data.

application/json
organizationIdstringRequired
fromstring · date-timeRequired
tostring · date-timeRequired
GET
/api/v1/organization/usage

Get users who are not assigned to a team

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
offsetintegerRequired

Skips a number of items before starting to return results.

limitintegerRequired

Maximum number of items to return.

teamMemberbooleanRequired

Use false for users not assigned to a team.

Example: false
activebooleanRequired

Use true for registered users (false for deactivated users).

Example: true
Responses
chevron-right
200

Successful response with users.

application/json
GET
/api/v1/organization/users

License & permissions

Get license info

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
chevron-right
200

Successful response with license info.

application/json
GET
/api/v1/license

Get account permissions info (list of account admins)

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
rolestringRequiredExample: Admin
Responses
chevron-right
200

Successful response with users for the given role.

application/json
usernamestringRequired
organizationIdstringRequired
GET
/api/v1/instance/permissions

Team-level

Get users of a given team

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
teamIdstringRequired
Query parameters
offsetintegerRequired

Skips a number of items before starting to return results.

limitintegerRequired

Maximum number of items to return.

Responses
chevron-right
200

Successful response with users for the team.

application/json
GET
/api/v1/team/{teamId}/users

Get current team utilization info

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
teamIdstringRequired
Responses
chevron-right
200

Successful response with team utilization counts.

application/json
registeredintegerRequired
deactivatedintegerRequired
invitedintegerRequired
GET
/api/v1/team/account-utilizations

Get team name

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
teamIdstringRequired
Responses
chevron-right
200

Successful response with team info.

application/json
idstringRequired
namestringRequired
GET
/api/v1/team/{teamId}

Team-level usage

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
organizationIdstringRequired
teamIdstringRequired
fromstring · date-timeRequired

Filter usage data from this date (ISO 8601).

tostring · date-timeRequired

Filter usage data until this date (ISO 8601).

granularitystring · enumRequired

Time resolution at which usage data is aggregated and returned.

Possible values:
Responses
chevron-right
200

Successful response with team usage data.

application/json
organizationIdstringRequired
teamIdstringRequired
fromstring · date-timeRequired
tostring · date-timeRequired
GET
/api/v1/team/usage

User-level

User-level info

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
user_idstringRequired
Responses
chevron-right
200

Successful response with user info.

application/json
GET
/api/v1/user/{user_id}

User-level usage

GET
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
organizationIdstringRequired
userIdstringRequired
fromstring · date-timeRequired

Filter usage data from this date (ISO 8601).

tostring · date-timeRequired

Filter usage data until this date (ISO 8601).

granularitystring · enumRequired

Time resolution at which usage data is aggregated and returned.

Possible values:
Responses
chevron-right
200

Successful response with user usage data.

application/json
organizationIdstringRequired
userIdstringRequired
fromstring · date-timeRequired
tostring · date-timeRequired
GET
/api/v1/user/usage

API Categories

The Usage API can retrieve the following information:

  • Organization & Teams

    • Get organization and team IDs

    • List organization teams

    • List users from each team

  • Usage Metrics

    • Active users

    • Account utilization

    • Productivity factor

    • Automation factor

    • Usage volumes for:

      • Code Completions

      • Chat Interactions

List of Implemented APIs

APIs return JSON with parameter details and example responses:

Organization-Level Info APIs and Usage APIs

  1. Get current organization ID and high-level settings

  2. Get list of teams for given organization

  3. Get license info

  4. Get account utilization info

  5. Get account permissions info

  6. Get organization-level usage

Team-Level Info APIs

  1. Get users of a given team

  2. Get users that aren't assigned to a team

  3. Get current utilization info

  4. Get team name

  5. Team Level Usage API

Last updated

Was this helpful?