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

API: metering

Статус: GA Доступ: по токену контракт API: 0.3.0 · capability 2026-09-03.1 Открыть как Markdown Открыть в Claude Открыть в ChatGPT

Costs By Article

Открыть отдельной страницей →

Per-article cost for a contract: direct spend + amortized collect share.

direct = sum over the article’s own runs (generate/publish, where generated_article_id is set). amortized_collect = the contract’s contract-level cost (its collect runs, where generated_article_id IS NULL) divided by the number of articles in the window — (owner decision: amortize by period, not per collect-run, since collect feeds the reused RAG corpus). imagegen is a deliberately separate ledger and NOT added.

Авторизация: нужен Authorization: Bearer <token>

ПараметрГдеОбязателенТипОписание
salescontracts_idqueryдаinteger
fromqueryнетstring | null
toqueryнетstring | null

Ответы:

КодСмыслТело
200Successful Responseмассив ArticleCostRow
401Missing or invalid authentication credentialsErrorResponse
422Validation ErrorHTTPValidationError

Costs By Contract

Открыть отдельной страницей →

Per-contract cost rollup (sum over each salescontracts_id).

Авторизация: нужен Authorization: Bearer <token>

ПараметрГдеОбязателенТипОписание
ai_company_idqueryнетinteger | null
fromqueryнетstring | null
toqueryнетstring | null

Ответы:

КодСмыслТело
200Successful Responseмассив ContractCostRow
401Missing or invalid authentication credentialsErrorResponse
422Validation ErrorHTTPValidationError

Costs By Pipeline Run

Открыть отдельной страницей →

Per-run cost rows, newest first.

Авторизация: нужен Authorization: Bearer <token>

ПараметрГдеОбязателенТипОписание
ai_company_idqueryнетinteger | null
fromqueryнетstring | null
toqueryнетstring | null
limitqueryнетinteger
offsetqueryнетinteger

Ответы:

КодСмыслТело
200Successful Responseмассив RunCostRow
401Missing or invalid authentication credentialsErrorResponse
422Validation ErrorHTTPValidationError

Costs Summary

Открыть отдельной страницей →

Cost + tokens + brave aggregated by day / contract / model / provider.

Авторизация: нужен Authorization: Bearer <token>

ПараметрГдеОбязателенТипОписание
group_byqueryнет"day" | "contract" | "model" | "provider"
ai_company_idqueryнетinteger | null
fromqueryнетstring | null
toqueryнетstring | null

Ответы:

КодСмыслТело
200Successful Responseмассив CostSummaryRow
401Missing or invalid authentication credentialsErrorResponse
422Validation ErrorHTTPValidationError