CyberRXN Docs
APIСправочник API

Использование

GET /v1/usage

GET /v1/usage

Все операции API · OpenAPI

Требуется usage:read. Доступно через сессию кабинета, API-ключ или OAuth-токен в пределах аккаунта этого удостоверения. Имена и email участников возвращаются только сессиям кабинета.

Доступ

Требуется bearer-авторизация. Описание операции задаёт дополнительные права, роли и ограничения для сессий кабинета. Сам по себе API-ключ их не предоставляет.

Параметры

ПолеТипОбязательноОписание
period (query)string ∣ nullнетYYYY-MM; по умолчанию текущий месяц

Тело запроса

Тело запроса не требуется.

Ответы

HTTPОписаниеТип
200Успешный ответapplication/json: Usage
401Требуется авторизацияapplication/problem+json: ProblemDetails
403Доступ запрещёнapplication/problem+json: ProblemDetails
404Не найденоapplication/problem+json: ProblemDetails
422Ошибка входных данныхapplication/problem+json: ProblemDetails

Ответ: Usage

ПолеТипОбязательноОписание
account_idstringда
periodstringдаКалендарный месяц по UTC в формате YYYY-MM.
period_startstringда
period_endstringдаИсключающая граница.
planstringда
included_callsintegerда
used_callsintegerдаУспешные или зарезервированные рабочие вызовы; тестовые учитываются отдельно.
test_callsintegerда
test_included_callsintegerда
billed_microusdintegerдаФактический расход предоплаты в миллионных долях USD, включая незавершённые резервы.
credit_balance_microusdintegerда
trial_eligiblebooleanда
recent_callsCallLog[]даПоследние 50 попыток рабочей и тестовой среды, без тел запросов и секретов.
overage_callsintegerда
overage_usd_per_1000numberда
estimated_overage_usdnumberда
hard_limitinteger ∣ nullдаДоступное число рабочих вызовов из квоты и оставшихся кредитов; null для внутренних аккаунтов.
by_dayDayUsage[]да
by_toolToolUsage[]да
by_channelChannelUsage[]да
by_userUserUsage[]да
by_keyKeyUsage[]даВызовы с API-ключами.
by_connectionConnectionUsage[]даВызовы через OAuth-клиенты, например ChatGPT и Claude.
Полная схема
{
  "properties": {
    "account_id": {
      "type": "string",
      "title": "Account Id"
    },
    "period": {
      "type": "string",
      "title": "Period",
      "description": "Calendar month in UTC, YYYY-MM."
    },
    "period_start": {
      "type": "string",
      "format": "date",
      "title": "Period Start"
    },
    "period_end": {
      "type": "string",
      "format": "date",
      "title": "Period End",
      "description": "Exclusive."
    },
    "plan": {
      "type": "string",
      "title": "Plan"
    },
    "included_calls": {
      "type": "integer",
      "title": "Included Calls"
    },
    "used_calls": {
      "type": "integer",
      "title": "Used Calls",
      "description": "Successful or reserved live calls; sandbox calls are separate."
    },
    "test_calls": {
      "type": "integer",
      "title": "Test Calls"
    },
    "test_included_calls": {
      "type": "integer",
      "title": "Test Included Calls"
    },
    "billed_microusd": {
      "type": "integer",
      "title": "Billed Microusd",
      "description": "Actual net prepaid spend, USD millionths, including in-flight reservations."
    },
    "credit_balance_microusd": {
      "type": "integer",
      "title": "Credit Balance Microusd"
    },
    "trial_eligible": {
      "type": "boolean",
      "title": "Trial Eligible"
    },
    "recent_calls": {
      "items": {
        "$ref": "#/components/schemas/CallLog"
      },
      "type": "array",
      "title": "Recent Calls",
      "description": "Last 50 live and sandbox attempts; no request bodies or secrets."
    },
    "overage_calls": {
      "type": "integer",
      "title": "Overage Calls"
    },
    "overage_usd_per_1000": {
      "type": "number",
      "title": "Overage Usd Per 1000"
    },
    "estimated_overage_usd": {
      "type": "number",
      "title": "Estimated Overage Usd"
    },
    "hard_limit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Hard Limit",
      "description": "Live count funded by allowance and remaining credits; null for internal accounts."
    },
    "by_day": {
      "items": {
        "$ref": "#/components/schemas/DayUsage"
      },
      "type": "array",
      "title": "By Day"
    },
    "by_tool": {
      "items": {
        "$ref": "#/components/schemas/ToolUsage"
      },
      "type": "array",
      "title": "By Tool"
    },
    "by_channel": {
      "items": {
        "$ref": "#/components/schemas/ChannelUsage"
      },
      "type": "array",
      "title": "By Channel"
    },
    "by_user": {
      "items": {
        "$ref": "#/components/schemas/UserUsage"
      },
      "type": "array",
      "title": "By User"
    },
    "by_key": {
      "items": {
        "$ref": "#/components/schemas/KeyUsage"
      },
      "type": "array",
      "title": "By Key",
      "description": "Calls made with API keys."
    },
    "by_connection": {
      "items": {
        "$ref": "#/components/schemas/ConnectionUsage"
      },
      "type": "array",
      "title": "By Connection",
      "description": "Calls made through OAuth clients (ChatGPT, Claude…)."
    }
  },
  "type": "object",
  "required": [
    "account_id",
    "period",
    "period_start",
    "period_end",
    "plan",
    "included_calls",
    "used_calls",
    "test_calls",
    "test_included_calls",
    "billed_microusd",
    "credit_balance_microusd",
    "trial_eligible",
    "recent_calls",
    "overage_calls",
    "overage_usd_per_1000",
    "estimated_overage_usd",
    "hard_limit",
    "by_day",
    "by_tool",
    "by_channel",
    "by_user",
    "by_key",
    "by_connection"
  ],
  "title": "Usage"
}

Эта страница генерируется из OpenAPI. Примеры показывают схемы, а не вымышленные успешные ответы.

Расход и оплата · Типизированные ошибки

На этой странице