Usage History
GET
/v1/usage/history
const url = 'https://api.cloud.agentums.ru/v1/usage/history?days=30';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.cloud.agentums.ru/v1/usage/history?days=30' \ --header 'Authorization: Bearer <token>'Дневной график расхода текущего юзера за последние N дней (для вкладки «Расходы»).
Authorizations
Заголовок раздела «Authorizations»Parameters
Заголовок раздела «Parameters»Query Parameters
Заголовок раздела «Query Parameters»days
Days
integer
Responses
Заголовок раздела «Responses»Successful Response
Media typeapplication/json
Response Usage History V1 Usage History Get
Array<object>
UsagePointТочка дневного графика расхода (Ф7): дата + ₽ + токены + вызовы за день.
object
calls
Calls
integer
cost_rub
Cost Rub
number
date
required
Date
string
total_tokens
Total Tokens
integer
Example
[ { "calls": 0, "cost_rub": 0, "total_tokens": 0 }]Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}