docs: add billable usage API enhancement proposal - #95
Open
mattdjenkinson wants to merge 3 commits into
Open
Conversation
Both cloud-portal and staff-portal call Amberflo's /usage endpoint directly with a shared server-side API key, bypassing the billing service entirely and violating the credential-isolation principle already established in usage-pipeline.md. Proposes a provider-agnostic billing usage-api that normalizes usage into FOCUS-aligned rows for both portals and datumctl. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reframes the CLI command from a deferred follow-up to a same-wave companion: it's the first caller with no session/portal BFF behind it, making it the cleanest validation that the endpoint's auth and shape are actually self-serve-ready. Links the companion issue (datum-cloud/datumctl#266). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a field-by-field inventory against cloud-portal's and staff-portal's MeterSeries/UsageFetchResult types (identical in both) so the migration drops nothing currently shown to users, plus a Provider Portability Guarantee spelling out that no Amberflo identifier (meterApiName, customerId) may leak into the public response -- the concrete bar for "can switch providers without the portals noticing." Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
mattdjenkinson
requested review from
0xmc,
JoseSzycho,
kevwilliams,
savme and
scotwells
August 4, 2026 13:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
billing usage-apiserver — the read-side counterpart to the existing durable usage pipeline — that exposes usage/cost as normalized, FOCUS-aligned rows scoped by billing account.cloud-portal(customer-facing) andstaff-portalhold a shared, server-side Amberflo API key and call Amberflo's/usageendpoint directly, violating the "only the Submission Controller holds provider credentials" principle already established inusage-pipeline.md.amberflo-providerto implement, rather than having this repo hold an Amberflo credential itself.cloud-portal,staff-portal, anddatumctl, with implementation of each companion side (provider query endpoint, portal migrations, CLI command) explicitly out of scope for this doc.Tracked by #94.
Test plan
usage-pipeline.mdandpayment-methods.mdconventions.