Tabnine APIs
The Usage API provides programmatic access to usage metrics across an organization
Usage API
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.
Audit Logs API
The Audit Logs API (released with 5.25.0), allows for user access to audit logs that track key user management, team management, and user logging events.
The audit log includes the following information:
Performing user
Affected user
Time of change
Value change for each event
Tabnine allows for self-serve access via the Audit Logs API with a token. Users can download these logs either as a CSV file or a JSON HTTP response.
To set the number of parameters, use this URL:
/organization/audit_logs?limit=50&offset=0
To download as a CSV, use the URL:
/organization/audit-logs?csv-format
Only users with Admin access to Tabnine can access the Audit Logs API.
You can use the same mapping from the Usage API between user_id to email and team_id to team name.
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
Get current organization ID and high-level settings
Get list of teams for given organization
Get license info
Get account utilization info
Get account permissions info
Get organization-level usage
Team-Level Info APIs
Get users of a given team
Get users that aren't assigned to a team
Get current utilization info
Get team name
Team Level Usage API
Organization-Level APIs
Get current organization ID and high-level settings
Endpoint:
GET /api/v1/organizationParameters:
-
-
-
-
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 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=0Parameters:
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 data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 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:
Get License Info
Endpoint:
GET /api/v1/licenseParameters:
-
-
-
-
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 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 formatiat— “issued at” is the timestamp where the license was created
Get Account Utilization Info
Endpoint:
GET /api/v1/organization/account-utilizations?startDate=2025-01Parameters:
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 data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 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:
Get Account Permissions Info
Endpoint:
GET /api/v1/instance/permissions?role=AdminParameters:
Parameter
Type
Required?
Description
role
string
✓
Admin
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
[
{
"username": "[email protected]",
"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=allParameters:
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 data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 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=0Parameters:
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 data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
{
"data": [
{
"id": "xxxxxxxxxxxxxxxxxx",
"username": "Taylor",
"email": "[email protected]",
"role": "Admin",
"verified": true
},
{
"id": "yyyyyyyyyyyyyyy",
"username": "Matt",
"email": "[email protected]",
"role": "Manager",
"verified": true
},
{
"id": "ZZZZZZZZZZZZZZZZZZZZ",
"username": "Ben",
"email": "[email protected]",
"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=trueParameters:
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 data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 Internal Server Error– Unexpected server error
Response (JSON):
{
"data": [
{
"id": "eec77331-89ac-45ff-93fa-31b1df99aaa6",
"username": "[email protected]",
"email": "[email protected]",
"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 data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 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: NONE
-
-
-
-
Response Codes:
200 OK– Successful response with usage data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token404 Not Found– Organization or team not found500 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=allParameters:
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 data400 Bad Request– Invalid or missing parameters401 Unauthorized– Invalid token403 Forbidden– User does not have permission to access this team's data404 Not Found– Organization or team not found500 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
}
}
]
}
}User-Level APIs
This returns all user-level information: organization ID, user ID, and token.
Endpoint:
GET /api/v1/user/{user_id}Parameters:
user_id
string
✅
The unique identifier of the user
Response Codes:
200 OK– Successful response with user info.400 Bad Request– Invalid or missing parameters.401 Unauthorized– Invalid token.403 Forbidden– User lacks permission to access this user's info.404 Not Found– Organization or user not found.500 Internal Server Error– Unexpected server error.
Response (JSON):
{
"user": {
"organization_id": "zzzz-ab43-4422-ttt-8c2a273e04a1",
"user_id": "xxx-705e-yyy-ad27-82cfdebe51b3",
"email": "[email protected]",
"role": "Member",
"createdAt": "2025-08-26T15:16:16.557Z",
"updatedAt": "2025-08-26T15:16:16.557Z"
},
"teams": {
"team_id": "b027d7e4-f925-49ca-9a43-56c868580635",
"team_name": "Default Team"
}
}This returns all user-level usage data: organizational ID, user ID, token, start date, and end date.
Endpoint:
GET /api/v1/user/usageParameters:
organizationId
string
✓
The unique identifier of the organization
userId
string
✓
The unique identifier of the user
granularity
string
✓
determines the time resolution at which usage data is aggregated and returned.
Options: all, daily, weekly, monthly
from
string (ISO 8601)
✓
Filter usage data from this date
to
string (ISO 8601)
✓
Filter usage data until this date
Response Codes:
200 OK– Successful response with user usage data.400 Bad Request– Invalid or missing parameters.401 Unauthorized– Invalid token.403 Forbidden– User lacks permission to access this user's data.404 Not Found– Organization or user not found.500 Internal Server Error– Unexpected server error.
Response (JSON):
{
"organizationId": "xxx-ab43-yyy-b2b4-8c2a273e04a1",
"userId": "tttt-705e-48f3-zzz-82cfdebe51b3",
"from": "2025-03-01T00:00:00Z",
"to": "2025-09-03T00:00:00Z",
"usage": {
"granularity": "all",
"data": [
{
"from": "2001-01-01T00:00:00Z",
"to": "3000-12-31T00:00:00Z",
"activeUsers": 1,
"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
}
}
]
}
}Last updated
Was this helpful?
