Skip to Content
SeyloDocs
API referenceAI assistant

Get AI usage and the projected bill

GET
/api/v1/ai.usage

Returns token use and cost for a month (default the current one, UTC) by model, by day and by person, the budget, and the bill projected from the pace so far.

Needs settings.view, which owners and admins hold. Not available to MCP clients or the assistant.

Authorization

cookieseylo_session<token>

Query Parameters

month?string

YYYY-MM

Match^\d{4}-(0[1-9]|1[0-2])$

Response Body

Success.

application/json
  1. response
month*string
spentUsd*number
Range0 <= value
projectedUsd*number
Range0 <= value
budgetUsd*|null
budgetReached*boolean
byModel*array<>
byDay*array<>
byUser*array<>
Example Request
curl -X GET 'https://example.com/api/v1/ai.usage'
Example Response
{  "month": "string",  "spentUsd": 0,  "projectedUsd": 0,  "budgetUsd": 0,  "budgetReached": true,  "byModel": [    {      "model": "haiku",      "inputTokens": 0,      "outputTokens": 0,      "cacheReadTokens": 0,      "cacheWriteTokens": 0,      "costUsd": 0,      "requests": 0    }  ],  "byDay": [    {      "day": "string",      "costUsd": 0    }  ],  "byUser": [    {      "userId": "string",      "name": "string",      "costUsd": 0    }  ]}