API: metering
Это содержимое пока не доступно на вашем языке.
GET /api/v1/metering/costs/by-article
Section titled “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 — SPEC-107 §3.6 (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.
| Parameter | In | Required | Type |
|---|---|---|---|
salescontracts_id | query | yes | integer |
from | query | no | object |
to | query | no | object |
GET /api/v1/metering/costs/by-contract
Section titled “GET /api/v1/metering/costs/by-contract”Costs By Contract
Per-contract cost rollup (sum over each salescontracts_id).
| Parameter | In | Required | Type |
|---|---|---|---|
ai_company_id | query | no | object |
from | query | no | object |
to | query | no | object |
GET /api/v1/metering/costs/by-pipeline-run
Section titled “GET /api/v1/metering/costs/by-pipeline-run”Costs By Pipeline Run
Per-run cost rows, newest first.
| Parameter | In | Required | Type |
|---|---|---|---|
ai_company_id | query | no | object |
from | query | no | object |
to | query | no | object |
limit | query | no | integer |
offset | query | no | integer |
GET /api/v1/metering/costs/summary
Section titled “GET /api/v1/metering/costs/summary”Costs Summary
Cost + tokens + brave aggregated by day / contract / model / provider.
| Parameter | In | Required | Type |
|---|---|---|---|
group_by | query | no | string |
ai_company_id | query | no | object |
from | query | no | object |
to | query | no | object |