Usage API
The Usage API provides programmatic access to usage metrics across an organization
Last updated
Was this helpful?
The Usage API provides programmatic access to usage metrics across an organization
Last updated
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.
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.
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
APIs return JSON with parameter details and example responses:
Organizational 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
Endpoint:
Parameters:
-
-
-
-
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):
This returns all registered and deactivated users from a team.
Endpoint:
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):