Get Ai Usage
AI credits over the last `days` UTC days, or by month with `period` (RO-321, RO-383), from every LLM call: totals, by feature (assistant, writing, research, replies, knowledge, calls), by model, by person (background work has no person) and per day. `credits = round((input + output tokens) × the model's weight ÷ 1000)` on each group's summed tokens. Admins see the whole workspace; a member sees only their own usage (`scope: self`).
API key access
admin scope with an API key (ro_pat_...). A signed-in session uses the caller's role./api/v1/workspaces/current/ai-usageAccess token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).
In: header
Query Parameters
Default 30.
int641 <= value <= 90current (this UTC month so far) or previous (the whole previous month); overrides days.
Header Parameters
Id of the workspace to act on (must be a member).
Response Body
curl -X GET "http://localhost:8000/api/v1/workspaces/current/ai-usage?days=1&period=string" \ -H "X-Workspace-Id: string"{
"from": "2019-08-24",
"to": "2019-08-24",
"days": 0,
"total": {
"calls": 0,
"errors": 0,
"input_tokens": 0,
"output_tokens": 0,
"credits": 0
},
"by_feature": [
{
"feature": "string",
"label": "string",
"calls": 0,
"errors": 0,
"input_tokens": 0,
"output_tokens": 0,
"credits": 0
}
],
"by_model": [
{
"model": "string",
"label": "string",
"provider": "string",
"credits_weight": 0.1,
"calls": 0,
"errors": 0,
"input_tokens": 0,
"output_tokens": 0,
"credits": 0
}
],
"by_user": [
{
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
"name": "string",
"email": "string",
"calls": 0,
"errors": 0,
"input_tokens": 0,
"output_tokens": 0,
"credits": 0
}
],
"daily": [
{
"day": "2019-08-24",
"credits": 0,
"by_feature": {
"property1": 0,
"property2": 0
}
}
],
"formula": {
"tokens_per_unit": 0.1,
"default_weight": 0.1,
"text": "string"
},
"monthly_credits": 0,
"period": "string",
"scope": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Ai Credits
This month's AI credits (RO-380): the allowance, what's used and left, the level (`ok`, `warning` past the lowest alert threshold, `exhausted` when AI is paused), the alert thresholds and which are reached, and the caller's own limit (RO-382). Any member.
Get Assistant Settings
Admins: the model catalog with each model's availability and lifecycle, the models members may pick, the default, whether previews and credits show, and warnings for deprecated or retired models still in use (RO-320). Models whose free tier may train on prompts (`trains_on_prompts`) are only offered when the allow-list names them.