GET /api/v1/metering/costs/by-article
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>"Ответ 200
Заголовок раздела «Ответ 200»В контракте нет примера для этого ответа; схема: массив ArticleCostRow. Поля — в интерактивном обозревателе.
Возвращает
Заголовок раздела «Возвращает»массив ArticleCostRow — Successful Response
| Поле | Тип | Описание |
|---|---|---|
amortized_collect_micro_usd | integer | |
cost_micro_usd | integer | |
direct_micro_usd | integer | |
generated_article_id | integer |
Параметры
Заголовок раздела «Параметры»| Параметр | Где | Обязателен | Тип | По умолчанию | Ограничения | Описание |
|---|---|---|---|---|---|---|
salescontracts_id | query | да | integer | — | — | |
from | query | нет | string | null | — | date-time | |
to | query | нет | string | null | — | date-time |
| Код | Смысл | Тело |
|---|---|---|
401 | Missing or invalid authentication credentials | ErrorResponse |
422 | Validation Error | HTTPValidationError |
Тело любой ошибки — {detail, code?, request_id, doc_url}: request_id — что цитировать, doc_url ведёт в Справочник ошибок.