Get usage counts for a time window
Conversation, question and answer counts for your organisation over a trailing or explicit window. Counts and rates only, never question text.
GET
/
analytics
/
usage
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/analytics/usage?days=7" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
response = requests.get(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/analytics/usage",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
params={"days": 7},
timeout=60,
)
response.raise_for_status()
print(response.json())
const params = new URLSearchParams({ days: '7' })
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/analytics/usage?${params}`,
{
headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
},
)
console.log(await response.json())
{
"window": {
"start": "2026-09-17T10:00:03.214557+00:00",
"end": "2026-09-24T10:00:03.214557+00:00"
},
"conversations": 412,
"questions": 968,
"answers": 961,
"grounded_answers": 842,
"abstained_answers": 104,
"failed_answers": 15,
"grounded_rate": 0.8761706555671176,
"abstention_rate": 0.10822060353798127,
"failure_rate": 0.015608740894901144,
"models": [{ "model": "anthropic/claude-sonnet-5", "answers": 961 }],
"channels": [
{ "channel": "widget", "questions": 713 },
{ "channel": "user", "questions": 171 },
{ "channel": "service", "questions": 84 }
],
"deflections": { "deflected": 41, "submitted": 12 }
}
{
"code": "validation_error",
"message": "Ask for either 'days' or a 'start' and 'end' pair, not both."
}
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
Returns counts and rates for your organization only. The response never contains question or answer text. See Analytics for how to read the numbers.
Choose the window in one of two ways:
days for a trailing window ending now, or an explicit start and end pair. Sending both forms returns 400. With neither, you get the last 30 days. The window is half-open, [start, end), and may span at most 366 days.
Filtering by assistant_id narrows every count to that assistant. An ID that belongs to another organization, or to no assistant, is not an error: it matches nothing and every count is 0.
Requires the owner, admin or editor role. Members and dataset operators receive 403.
integer
default:"30"
Length of a trailing window ending now, from 1 to 366. ASCII digits only. Cannot be combined with
start or end.string
Start of an explicit window, as an ISO 8601 timestamp with a UTC offset (for example
2026-09-01T00:00:00Z). A timestamp without an offset is refused. Requires end.string
End of an explicit window, exclusive, as an ISO 8601 timestamp with a UTC offset. Must be after
start, and no more than 366 days after it. Requires start.string
Limit the counts to one assistant (UUID). A malformed ID returns
400.Response
object
required
integer
required
Conversations started in the window.
integer
required
Questions asked in the window.
integer
required
Answers started in the window that have finished, whether complete, interrupted or failed. Answers
still in progress are not counted.
integer
required
Finished answers that carried at least one citation.
integer
required
Finished answers where the assistant declined to answer because its sources did not cover the
question. See How answers work.
integer
required
Answers that failed before producing a usable result.
number | null
required
grounded_answers / answers, from 0 to 1. null when answers is 0, meaning not applicable
rather than zero.number | null
required
abstained_answers / answers, or null when answers is 0.number | null
required
failed_answers / answers, or null when answers is 0.object[]
required
object[]
required
object
required
What visitors did after the widget’s form deflector showed them
an answer, counted per conversation started in the window. Conversations no deflector showed are
in neither count.
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/analytics/usage?days=7" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
response = requests.get(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/analytics/usage",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
params={"days": 7},
timeout=60,
)
response.raise_for_status()
print(response.json())
const params = new URLSearchParams({ days: '7' })
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/analytics/usage?${params}`,
{
headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
},
)
console.log(await response.json())
{
"window": {
"start": "2026-09-17T10:00:03.214557+00:00",
"end": "2026-09-24T10:00:03.214557+00:00"
},
"conversations": 412,
"questions": 968,
"answers": 961,
"grounded_answers": 842,
"abstained_answers": 104,
"failed_answers": 15,
"grounded_rate": 0.8761706555671176,
"abstention_rate": 0.10822060353798127,
"failure_rate": 0.015608740894901144,
"models": [{ "model": "anthropic/claude-sonnet-5", "answers": 961 }],
"channels": [
{ "channel": "widget", "questions": 713 },
{ "channel": "user", "questions": 171 },
{ "channel": "service", "questions": 84 }
],
"deflections": { "deflected": 41, "submitted": 12 }
}
{
"code": "validation_error",
"message": "Ask for either 'days' or a 'start' and 'end' pair, not both."
}
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
Last modified on November 7, 2026
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/analytics/usage?days=7" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
response = requests.get(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/analytics/usage",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
params={"days": 7},
timeout=60,
)
response.raise_for_status()
print(response.json())
const params = new URLSearchParams({ days: '7' })
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/analytics/usage?${params}`,
{
headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
},
)
console.log(await response.json())
{
"window": {
"start": "2026-09-17T10:00:03.214557+00:00",
"end": "2026-09-24T10:00:03.214557+00:00"
},
"conversations": 412,
"questions": 968,
"answers": 961,
"grounded_answers": 842,
"abstained_answers": 104,
"failed_answers": 15,
"grounded_rate": 0.8761706555671176,
"abstention_rate": 0.10822060353798127,
"failure_rate": 0.015608740894901144,
"models": [{ "model": "anthropic/claude-sonnet-5", "answers": 961 }],
"channels": [
{ "channel": "widget", "questions": 713 },
{ "channel": "user", "questions": 171 },
{ "channel": "service", "questions": 84 }
],
"deflections": { "deflected": 41, "submitted": 12 }
}
{
"code": "validation_error",
"message": "Ask for either 'days' or a 'start' and 'end' pair, not both."
}
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }