Cloud usage and compute pricing contract
@akter/cloud-api describes hosted usage as commands, compute and outbound traffic. Compute replaces storage as the priced resource meter. CloudApi.billing.listPlans returns the PlanCatalog, and CloudApi.usage.get returns an organization’s Usage for a billing period. This document defines the shape of those responses. Prices and allowances come from the hosted pricing configuration and are not part of the contract.
Compute units
Compute is billed in compute unit-hours. The plan catalog’scomputeSizes gives the unit weight of every machine size: each ComputeSize is { cpuKind, cpus, memoryMb, unitsPerHour }, and one hour of that size bills unitsPerHour compute unit-hours. cpuKind is shared or performance, cpus and memoryMb are positive integers, and unitsPerHour is greater than zero. The weights come from the hosted pricing configuration and are not fixed by the contract. computeSizes is optional so older catalogs still decode; current servers always send it.
Plan catalog
EachCatalogPlan carries:
The compute fields are optional in the schema so that responses from servers that predate compute pricing still decode. Current servers always send them. When a compute value is present, decoding refuses it if it is negative. The command allowance, command cap, concurrent connections and command overage are unchanged.
Usage report
- The
runnerHoursmeter is measured in compute unit-hours, not machine hours. TheegressGbmeter is outbound traffic in decimal gigabytes. UsagePricing.computeCentsPerUnitHouris the published compute overage price. It is optional for the same reason as the catalog fields, and current servers always send it.- A
CapStatewithcap: "compute"reportslimitandusedin compute unit-hours for the current billing period. - Each
byProjectentry may carrycomputeUnitHours, the project’s compute for the period, andcompute, an array ofComputeUsagerecords. Both are omitted for a project whose compute is not metered. - A
ComputeUsagerecord is{ environmentId, cpuKind, cpus, memoryMb, machineHours, computeUnitHours }for one machine size in one environment.environmentIdis an opaque control-plane identifier.cpuKindissharedorperformance.cpusandmemoryMbare positive integers.machineHoursholds the raw machine hours, andcomputeUnitHoursholds the unit-hours billed for them at the size’s catalog weight. Decoding refuses negative hours, a machine with no CPU or memory, fractional CPUs or memory, an unknown CPU kind and an empty environment. It does not recompute unit-hours from the machine size, because the weights belong to the pricing configuration.
Deprecated storage fields
The server no longer reports storage. These fields and values stay optional or decodable so clients reading older responses keep working, and new servers emit none of them:CatalogPlan.allowances.storageGbandCatalogPlan.overage.storageCentsPerGbMonth;- the
storage-overageandstorage-capplan features; - the
storagecap and thestorageGbmeter; Usage.latestStorageSample, a project’sstorageGbMonths, andUsagePricing.storagePerGbCents.