DX docs are moving! Visit docs.getdx.com for all current and future help—this page will no longer be updated.
AI Tool Metrics API methods can be used to add daily usage data for bespoke AI tools to your Data Cloud instance. It allows you to store metrics by email, date, and tool combinations with flexible JSON data. An additional is_active flag can be provided for each record. The records are stored in the bespoke_ai_tool_daily_metrics
table that is queryable in Data Studio alongside all of your other Data Cloud data.
For more information about the supported SQL operators and functions available for querying the JSON values please reference the PostgreSQL documentation.
API Methods
aiToolMetrics.push
Required Arguments
Name | Description |
String - User email address | |
date | String - Metrics recording date |
is_active | Boolean - User activity flag |
tool | String - AI tool name |
Optional Arguments
Name | Description |
metrics | JSON Object - Usage data object |
Response
Name | Description |
id | String - Generated unique ID for the record. |
String - User email address | |
date | String - Metrics recording date |
is_active | Boolean - User activity flag |
tool | String - AI tool name |
metrics | JSON Object - Usage data object |
Example
curl -X \
POST https://yourinstance.getdx.net/api/aiToolMetrics.push \
-H \
"Authorization: Bearer YOUR_API_KEY_HERE" \
-H \
"Content-Type: application/json" \
-d '{
"email": "[email protected]",
"date": "2025-01-15",
"is_active": true,
"tool": "tabnine",
"metrics": {"usage": 100}
}'
aiToolMetrics.pushAll
This will use the same API request format, except the arguments can be passed inside an array under the data key.
Required Arguments
Name | Description |
String - User email address | |
date | String - Metrics recording date |
is_active | Boolean - User activity flag |
tool | String - AI tool name |
Optional Arguments
Name | Description |
metrics | JSON Object - Usage data |
Response
Name | Description |
id | String - Generated unique ID for the record. |
String - User email address | |
date | String - Metrics recording date |
is_active | Boolean - User activity flag |
tool | String - AI tool name |
metrics | JSON Object - Usage data object |
Example
curl -X \
POST https://yourinstance.getdx.net/api/aiToolMetrics.pushAll \
-H \
"Authorization: Bearer YOUR_API_KEY_HERE" \
-H \
"Content-Type: application/json" \
-d '{
"data": [
{
"email": "[email protected]",
"date": "2025-01-15",
"is_active": true,
"tool": "tabnine",
"metrics": {"lines": 150}
}
]
}'