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

GET /api/v1/metering/costs/by-article

Статус: 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>

Окно терминала
curl -sS -X GET "https://entherium.duckdns.org:8443/api/v1/metering/costs/by-article" \
-H "Authorization: Bearer <token>"

В контракте нет примера для этого ответа; схема: массив ArticleCostRow. Поля — в интерактивном обозревателе.

массив ArticleCostRow — Successful Response

ПолеТипОписание
amortized_collect_micro_usdinteger
cost_micro_usdinteger
direct_micro_usdinteger
generated_article_idinteger
ПараметрГдеОбязателенТипПо умолчаниюОграниченияОписание
salescontracts_idqueryдаinteger——
fromqueryнетstring | null—date-time
toqueryнетstring | null—date-time
КодСмыслТело
401Missing or invalid authentication credentialsErrorResponse
422Validation ErrorHTTPValidationError

Тело любой ошибки — {detail, code?, request_id, doc_url}: request_id — что цитировать, doc_url ведёт в Справочник ошибок.