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.
Auth: Authorization: Bearer <token> required
Request
Section titled “Request”curl -sS -X GET "https://entherium.duckdns.org:8443/api/v1/metering/costs/by-article" \ -H "Authorization: Bearer <token>"Response 200
Section titled “Response 200”The contract carries no example for this response; schema: array of ArticleCostRow. Field-level shape: interactive explorer.
Returns
Section titled “Returns”array of ArticleCostRow — Successful Response
| Field | Type | Description |
|---|---|---|
amortized_collect_micro_usd | integer | |
cost_micro_usd | integer | |
direct_micro_usd | integer | |
generated_article_id | integer |
Parameters
Section titled “Parameters”| Parameter | In | Required | Type | Default | Constraints | Description |
|---|---|---|---|---|---|---|
salescontracts_id | query | yes | integer | — | — | |
from | query | no | string | null | — | date-time | |
to | query | no | string | null | — | date-time |
Errors
Section titled “Errors”| Code | Meaning | Body |
|---|---|---|
401 | Missing or invalid authentication credentials | ErrorResponse |
422 | Validation Error | HTTPValidationError |
Every error body is {detail, code?, request_id, doc_url} — request_id is the value to quote, doc_url points at the Errors reference.