APIСправочник API
Изменение лимитов пространства
PUT /v1/limits
PUT /v1/limits
Только владельцы и администраторы с limits:manage. Null означает отсутствие ограничения; все поля null удаляют правило. monthly_calls=0 блокирует подходящие вызовы. Нулевой денежный лимит блокирует платные вызовы. Месячные периоды считаются по UTC.
Доступ
Требуется bearer-авторизация. Описание операции задаёт дополнительные права, роли и ограничения для сессий кабинета. Сам по себе API-ключ их не предоставляет.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
scope | "workspace" ∣ "member" ∣ "key" ∣ "client" | да | |
subject_id | string | да | Пусто для пространства; иначе — ID пользователя, ключа или OAuth-клиента. |
monthly_calls | integer ∣ null | да | |
monthly_budget_microusd | integer ∣ null | да | |
max_call_microusd | integer ∣ null | да |
Полная схема: SpendLimit
{
"properties": {
"scope": {
"type": "string",
"enum": [
"workspace",
"member",
"key",
"client"
],
"title": "Scope"
},
"subject_id": {
"type": "string",
"title": "Subject Id",
"description": "Empty for workspace; otherwise user ID, key ID or OAuth client ID."
},
"monthly_calls": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Monthly Calls"
},
"monthly_budget_microusd": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Monthly Budget Microusd"
},
"max_call_microusd": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Max Call Microusd"
}
},
"type": "object",
"required": [
"scope",
"subject_id",
"monthly_calls",
"monthly_budget_microusd",
"max_call_microusd"
],
"title": "SpendLimit"
}Ответы
| HTTP | Описание | Тип |
|---|---|---|
| 200 | Успешный ответ | application/json: SpendLimitList |
| 401 | Требуется авторизация | application/problem+json: ProblemDetails |
| 403 | Доступ запрещён | application/problem+json: ProblemDetails |
| 404 | Не найдено | application/problem+json: ProblemDetails |
| 422 | Ошибка входных данных | application/problem+json: ProblemDetails |
Ответ: SpendLimitList
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
items | SpendLimit[] | да | |
currency | string | да | |
microusd_per_usd | integer | да |
Полная схема
{
"properties": {
"items": {
"items": {
"$ref": "#/components/schemas/SpendLimit"
},
"type": "array",
"title": "Items"
},
"currency": {
"type": "string",
"const": "USD",
"title": "Currency"
},
"microusd_per_usd": {
"type": "integer",
"const": 1000000,
"title": "Microusd Per Usd"
}
},
"type": "object",
"required": [
"items",
"currency",
"microusd_per_usd"
],
"title": "SpendLimitList"
}Эта страница генерируется из OpenAPI. Примеры показывают схемы, а не вымышленные успешные ответы.