Skip to main content
Back to API List This API retrieves LLM and Generative AI usage logs for GenAI features.
FieldValue
MethodPOST
Endpointhttps://{{host}}/api/1.1/public/bot/{{botId}}/getLLMUsageLogs
Content Typeapplication/json
Authorizationauth: {{JWT}} — See How to generate the JWT Token.
API ScopeApp Builder: Fetch Gen AI and LLM Usage Logs; Admin Console: API Scopes > Gen AI and LLM Usage Logs
You can access records spanning up to a 90-day timeframe with one request.

Query Parameters

ParameterRequired/OptionalDescription
hostRequiredThe environment URL. For example, https://platform.kore.ai
botIdRequiredBot ID or Stream ID. Accessible from the General Settings page of the bot.

Sample Request

curl --location 'https://{{host}}/1.1/public/bot/st-f3195ec3-72aa-5317-92/getLLMUsageLogs' \
--header 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data '{
    "dateFrom": "2024-03-07",
    "dateTo": "2024-04-26",
    "limit": "50",
    "skip": "5",
    "isDeveloper": true,
    "channel": ["msteams", "rtm"],
    "featureName": ["Agent Node"],
    "taskId": "dg-d4924db4-xxxx-5b4d-ae51-aa5c7be4xxxx",
    "channelUserIds": ["29:1gmwl6k7ohtdhxxxx7kvu1yiek_qri4grpmd0k_am9dpzwttw"],
    "userIds": ["u-40b3eafc-xxxx-55f2-83e8-cf4d0fbxxxx"],
    "sort": {
        "field": "Time Taken",
        "order": "asc"
    }
}'

Body Parameters

ParameterRequired/OptionalDescription
dateFromRequiredThe timestamp from which records are displayed.
dateToRequiredThe timestamp until which records are displayed.
limitRequiredThe number of records to display per page.
channelOptionalThe channels to include in the metrics.
channelUIdsOptionalThe channel-specific user IDs to include in the metrics.
isDeveloperOptionalWhether to include developer metrics. Set to true or false.
taskIdOptionalFilter records by task IDs.
userIdOptionalFilter records by user ID.
sortOptionalSort results by Time Taken in the specified order (asc or desc).

Sample Response

[
{
"Prompt Name": "Default",
"Integration": "OpenAI",
"start Date": "2024-03-08T06:38:54.008Z",
"End Date": "2024-03-08T06:38:58.386Z",
"Time Taken": 4378,
"statusCode": 200,
"Bot ID": "st-73bfdb2f-xxxx-55e6-b4c8-3f568a6exxxx",
"User ID": "u-40b3eafc-xxxx-55f2-83e8-cf4d0fb1xxxx",
"Feature Name ": "GenAI Node",
"Model Name": "GPT-4",
"Channel Name": "msteams",
"Description": "Order pizza-GenAINode0002",
"task Id": "dg-200ad1ff-xxxx-5219-810e-4ee3800dxxxx",
"Status": "Success",
"Payload Details": {
"Prompt Name": "Default",
"Request Payload": {
"model": "gpt-4",
"temperature": 0.5,
"max_tokens": 1500,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"messages": [
{
"role": "system",
"content": "You are a virtual assistant..."
},
{
"role": "user",
"content": "Order pizza"
}
]
},
"Response Payload": {
"id": "chatcmpl-90OAYDFFkbjgMxhMxKukwqklT6SWO",
"object": "chat.completion",
"created": 1709879934,
"model": "gpt-4-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\"bot\":\"I'm sorry, but your message seems incomplete...\"}"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 614,
"completion_tokens": 74,
"total_tokens": 688
}
},
"Request Tokens": 614,
"Response Tokens": 74
}
}
]