Skip to content

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

Status: GA Access: token required API contract: 0.3.0 · capability 2026-09-03.1 View as Markdown Open in Claude Open in 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.

Auth: Authorization: Bearer <token> required

Terminal window
curl -sS -X GET "https://entherium.duckdns.org:8443/api/v1/metering/costs/by-article" \
-H "Authorization: Bearer <token>"

The contract carries no example for this response; schema: array of ArticleCostRow. Field-level shape: interactive explorer.

array of ArticleCostRow — Successful Response

FieldTypeDescription
amortized_collect_micro_usdinteger
cost_micro_usdinteger
direct_micro_usdinteger
generated_article_idinteger
ParameterInRequiredTypeDefaultConstraintsDescription
salescontracts_idqueryyesinteger——
fromquerynostring | null—date-time
toquerynostring | null—date-time
CodeMeaningBody
401Missing or invalid authentication credentialsErrorResponse
422Validation ErrorHTTPValidationError

Every error body is {detail, code?, request_id, doc_url} — request_id is the value to quote, doc_url points at the Errors reference.