Skip to main content
Version: 2.0.0

Usage Stats API

Check the usage metrics of your LLMWhisperer account based on the tag provided.

Endpoint/usage
URLhttps://llmwhisperer-api.us-central.unstract.com/api/v2/usage
MethodGET
Headersunstract-key: <YOUR API KEY>

Parameters

ParameterTypeDefaultRequiredDescription
tagstringYesThe tag with user need to filter the usage data.
from_datestringNoFormat required is YYYY-MM-DD
to_datestringNoFormat required is YYYY-MM-DD

Note: If neither from_date nor to_date is provided, usage will be calculated for the last 30 days by default.

Example Curl Request

curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/usage?tag=<tag-name>' \
-H 'unstract-key: <Your API Key>'
info

To include the headers in the response use curl -i in the request.

Response

HTTP StatusContent-TypeHeadersDescription
200application/jsonThe API will return a JSON with the status. Refer below for JSON format
400application/jsonThe API will return a JSON with the error message. Refer below for JSON format

Example 200 Response

{
"end_date": <end date>,
"start_date": <start date>,
"subscription_id": <susbscription-id>,
"tag": "credit",
"usage": [
{
"pages_processed": <count>,
"service_type": "form"
},
{
"pages_processed": <count>,
"service_type": <mode>
}
]
}

400 Bad Request

{
"message": "please specify the tag while requesting usage info"
}
{
"message": "Invalid date format. Valid date format YYYY-MM-DD"
}