Usage Stats API
Check the usage metrics of your LLMWhisperer account based on the tag provided.
Endpoint | /usage |
URL | https://llmwhisperer-api.us-central.unstract.com/api/v2/usage |
Method | GET |
Headers | unstract-key: <YOUR API KEY> |
Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
tag | string | Yes | The tag with user need to filter the usage data. | |
from_date | string | No | Format required is YYYY-MM-DD | |
to_date | string | No | Format 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 Status | Content-Type | Headers | Description |
---|---|---|---|
200 | application/json | The API will return a JSON with the status. Refer below for JSON format | |
400 | application/json | The 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"
}