Admin Costs
GET /api/admin/cogs-rates
Section titled “GET /api/admin/cogs-rates”List Cogs Rates
Current plan + this month’s consumption for each flat-rate provider.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | CogsRateResponse[] |
| 422 | Validation Error | HTTPValidationError |
PUT /api/admin/cogs-rates/{metric}
Section titled “PUT /api/admin/cogs-rates/{metric}”Update Cogs Rate
Set a provider’s plan, then re-price the affected rollups.
effective_from defaults to the start of the current month so the change
covers the month being billed. Anything already rolled up from that date
forward is recomputed, since the hourly cron would only ever revisit its own
trailing window.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| metric | path | string | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| billing_mode | string | no | |
| effective_from | string (date) | no | |
| included_units | integer | no | |
| monthly_fee_usd | number | string | no | |
| overage_unit_usd | number | string | no | |
| plan | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | CogsRateResponse |
| 422 | Validation Error | HTTPValidationError |