LogoLogo
Tabnine websiteContact Sales
  • πŸ‘‹Welcome
    • Overview
      • Architecture
        • Deployment options
      • Security
      • Privacy
      • Protection
        • Provenance and Attribution
      • Personalization
        • Tabnine’s Personalization in Depth
        • Connection: Global Codebase Awareness
      • AI Models
        • Tabnine's private and protected Universal models
        • Tabnine's fine-tuned AI models
      • Integrations
        • Atlassian Jira
      • System Requirements
      • Supported Languages
      • Supported IDEs
      • Tabnine Subscription Plans
        • Dev Preview
        • Dev
        • Pro
        • Enterprise (SaaS)
        • Enterprise (private installation)
    • Support & Feedback
  • πŸš€Getting started
    • Install
      • Client setup (SaaS)
        • VS Code
          • Install Tabnine in VS Code
          • Activate Tabnine in VS Code
        • JetBrains IDEs
          • Install Tabnine in a JetBrains IDE
          • Activate Tabnine in a JetBrains IDE
        • Visual Studio
          • Install Tabnine in Visual Studio 2022
          • Activate Tabnine in Visual Studio 2022
        • Eclipse
          • Install Tabnine in Eclipse
          • Activate Tabnine in Eclipse
        • Sign in
          • Using an email
          • Using an authentication token
      • Client setup (private installation)
        • Join your team (private installation)
        • VS Code (private installation)
        • JetBrains IDEs (private installation)
        • Visual Studio (private installation)
        • Eclipse (private installation)
    • Quickstart Guide
      • Menus and Icons
    • Getting the Most from Tabnine Code Completions
      • Pause (snooze)
    • Getting the Most from Inline Actions
    • Getting the Most from Tabnine Chat
      • Launching Tabnine Chat
      • Interacting with Tabnine Chat
      • Reviewing suggestions
      • Writing prompts
      • Chat Context
        • Understanding Context
        • Jira Connection
        • Context Scoping
      • Conversing with Tabnine Chat
      • Switching between chat AI models
      • Image Prompts
      • Tabnine's Prompting Guide
        • Getting Started
        • Basic Prompting
          • Be specific and clear
          • Define the context
          • Start a fresh conversation as appropriate
          • Include necessary details
          • Ask for examples
          • Be concise but complete
  • πŸ’ͺSoftware Development with Tabnine
    • Overview
    • Plan
    • Create
    • Test
      • Intro to the Test Agent
      • Test Agent Workflow
      • Custom Commands
      • Generate Test Files with @Mentions
    • Review
    • Fix
    • Document
    • Explain
    • Maintain
  • 🏭Administering Tabnine
    • Start a team
    • Manage a team
    • SaaS
      • Tabnine Pro team admin
        • Purchase Tabnine Pro
        • Adding and inviting users to Tabnine Pro
        • Assigning an admin role to a team member
        • Removing a team member
        • Tabnine Pro: Manage subscription and billing
        • Tabnine Pro - Change your payment method
        • Tabnine Pro - Change plan from monthly to annual
        • Unsubscribe from Tabnine Pro plan
      • Joining a Tabnine Pro team
      • Enterprise (SaaS) team admin
        • Set up a Tabnine Enterprise (SaaS) account
        • Invite team members
        • Manage your team
        • AI models for Chat (Enterprise SaaS)
      • Enterprise (SaaS) team member
        • Join your Tabnine team by invitation email (team member)
        • Join Tabnine team by link (member)
    • Private installation
      • Server setup guide
        • Kubernetes (MicroK8s) Installation guide
        • Deployment guide
          • Tabnine update guide
        • Air-gapped deployment guide
      • Admin guide
        • Monitoring Tabnine
        • Prometheus Operator install
        • Audit logs
      • Managing your team
        • Tabnine teams
        • Roles in an enterprise
        • Inviting users to your team
        • Deactivating and reactivating users
        • Deleting PII data of a deactivated user
        • Reset user's password
        • Usage reports
          • Reports Glossary
          • CSV-based reports (V2)
            • Configuring scheduled CSV reports
            • CSV-based reports V1 (Depracted since version 5.7.0
          • Usage API
        • Settings
          • General
          • Single Sign-On (SSO)
          • Personalization (f.k.a. Workspace)
            • Connecting to Remote Repositories
          • Email
          • License
          • Models
          • Access Tokens
        • IdP Sync
      • Release Notes
  • πŸ“£Product Updates
    • What's new?
      • What's new? (August 2024)
      • What's new? (July 2024)
      • What's new? (June 2024)
      • What's new? (May 2024)
      • What's new? (April 2024)
      • What's new? (March 2024)
      • What's new? (February 2024)
      • What's new? (January 2024)
Powered by GitBook
On this page
  • Enabling Usage API
  • List of Implemented APIs

Was this helpful?

  1. Administering Tabnine
  2. Private installation
  3. Managing your team
  4. Usage reports

Usage API

The Usage API provides programmatic access to usage metrics across an organization

Last updated 20 days ago

Was this helpful?

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 SaaS (console.tabnine.com) and Private installations.

The APIs return JSON with parameter details and example responses.

Enabling Usage API

Only users with Admin access to Tabnine can access the Usage API. This is done by navigating to Settings, then Access Tokens.

Navigate to the top righthand corner and click Generate token.

A new Generate New Token window.

Type in the Token Description, then press the blue Generate Token button.

You can only access this token at this point. Once you hit Close, you will no longer be able to access this particular token.

If you need to access a new token, you can generate a new token. If the token you intended to use was lost (for example, copied and next pasted), you should revoke that token by hitting πŸ—‘οΈ Revoke.

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:

Organizational 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

Organization-Level APIs

Get current organization ID and high-level settings

Endpoint:

GET /api/v1/organization

Parameters:

Parameter
Type
Required?
Description

-

-

-

-

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

{
    "publicKey": "-----BEGIN PUBLIC KEY-----\nMIICIXXXXXXAAQ==\n-----END PUBLIC KEY-----\n",
    "samlEnabled": false,
    "smtpConfigured": true,
    "usernamePasswordEnabled": true,
    "name": "Yagel",
    "domains": [
        "tabnine.com"
    ],
    "planType": "Enterprise",
    "id": "9a3895ca-1c27-4231-8978-85ae00267d02"
}

Get list of teams for a given organization

Endpoint:

GET /api/v1/organization/teams/?offset=0&limit=0

Parameters:

Parameter

Type

Required

Description

limit

string (non-negative integer)

⨉ (optional)

Specifies the maximum number of items to return. (Example: limit=10 returns only 10 items)

offset

string

⨉

Skips a number of items before starting to return results.(Example: offset=20 skips the first 20 items and starts from item 21)

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

{
    "data": [
        {
            "id": "XXXXXXXXXXXXX",
            "name": "FE team",
            "usersCount": 6,
            "isDefaultTeam": false
        },
        {
            "id": "YYYYYYYYYYYY",
            "name": "Default Team",
            "usersCount": 0,
            "isDefaultTeam": true
        },
        {
            "id": "ZZZZZZZZZZZZZZ",
            "name": "QA Team",
            "usersCount": 2,
            "isDefaultTeam": false
        },
        {
            "id": "MMMMMMMMMMMMMMMMM",
              "name": "Backend  team",
            "usersCount": 5,
            "isDefaultTeam": false
        }
    ],
    "meta": {
        "count": 4,
        "total": 4
    }
}

Notes:

  • exp β€” the expiration date of the license and is in UNIX timestamp format

  • iat β€” β€œissued at” is the timestamp where the license was created

Get License Info

Endpoint:

GET /api/v1/license

Parameters:

Parameter
Type
Required?
Description

-

-

-

-

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

{
    "license": {
        "exp": 1895529600,
        "seats": 2000,
        "seatsCap": 22000,
        "audience": "idp-new",
        "features": [
            "chat",
            "chat_models",
            "local_retrieval",
            "remote_indexing",
            "jira_integration"
        ],
        "settings": {
            "chatModel": {
                "type": "Private"
            }
        },
        "iat": 1735806729
    }
}
  • exp β€” the expiration date of the license and is in UNIX timestamp format

  • iat β€” β€œissued at” is the timestamp where the license was created

Get Account Utilization Info

Endpoint:

GET /api/v1/organization/account-utilizations?startDate=2025-01

Parameters:

Parameter

Type

Required?

Description

startDate

string

⨉

(default: last 12 months)

Start date for showing utilization: Will only show up to the last 12 months

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

[
    {
        "year": 2025,
        "month": 0,
        "registered": 0,
        "deactivated": 0,
        "active": 0,
        "pending": 0
    },
    {
        "year": 2025,
        "month": 1,
        "registered": 0,
        "deactivated": 0,
        "active": 0,
        "pending": 0
    },
    {
        "year": 2025,
        "month": 2,
        "registered": 13,
        "deactivated": 0,
        "active": 13,
        "pending": 4
    },
    {
        "year": 2025,
        "month": 3,
        "registered": 13,
        "deactivated": 1,
        "active": 14,
        "pending": 4
    }
]

Notes:

  1. Will show up to the last 12 months

  2. Months are zero-based (0-11; 0=January, 11=December)

  3. β€œActive” are registered users throughout the month (including users who are now deactivated)

Get Account Permissions Info

Endpoint:

GET /api/v1/instance/permissions?role=Admin

Parameters:

Parameter

Type

Required?

Description

role

string

βœ“

Admin

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

[
    {
        "username": "admin@tabnine.com",
        "organizationId": "9a3895ca-1c27-4231-8978-85ae00267d02"
    }
]

Get Organization-Level Usage

Endpoint:

GET /api/v1/organization/usage?organizationId={org-id}&from=2025-03-01T00:00:00Z&to=2025-04-03T00:00:00Z&granularity=all

Parameters:

Parameter

Type

Required?

Description

organizationId

string

βœ“

The unique identifier of the organization

from

string (ISO 8601)

βœ“

Filter usage data from this date

to

string (ISO 8601)

βœ“

Filter usage data until this date

granularity

string

βœ“

Determines the time resolution at which usage data is aggregated and returned. Options: all, daily, weekly, monthly

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Responses (JSON):

Granularity: All

{
    "organizationId": "9a3895ca-1c27-4231-8978-85ae00267d02",
    "from": "2025-03-15T00:00:00Z",
    "to": "2025-05-12T00:00:00Z",
    "usage": {
        "granularity": "all",
        "data": [
            {
                "from": "2001-01-01T00:00:00Z",
                "to": "3000-12-31T00:00:00Z",
                "activeUsers": 16,
                "productivityFactor": 0.8993358965396715,
                "codeCompletions": {
                    "activeUsers": 12,
                    "completions": 206,
                    "charsCompleted": 42884,
                    "keystrokes": 3706,
                    "lines": 1521,
                    "automationFactor": 0.32314923619271446
                },
                "chat": {
                    "activeUsers": 13,
                    "interactions": 118,
                    "usefulChatInteractions": 48,
                    "lines": 326,
                    "charsCompleted": 9742,
                    "chatConsumptionRate": 0.4067796610169492
                }
            }
        ]
    }
}

Granularity: Monthly

{
    "organizationId": "9a3895ca-1c27-4231-8978-85ae00267d02",
    "from": "2025-03-15T00:00:00Z",
    "to": "2025-05-12T00:00:00Z",
    "usage": {
        "granularity": "monthly",
        "data": [
            {
                "from": "2025-03-01T00:00:00Z",
                "to": "2025-03-31T00:00:00Z",
                "activeUsers": 8,
                "productivityFactor": 0.8684931506849315,
                "codeCompletions": {
                    "activeUsers": 9,
                    "completions": 146,
                    "charsCompleted": 6658,
                    "keystrokes": 1782,
                    "lines": 231,
                    "automationFactor": 0.3951074870274277
                },
                "chat": {
                    "activeUsers": 6,
                    "interactions": 70,
                    "usefulChatInteractions": 24,
                    "lines": 172,
                    "charsCompleted": 4856,
                    "chatConsumptionRate": 0.34285714285714286
                }
            },
            {
                "from": "2025-04-01T00:00:00Z",
                "to": "2025-04-30T00:00:00Z",
                "activeUsers": 9,
                "productivityFactor": 1,
                "codeCompletions": {
                    "activeUsers": 4,
                    "completions": 60,
                    "charsCompleted": 36226,
                    "keystrokes": 1924,
                    "lines": 1290,
                    "automationFactor": 0
                },
                "chat": {
                    "activeUsers": 7,
                    "interactions": 48,
                    "usefulChatInteractions": 24,
                    "lines": 154,
                    "charsCompleted": 4886,
                    "chatConsumptionRate": 0.5
                }
            }
        ]
    }
}

Team-Level APIs

Get Users for a Given Team

This returns all registered and deactivated users from a team.

Endpoint:

GET api/v1/team/{:teamId}/users?offset=0&limit=0

Parameters:

Parameter

Type

Required?

Description

limit

string (non-negative integer)

βœ“

Specifies the maximum number of items to return. (Example: limit=10 returns only 10 items)

offset

string

βœ“

Skips a number of items before starting to return results.(Example: offset=20 skips the first 20 items and starts from item 21)

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

{
    "data": [
        {
            "id": "xxxxxxxxxxxxxxxxxx",
            "username": "Taylor",
            "email": "taylor@demo.com",
            "role": "Admin",
            "verified": true
        },
        {
            "id": "yyyyyyyyyyyyyyy",
            "username": "Matt",
            "email": "matt@demo.com",
            "role": "Manager",
            "verified": true
        },
        {
            "id": "ZZZZZZZZZZZZZZZZZZZZ",
            "username": "Ben",
            "email": "ben@demo.com",
            "role": "Member",
            "verified": true
        }
    ],
    "meta": {
        "count": 3,
        "total": 3,
        "next": {
            "limit": 0,
            "offset": 0
        }
    }
}

Get Users Who Aren't Assigned to a Team

Endpoint:

GET /api/v1/organization/users?offset=0&limit=0&teamMember=false&active=true

Parameters:

Parameter

Type

Required?

Description

limit

string (non-negative integer)

βœ“

Specifies the maximum number of items to return. (Example: limit=10 returns only 10 items)

offset

string

βœ“

Skips a number of items before starting to return results.(Example: offset=20 skips the first 20 items and starts from item 21)

teamMember

boolean

βœ“

false for users who are not assigned to a team

active

boolean

βœ“

true, for users who are registered (false for deactivated user

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

{
    "data": [
        {
            "id": "eec77331-89ac-45ff-93fa-31b1df99aaa6",
            "username": "ben@example.com",
            "email": "ben@example.com",
            "verified": true,
            "role": "Manager",
            "deactivatedAt": null,
            "updatedAt": "2025-04-10T06:53:09.562Z"
        }
    ],
    "meta": {
        "count": 1,
        "total": 1
    }
}

Get Current Team Utilization Info

Endpoint:

GET /api/v1/team/account-utilizations?teamId={teamId}

Parameters:

Parameter

Type

Required?

Description

teamId

string

βœ“

The unique identifier of the team

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

{
    "registered": 5,
    "deactivated": 1,
    "invited": 1
}

Get Team Name

Endpoint:

GET /api/v1/team/{team-id}

Parameters:

Parameter
Type
Required?
Description

-

-

-

-

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

{
    "id": "4e69f465-6f02-4e33-bfe3-9d10a1d20db9",
    "name": "Backend team"
}

Team Level Usage API

Endpoint:

GET /api/v1/team/usage?organizationId={org-id}&teamId={team-id}&from=2025-03-15T00:00:00Z&to=2025-04-15T00:00:00Z&granularity=all

Parameters:

Parameter

Type

Required?

Description

organizationId

string

βœ“

The unique identifier of the organization

teamId

string

βœ“

The unique identifier of the team

from

string (ISO 8601)

βœ“

Filter usage data from this date

to

string (ISO 8601)

βœ“

Filter usage data until this date

granularity

string

βœ“

Determines the time resolution at which usage data is aggregated and returned. Options: all, daily, weekly, monthly

Response Codes:

  • 200 OK – Successful response with usage data

  • 400 Bad Request – Invalid or missing parameters

  • 401 Unauthorized – Invalid token

  • 403 Forbidden – User does not have permission to access this team's data

  • 404 Not Found – Organization or team not found

  • 500 Internal Server Error – Unexpected server error

Response (JSON):

Granularity: All

{
    "organizationId": "9a3895ca-1c27-4231-8978-85ae00267d02",
    "teamId": "7f7fd28f-dae0-4955-9e40-c4a314513657",
    "from": "2025-03-15T00:00:00Z",
    "to": "2025-05-15T00:00:00Z",
    "usage": {
        "granularity": "all",
        "data": [
            {
                "from": "2001-01-01T00:00:00Z",
                "to": "3000-12-31T00:00:00Z",
                "activeUsers": 4,
                "productivityFactor": 1,
                "codeCompletions": {
                    "activeUsers": 2,
                    "completions": 13,
                    "charsCompleted": 1576,
                    "keystrokes": 161,
                    "lines": 40,
                    "automationFactor": 0
                },
                "chat": {
                    "activeUsers": 3,
                    "interactions": 16,
                    "usefulChatInteractions": 6,
                    "lines": 53,
                    "charsCompleted": 1899,
                    "chatConsumptionRate": 0.375
                }
            }
        ]
    }
}

🏭
Generate a new token in the Access Tokens section