Перейти к содержимому

Usage History

GET
/v1/usage/history
curl --request GET \
--url 'https://api.cloud.agentums.ru/v1/usage/history?days=30' \
--header 'Authorization: Bearer <token>'

Дневной график расхода текущего юзера за последние N дней (для вкладки «Расходы»).

days
Days
integer
default: 30 >= 1 <= 365

Successful Response

Media typeapplication/json
Response Usage History V1 Usage History Get
Array<object>
UsagePoint

Точка дневного графика расхода (Ф7): дата + ₽ + токены + вызовы за день.

object
calls
Calls
integer
0
cost_rub
Cost Rub
number
0
date
required
Date
string
total_tokens
Total Tokens
integer
0
Example
[
{
"calls": 0,
"cost_rub": 0,
"total_tokens": 0
}
]

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
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"
}
]
}