Receive llm_usage_recorded events from arcadia-llm-gateway

POST /api/v1/integrations/llm-usage stores priced LLM usage events
(idempotent on gateway_request_id) in llm_usage_events. The gateway is
the LLM-pricing authority — arcadia-cloud trusts the charge it sends
rather than re-pricing.

The monthly invoice rollup now appends an llm_usage line per deployment
alongside the infra quote lines; the exact decimal charges are summed
and rounded to cents once. Closes the gateway→cloud billing loop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-21 08:29:36 +10:00
parent 29f4ad97d6
commit e1f0aedcf7
6 changed files with 269 additions and 1 deletions

View File

@@ -42,5 +42,7 @@ defmodule ArcadiaCloudWeb.Router do
get "/dashboard/margin", DashboardController, :margin
get "/dashboard/accrual", DashboardController, :accrual
post "/integrations/llm-usage", IntegrationsController, :llm_usage
end
end