Skip to main content

Fake Cloud Cost & Usage Data API

MOCK DATA

Generate FOCUS-column-named cloud billing rows whose list, contracted, effective and billed costs reconcile exactly, plus summary and commitment views.

Generated test data for fixtures and development

Base URL
/api/cloud-costs
Capabilities
3 routes Seedable
Last updated
July 30, 2026

GET /api/cloud-costs

A seeded billing period is exactly 100 rows built from one deterministic stream. The four selection filters choose from those rows without regenerating them, and count is a limit — so seeded prefixes are stable.

Live requestRuns against the public API
No key required
GET/api/cloud-costs?seed=42

Request parameters

The calendar month this fixture invoices, as YYYY-MM (2000-01 … 2099-12). It sets BillingPeriodStart and BillingPeriodEnd on every row. Defaults to the previous complete UTC month and the resolved value is echoed in meta.params, so any response can be replayed exactly.

Active ISO 4217 code (case-insensitive) used as BillingCurrency and as the denomination of every price and cost. Prices are NOT converted — changing this relabels the fixture, it does not apply an exchange rate.

Charge-period length for metered usage rows: one clean UTC hour or one clean UTC day. Period-level rows (commitment purchase, unused commitment, tax, credit) always span the whole billing period.

How many distinct sub accounts the period's metered usage is spread across (EX-SA-0001 upward). Tax, credit, purchase and unused rows stay at billing-account level with a null SubAccountId.

How many commitment discounts exist in the period. Each one adds a Purchase row, an Unused row and a block of commitment-covered Used usage rows. 0 means no committed pricing anywhere and /commitments returns an empty list.

Whole-percentage tax applied once per period to the summed BilledCost of every non-correction Usage and Purchase row, producing the single Tax row. 0 emits no Tax row at all.

Return only rows with this FOCUS ChargeCategory. Adjustment is not offered because this fixture never emits adjustment rows.

Return only rows with this FOCUS ServiceCategory. Only the seven categories this fixture's SKU catalogue actually uses are offered; Other selects the tax and credit rows.

Correction returns only the prior-period correction rows; regular returns only rows whose ChargeClass is null (FOCUS defines Correction as the single allowed value, so 'regular' is this endpoint's word for the null case).

Return only rows belonging to one sub account, matched exactly and case-sensitively. An id that exists in no row returns an empty list plus a warning listing the period's sub-account ids — never a substitute row.

Advanced response options7 options

Limit the number of returned records (1–100). Defaults to 10.

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/cloud-costs?seed=42"
const res = await fetch("https://randomapi.dev/api/cloud-costs?seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/cloud-costs?seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/cloud-costs?seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 10
billingPeriod string

The calendar month this fixture invoices, as YYYY-MM (2000-01 … 2099-12). It sets BillingPeriodStart and BillingPeriodEnd on every row. Defaults to the previous complete UTC month and the resolved value is echoed in meta.params, so any response can be replayed exactly.

example: billingPeriod=2026-05
currency string

Active ISO 4217 code (case-insensitive) used as BillingCurrency and as the denomination of every price and cost. Prices are NOT converted — changing this relabels the fixture, it does not apply an exchange rate.

default: USD
example: currency=EUR
granularity enum

Charge-period length for metered usage rows: one clean UTC hour or one clean UTC day. Period-level rows (commitment purchase, unused commitment, tax, credit) always span the whole billing period.

default: daily
allowed: hourly | daily
example: granularity=hourly
subAccounts int

How many distinct sub accounts the period's metered usage is spread across (EX-SA-0001 upward). Tax, credit, purchase and unused rows stay at billing-account level with a null SubAccountId.

default: 3
allowed: 1 – 8
example: subAccounts=5
commitments int

How many commitment discounts exist in the period. Each one adds a Purchase row, an Unused row and a block of commitment-covered Used usage rows. 0 means no committed pricing anywhere and /commitments returns an empty list.

default: 2
allowed: 0 – 4
example: commitments=4
taxRatePercent int

Whole-percentage tax applied once per period to the summed BilledCost of every non-correction Usage and Purchase row, producing the single Tax row. 0 emits no Tax row at all.

default: 20
allowed: 0 – 30
example: taxRatePercent=25
chargeCategory enum

Return only rows with this FOCUS ChargeCategory. Adjustment is not offered because this fixture never emits adjustment rows.

default: any
allowed: any | Usage | Purchase | Tax | Credit
example: chargeCategory=Purchase
serviceCategory enum

Return only rows with this FOCUS ServiceCategory. Only the seven categories this fixture's SKU catalogue actually uses are offered; Other selects the tax and credit rows.

default: any
allowed: any | Compute | Storage | Databases | Networking | Analytics | Security | Other
example: serviceCategory=Compute
chargeClass enum

Correction returns only the prior-period correction rows; regular returns only rows whose ChargeClass is null (FOCUS defines Correction as the single allowed value, so 'regular' is this endpoint's word for the null case).

default: any
allowed: any | Correction | regular
example: chargeClass=Correction
subAccountId string

Return only rows belonging to one sub account, matched exactly and case-sensitively. An id that exists in no row returns an empty list plus a warning listing the period's sub-account ids — never a substitute row.

example: subAccountId=EX-SA-0002
Universal parameters Shared response and formatting options 7
count int

Limit the number of returned records (1–100). Defaults to 10.

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=AvailabilityZone,BilledCost
exclude list

Return all fields except these (comma-separated).

example: exclude=Tags
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 49
AvailabilityZone string nullable

Provider-assigned zone inside the region. Set only on metered rows for zonal SKUs (virtual machines, containers, block volumes, database instances and cache nodes); null everywhere else.

example: ex-eu-1a

BilledCost number

Cost as invoiced in the billing period. 0 on usage rows covered by a commitment (the commitment's Purchase row carries that money instead) and negative on credit and correction rows.

example: 8.9856

BillingAccountId string

Fictional billing-account id, identical on all 100 rows of a seeded period.

example: EX-BA-4821

BillingAccountName string

Display name of that fictional billing account, identical on all 100 rows.

example: Fixture Industries

BillingAccountType string

Provider-defined label for the account type. FOCUS leaves this open; this fictional provider always says 'Billing Account'.

example: Billing Account

BillingCurrency string

ISO 4217 code every price and cost on the row is denominated in — the resolved `currency` param, identical on all 100 rows.

example: USD

BillingPeriodEnd string (ISO 8601, seconds precision, UTC)

Exclusive end of the billing period: the first instant of the next month. Identical on all 100 rows.

example: 2026-07-01T00:00:00Z

BillingPeriodStart string (ISO 8601, seconds precision, UTC)

Inclusive start of the billing period: the first instant of the resolved billingPeriod month. Identical on all 100 rows, including the correction rows whose charge period lies in the previous month.

example: 2026-06-01T00:00:00Z

ChargeCategory string

FOCUS charge classification. This fixture emits Usage, Purchase, Tax and Credit; it never emits Adjustment.

example: Usage

ChargeClass string nullable

'Correction' on rows that correct the previous, already-closed billing period; null on every other row. Correction is the only value FOCUS allows.

example: null

ChargeDescription string

Human summary of the charge: service and meter for metered rows, the commitment name for purchase and unused rows, and the corrected month for corrections.

example: Virtual Machines — Instance uptime (2 vCPU) in ex-eu-1

ChargeFrequency string

One-Time | Recurring | Usage-Based. Metered, unused-commitment and correction rows are Usage-Based, commitment purchases and tax are Recurring, credits are One-Time. FOCUS forbids Usage-Based on a Purchase row and this fixture honours that.

example: Usage-Based

ChargePeriodEnd string (ISO 8601, seconds precision, UTC)

Exclusive end of the charge period. One granularity slot after ChargePeriodStart for metered rows, the billing-period end for period-level rows.

example: 2026-06-04T00:00:00Z

ChargePeriodStart string (ISO 8601, seconds precision, UTC)

Inclusive start of the charge period, always a whole UTC hour or day boundary. Correction rows carry a day in the PREVIOUS month, so the response is not globally sorted by this column.

example: 2026-06-03T00:00:00Z

CommitmentDiscountCategory string nullable

'Usage' on every row tied to a commitment, null otherwise. Spend-based commitments are out of scope, so the FOCUS value 'Spend' never appears.

example: null

CommitmentDiscountId string nullable

Fictional commitment id on the commitment's Purchase, Unused and Used rows; null on on-demand, tax, credit and correction rows.

example: null

CommitmentDiscountName string nullable

Display name of that commitment; null exactly when CommitmentDiscountId is null.

example: null

CommitmentDiscountQuantity number nullable

Committed units in CommitmentDiscountUnit: the whole term quantity on the Purchase row, the drawn-down quantity on a Used row and the leftover on the Unused row. Used + Unused equals Purchase exactly.

example: null

CommitmentDiscountStatus string nullable

Used or Unused on commitment-related Usage rows; null on the Purchase row (FOCUS scopes the column to usage) and on every unrelated row.

example: null

CommitmentDiscountType string nullable

Provider-defined commitment type. FOCUS fixes no enum here, so this fictional provider uses 'Capacity Commitment' and 'Usage Commitment'.

example: null

CommitmentDiscountUnit string nullable

Unit the committed quantity is measured in. Always Hours here, because every commitment-eligible SKU is priced per hour.

example: null

ConsumedQuantity number nullable

Volume actually consumed, in ConsumedUnit. Exactly PricingQuantity × the SKU's documented integer factor (1 everywhere except the serverless SKU, which prices per hour and consumes per second). Null on Purchase, Tax, Credit, Correction and Unused rows, as FOCUS requires.

example: 12

ConsumedUnit string nullable

FOCUS UnitFormat unit for ConsumedQuantity — Hours, Seconds, GB or TB here. Null exactly when ConsumedQuantity is null.

example: Hours

ContractedCost number

Cost at the negotiated on-demand rate: exactly ContractedUnitPrice × PricingQuantity when both are set, and equal to BilledCost on the commitment Purchase row and on tax, credit and correction rows.

example: 8.9856

ContractedUnitPrice number nullable

Negotiated unit price in the billing currency — the SKU's list price less its fixed fictional discount, or the commitment rate on the Purchase row. Null wherever SkuPriceId is null (tax, credit and correction rows).

example: 0.03744

EffectiveCost number

Amortized cost. Equals BilledCost on on-demand usage, tax, credit and correction rows; 0 on the commitment Purchase row; and the commitment's amortized share on Used and Unused rows. FOCUS imposes no product rule on this column, which is what makes the exact allocation legal.

example: 8.9856

InvoiceId string

Issuer-assigned invoice id for this billing period and account — identical on all 100 rows.

example: EX-INV-202606-4821

InvoiceIssuerName string

Who issued the invoice. Always the fictional provider itself: this fixture models a direct billing relationship with no reseller or marketplace.

example: Example Cloud

ListCost number

Cost at the public list rate: exactly ListUnitPrice × PricingQuantity when both are set, and equal to BilledCost on tax, credit and correction rows.

example: 9.984

ListUnitPrice number nullable

Public list unit price in the billing currency, before any discount. Null wherever SkuPriceId is null.

example: 0.0416

PricingCategory string nullable

Standard on on-demand usage and on the commitment purchase, Committed on commitment-covered Used and Unused rows, null on tax, credit and correction rows. The FOCUS values Dynamic and Other never appear.

example: Standard

PricingQuantity number nullable

Volume the price is applied to, in PricingUnit. A metered row never bills more of a time unit than its charge period contains; a commitment Purchase or Unused row is an aggregate across instances and can exceed the period length.

example: 12

PricingUnit string nullable

FOCUS UnitFormat unit PricingQuantity is measured in — Hours, GB or TB here. Null exactly when PricingQuantity is null.

example: Hours

RegionId string nullable

Fictional region id. Null only on tax and credit rows, which are not operated in a distinct region.

example: ex-eu-1

RegionName string nullable

Display name of that region; null exactly when RegionId is null.

example: Example EU Central

ResourceId string nullable

Fictional resource id, unique per resource across the period's metered rows. On a commitment purchase row and on its unused-capacity row it is the commitment's own id, because FOCUS requires CommitmentDiscountId to equal ResourceId there. Null on tax, credit and correction rows, which are not attributable to one resource.

example: EX-RES-0007

ResourceName string nullable

Display name of that resource; the commitment name on purchase and unused rows. Null exactly when ResourceId is null.

example: fixture-vm-a2-0007

ResourceType string nullable

Provider-defined resource type for the SKU (Virtual machine, Block volume, Query workspace, …), or 'Commitment discount' on the purchase and unused rows. Null exactly when ResourceId is null.

example: Virtual machine

ServiceCategory string

One of the 19 FOCUS service categories. This fixture's catalogue uses Compute, Storage, Databases, Networking, Analytics and Security, plus Other for the tax and credit rows.

example: Compute

ServiceName string

Fictional service name — 'Taxes' on the tax row and 'Account Credits' on credit rows.

example: Virtual Machines

ServiceProviderName string

Who operates the service. Always the same fictional provider.

example: Example Cloud

ServiceSubcategory string

FOCUS service subcategory, always a member of the set its ServiceCategory allows (note the lower-case 'c' in the column id).

example: Virtual Machines

SkuId string nullable

Fictional SKU id. Null on tax, credit and correction rows — FOCUS requires null for Tax and permits it on a Correction.

example: EX-CMP-VM-A2

SkuMeter string nullable

Short meter label for the SKU; null exactly when SkuId is null.

example: Instance uptime (2 vCPU)

SkuPriceId string nullable

Id of the priced SKU variant: the SKU plus region plus '-OD' for on-demand rates or '-CMT' for the commitment rate. Deliberately different from SkuId (FOCUS says they MAY match), which exercises consumers that assume they are equal.

example: EX-CMP-VM-A2-ex-eu-1-OD

SubAccountId string nullable

Fictional sub-account id on metered and correction rows; null on the account-level purchase, unused, tax and credit rows (note the capital 'A' in the column id).

example: EX-SA-0002

SubAccountName string nullable

Display name of that sub account; null exactly when SubAccountId is null.

example: Data Engineering

SubAccountType string nullable

Provider-defined sub-account type, 'Project' for this fictional provider; null exactly when SubAccountId is null, as FOCUS requires.

example: Project

Tags object nullable

Flat JSON object of exactly two user-defined tags (env and costCenter) on metered usage rows; null on purchase, unused, tax, credit and correction rows. A single user-defined scheme carries no provider prefix, per the FOCUS Tags rule.

example: {"env":"prod","costCenter":"cc-1003"}

Documented examples

Build-generated requests and complete responses
5
The first ten rows of a seeded billing period
GET /api/cloud-costs?seed=42
{
  "data": [
    {
      "AvailabilityZone": "ex-eu-1a",
      "BilledCost": 0,
      "BillingAccountId": "EX-BA-4777",
      "BillingAccountName": "Fixture Labs",
      "BillingAccountType": "Billing Account",
      "BillingCurrency": "USD",
      "BillingPeriodEnd": "2026-07-01T00:00:00Z",
      "BillingPeriodStart": "2026-06-01T00:00:00Z",
      "ChargeCategory": "Usage",
      "ChargeClass": null,
      "ChargeDescription": "Managed Relational Database — Instance uptime (4 vCPU) (commitment applied)",
      "ChargeFrequency": "Usage-Based",
      "ChargePeriodEnd": "2026-06-02T00:00:00Z",
      "ChargePeriodStart": "2026-06-01T00:00:00Z",
      "CommitmentDiscountCategory": "Usage",
      "CommitmentDiscountId": "EX-CMT-0001",
      "CommitmentDiscountName": "Usage commitment — Managed Relational Database (3 year)",
      "CommitmentDiscountQuantity": 10.499,
      "CommitmentDiscountStatus": "Used",
      "CommitmentDiscountType": "Usage Commitment",
      "CommitmentDiscountUnit": "Hours",
      "ConsumedQuantity": 10.499,
      "ConsumedUnit": "Hours",
      "ContractedCost": 2.213189,
      "ContractedUnitPrice": 0.2108,
      "EffectiveCost": 1.947606,
      "InvoiceId": "EX-INV-202606-4777",
      "InvoiceIssuerName": "Example Cloud",
      "ListCost": 2.603752,
      "ListUnitPrice": 0.248,
      "PricingCategory": "Committed",
      "PricingQuantity": 10.499,
      "PricingUnit": "Hours",
      "RegionId": "ex-eu-1",
      "RegionName": "Example EU Central",
      "ResourceId": "EX-RES-0001",
      "ResourceName": "fixture-sql-m4-0001",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
A whole 100-row billing period
GET /api/cloud-costs?seed=42&count=100
{
  "data": [
    {
      "AvailabilityZone": "ex-eu-1a",
      "BilledCost": 0,
      "BillingAccountId": "EX-BA-4777",
      "BillingAccountName": "Fixture Labs",
      "BillingAccountType": "Billing Account",
      "BillingCurrency": "USD",
      "BillingPeriodEnd": "2026-07-01T00:00:00Z",
      "BillingPeriodStart": "2026-06-01T00:00:00Z",
      "ChargeCategory": "Usage",
      "ChargeClass": null,
      "ChargeDescription": "Managed Relational Database — Instance uptime (4 vCPU) (commitment applied)",
      "ChargeFrequency": "Usage-Based",
      "ChargePeriodEnd": "2026-06-02T00:00:00Z",
      "ChargePeriodStart": "2026-06-01T00:00:00Z",
      "CommitmentDiscountCategory": "Usage",
      "CommitmentDiscountId": "EX-CMT-0001",
      "CommitmentDiscountName": "Usage commitment — Managed Relational Database (3 year)",
      "CommitmentDiscountQuantity": 10.499,
      "CommitmentDiscountStatus": "Used",
      "CommitmentDiscountType": "Usage Commitment",
      "CommitmentDiscountUnit": "Hours",
      "ConsumedQuantity": 10.499,
      "ConsumedUnit": "Hours",
      "ContractedCost": 2.213189,
      "ContractedUnitPrice": 0.2108,
      "EffectiveCost": 1.947606,
      "InvoiceId": "EX-INV-202606-4777",
      "InvoiceIssuerName": "Example Cloud",
      "ListCost": 2.603752,
      "ListUnitPrice": 0.248,
      "PricingCategory": "Committed",
      "PricingQuantity": 10.499,
      "PricingUnit": "Hours",
      "RegionId": "ex-eu-1",
      "RegionName": "Example EU Central",
      "ResourceId": "EX-RES-0001",
      "ResourceName": "fixture-sql-m4-0001",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Commitment-covered compute usage
GET /api/cloud-costs?seed=42&serviceCategory=Compute&chargeCategory=Usage&count=20
{
  "data": [
    {
      "AvailabilityZone": "ex-us-2b",
      "BilledCost": 0.184208,
      "BillingAccountId": "EX-BA-4777",
      "BillingAccountName": "Fixture Labs",
      "BillingAccountType": "Billing Account",
      "BillingCurrency": "USD",
      "BillingPeriodEnd": "2026-07-01T00:00:00Z",
      "BillingPeriodStart": "2026-06-01T00:00:00Z",
      "ChargeCategory": "Usage",
      "ChargeClass": null,
      "ChargeDescription": "Container Service — Task uptime in ex-us-2",
      "ChargeFrequency": "Usage-Based",
      "ChargePeriodEnd": "2026-06-03T00:00:00Z",
      "ChargePeriodStart": "2026-06-02T00:00:00Z",
      "CommitmentDiscountCategory": null,
      "CommitmentDiscountId": null,
      "CommitmentDiscountName": null,
      "CommitmentDiscountQuantity": null,
      "CommitmentDiscountStatus": null,
      "CommitmentDiscountType": null,
      "CommitmentDiscountUnit": null,
      "ConsumedQuantity": 6.719,
      "ConsumedUnit": "Hours",
      "ContractedCost": 0.184208,
      "ContractedUnitPrice": 0.027416,
      "EffectiveCost": 0.184208,
      "InvoiceId": "EX-INV-202606-4777",
      "InvoiceIssuerName": "Example Cloud",
      "ListCost": 0.200226,
      "ListUnitPrice": 0.0298,
      "PricingCategory": "Standard",
      "PricingQuantity": 6.719,
      "PricingUnit": "Hours",
      "RegionId": "ex-us-2",
      "RegionName": "Example US West",
      "ResourceId": "EX-RES-0005",
      "ResourceName": "fixture-task-0005",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Hourly charge periods for a fixed month in euros
GET /api/cloud-costs?seed=7&billingPeriod=2026-05&granularity=hourly&currency=EUR&count=24
{
  "data": [
    {
      "AvailabilityZone": null,
      "BilledCost": 0.214272,
      "BillingAccountId": "EX-BA-6779",
      "BillingAccountName": "Fixture Retail",
      "BillingAccountType": "Billing Account",
      "BillingCurrency": "EUR",
      "BillingPeriodEnd": "2026-06-01T00:00:00Z",
      "BillingPeriodStart": "2026-05-01T00:00:00Z",
      "ChargeCategory": "Usage",
      "ChargeClass": null,
      "ChargeDescription": "Data Warehouse — Warehouse slot uptime in ex-us-1",
      "ChargeFrequency": "Usage-Based",
      "ChargePeriodEnd": "2026-05-01T01:00:00Z",
      "ChargePeriodStart": "2026-05-01T00:00:00Z",
      "CommitmentDiscountCategory": null,
      "CommitmentDiscountId": null,
      "CommitmentDiscountName": null,
      "CommitmentDiscountQuantity": null,
      "CommitmentDiscountStatus": null,
      "CommitmentDiscountType": null,
      "CommitmentDiscountUnit": null,
      "ConsumedQuantity": 0.558,
      "ConsumedUnit": "Hours",
      "ContractedCost": 0.214272,
      "ContractedUnitPrice": 0.384,
      "EffectiveCost": 0.214272,
      "InvoiceId": "EX-INV-202605-6779",
      "InvoiceIssuerName": "Example Cloud",
      "ListCost": 0.26784,
      "ListUnitPrice": 0.48,
      "PricingCategory": "Standard",
      "PricingQuantity": 0.558,
      "PricingUnit": "Hours",
      "RegionId": "ex-us-1",
      "RegionName": "Example US East",
      "ResourceId": "EX-RES-0001",
      "ResourceName": "fixture-wh-slot-0001",
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Prior-period corrections on this invoice
GET /api/cloud-costs?seed=42&chargeClass=Correction&count=10
{
  "data": [
    {
      "AvailabilityZone": null,
      "BilledCost": -152.46,
      "BillingAccountId": "EX-BA-4777",
      "BillingAccountName": "Fixture Labs",
      "BillingAccountType": "Billing Account",
      "BillingCurrency": "USD",
      "BillingPeriodEnd": "2026-07-01T00:00:00Z",
      "BillingPeriodStart": "2026-06-01T00:00:00Z",
      "ChargeCategory": "Usage",
      "ChargeClass": "Correction",
      "ChargeDescription": "Correction to Virtual Machines charges for 2026-05",
      "ChargeFrequency": "Usage-Based",
      "ChargePeriodEnd": "2026-05-02T00:00:00Z",
      "ChargePeriodStart": "2026-05-01T00:00:00Z",
      "CommitmentDiscountCategory": null,
      "CommitmentDiscountId": null,
      "CommitmentDiscountName": null,
      "CommitmentDiscountQuantity": null,
      "CommitmentDiscountStatus": null,
      "CommitmentDiscountType": null,
      "CommitmentDiscountUnit": null,
      "ConsumedQuantity": null,
      "ConsumedUnit": null,
      "ContractedCost": -152.46,
      "ContractedUnitPrice": null,
      "EffectiveCost": -152.46,
      "InvoiceId": "EX-INV-202606-4777",
      "InvoiceIssuerName": "Example Cloud",
      "ListCost": -152.46,
      "ListUnitPrice": null,
      "PricingCategory": null,
      "PricingQuantity": null,
      "PricingUnit": null,
      "RegionId": "ex-us-2",
      "RegionName": "Example US West",
      "ResourceId": null,
      "ResourceName": null,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

GET /api/cloud-costs/summary

Aggregates exactly the rows the root route returns for the same seed and the same generation and selection parameters. Every group's costs sum to totals in exact integer micro-units.

Live requestRuns against the public API
No key required
GET/api/cloud-costs/summary?seed=42

Request parameters

The calendar month this fixture invoices, as YYYY-MM (2000-01 … 2099-12). It sets BillingPeriodStart and BillingPeriodEnd on every row. Defaults to the previous complete UTC month and the resolved value is echoed in meta.params, so any response can be replayed exactly.

Active ISO 4217 code (case-insensitive) used as BillingCurrency and as the denomination of every price and cost. Prices are NOT converted — changing this relabels the fixture, it does not apply an exchange rate.

Charge-period length for metered usage rows: one clean UTC hour or one clean UTC day. Period-level rows (commitment purchase, unused commitment, tax, credit) always span the whole billing period.

How many distinct sub accounts the period's metered usage is spread across (EX-SA-0001 upward). Tax, credit, purchase and unused rows stay at billing-account level with a null SubAccountId.

How many commitment discounts exist in the period. Each one adds a Purchase row, an Unused row and a block of commitment-covered Used usage rows. 0 means no committed pricing anywhere and /commitments returns an empty list.

Whole-percentage tax applied once per period to the summed BilledCost of every non-correction Usage and Purchase row, producing the single Tax row. 0 emits no Tax row at all.

Return only rows with this FOCUS ChargeCategory. Adjustment is not offered because this fixture never emits adjustment rows.

Return only rows with this FOCUS ServiceCategory. Only the seven categories this fixture's SKU catalogue actually uses are offered; Other selects the tax and credit rows.

Correction returns only the prior-period correction rows; regular returns only rows whose ChargeClass is null (FOCUS defines Correction as the single allowed value, so 'regular' is this endpoint's word for the null case).

Return only rows belonging to one sub account, matched exactly and case-sensitively. An id that exists in no row returns an empty list plus a warning listing the period's sub-account ids — never a substitute row.

Seed of the billing period to summarise. Any integer (reduced modulo 2³² like the platform's universal seed) — pass the `seed` echoed by the root route to aggregate exactly the rows you fetched.

Which FOCUS column to group by. Day groups by the UTC calendar date of ChargePeriodStart, so a correction row lands on a day in the previous month. Nullable columns produce one group whose groupKey is null, and that group sorts last.

Advanced response options4 options

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/cloud-costs/summary?seed=42"
const res = await fetch("https://randomapi.dev/api/cloud-costs/summary?seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/cloud-costs/summary?seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/cloud-costs/summary?seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 12
billingPeriod string

The calendar month this fixture invoices, as YYYY-MM (2000-01 … 2099-12). It sets BillingPeriodStart and BillingPeriodEnd on every row. Defaults to the previous complete UTC month and the resolved value is echoed in meta.params, so any response can be replayed exactly.

example: billingPeriod=2026-05
currency string

Active ISO 4217 code (case-insensitive) used as BillingCurrency and as the denomination of every price and cost. Prices are NOT converted — changing this relabels the fixture, it does not apply an exchange rate.

default: USD
example: currency=EUR
granularity enum

Charge-period length for metered usage rows: one clean UTC hour or one clean UTC day. Period-level rows (commitment purchase, unused commitment, tax, credit) always span the whole billing period.

default: daily
allowed: hourly | daily
example: granularity=hourly
subAccounts int

How many distinct sub accounts the period's metered usage is spread across (EX-SA-0001 upward). Tax, credit, purchase and unused rows stay at billing-account level with a null SubAccountId.

default: 3
allowed: 1 – 8
example: subAccounts=5
commitments int

How many commitment discounts exist in the period. Each one adds a Purchase row, an Unused row and a block of commitment-covered Used usage rows. 0 means no committed pricing anywhere and /commitments returns an empty list.

default: 2
allowed: 0 – 4
example: commitments=4
taxRatePercent int

Whole-percentage tax applied once per period to the summed BilledCost of every non-correction Usage and Purchase row, producing the single Tax row. 0 emits no Tax row at all.

default: 20
allowed: 0 – 30
example: taxRatePercent=25
chargeCategory enum

Return only rows with this FOCUS ChargeCategory. Adjustment is not offered because this fixture never emits adjustment rows.

default: any
allowed: any | Usage | Purchase | Tax | Credit
example: chargeCategory=Purchase
serviceCategory enum

Return only rows with this FOCUS ServiceCategory. Only the seven categories this fixture's SKU catalogue actually uses are offered; Other selects the tax and credit rows.

default: any
allowed: any | Compute | Storage | Databases | Networking | Analytics | Security | Other
example: serviceCategory=Compute
chargeClass enum

Correction returns only the prior-period correction rows; regular returns only rows whose ChargeClass is null (FOCUS defines Correction as the single allowed value, so 'regular' is this endpoint's word for the null case).

default: any
allowed: any | Correction | regular
example: chargeClass=Correction
subAccountId string

Return only rows belonging to one sub account, matched exactly and case-sensitively. An id that exists in no row returns an empty list plus a warning listing the period's sub-account ids — never a substitute row.

example: subAccountId=EX-SA-0002
seed int

Seed of the billing period to summarise. Any integer (reduced modulo 2³² like the platform's universal seed) — pass the `seed` echoed by the root route to aggregate exactly the rows you fetched.

default: 1
example: seed=42
groupBy enum

Which FOCUS column to group by. Day groups by the UTC calendar date of ChargePeriodStart, so a correction row lands on a day in the previous month. Nullable columns produce one group whose groupKey is null, and that group sorts last.

default: ServiceCategory
allowed: ServiceCategory | ServiceSubcategory | ServiceName | SubAccountId | ChargeCategory | PricingCategory | RegionId | CommitmentDiscountId | Day
example: groupBy=Day
Universal parameters Shared response and formatting options 4
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=billingPeriod,billingPeriodStart
exclude list

Return all fields except these (comma-separated).

example: exclude=totals
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 11
billingPeriod string

Resolved billing month as YYYY-MM.

example: 2026-06

billingPeriodStart string (ISO 8601, seconds precision, UTC)

Inclusive first instant of the period — the BillingPeriodStart of every row.

example: 2026-06-01T00:00:00Z

billingPeriodEnd string (ISO 8601, seconds precision, UTC)

Exclusive first instant of the next period.

example: 2026-07-01T00:00:00Z

billingCurrency string

ISO 4217 code all amounts in this response are denominated in.

example: USD

decimalPlaces integer

Fractional digits every monetary value in this response is rounded to. Always 6 — this fixture's precision, not the currency's ISO 4217 minor unit.

example: 6

groupBy string

The FOCUS column (or Day) the groups are keyed on.

example: ServiceCategory

periodRowCount integer

Rows in the whole seeded period before any selection filter. Always 100.

example: 100

rowCount integer

Rows matching the selection filters — exactly what the root route returns at count=100 with the same params.

example: 100

groupCount integer

Number of groups; always equal to groups.length.

example: 7

groups object[]

One entry per distinct key, ordered by groupKey ascending (code-unit order) with the null key last. Each carries groupKey, rowCount and the four cost measures summed in exact integer micro-units.

example: [{"groupKey":"Compute","rowCount":34,"billedCost":812.4432,"contractedCost":903.16,"effectiveCost":890.2011,"listCost":1003.5111}]

totals object

Grand totals over the matching rows. Each cost is the exact sum of the corresponding groups value.

example: {"rowCount":100,"billedCost":4210.9912,"contractedCost":4788.0044,"effectiveCost":4210.9912,"listCost":5602.771}

Documented examples

Build-generated requests and complete responses
5
Cost by service category for the default period
GET /api/cloud-costs/summary?seed=42
{
  "data": {
    "billingPeriod": "2026-06",
    "billingPeriodStart": "2026-06-01T00:00:00Z",
    "billingPeriodEnd": "2026-07-01T00:00:00Z",
    "billingCurrency": "USD",
    "decimalPlaces": 6,
    "groupBy": "ServiceCategory",
    "periodRowCount": 100,
    "rowCount": 100,
    "groupCount": 7,
    "groups": [
      {
        "groupKey": "Analytics",
        "rowCount": 8,
        "billedCost": 486.329954,
        "contractedCost": 486.329954,
        "effectiveCost": 486.329954,
        "listCost": 540.366615
      },
      {
        "groupKey": "Compute",
        "rowCount": 20,
        "billedCost": -161.017745,
        "contractedCost": -161.017745,
        "effectiveCost": -161.017745,
        "listCost": -160.404282
      },
      {
        "groupKey": "Databases",
        "rowCount": 53,
        "billedCost": 184.345439,
        "contractedCost": 370.757433,
        "effectiveCost": 184.345439,
        "listCost": 493.663026
      },
      {
        "groupKey": "Networking",
        "rowCount": 7,
        "billedCost": 966.159014,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Daily billed cost for a fixed month
GET /api/cloud-costs/summary?seed=42&billingPeriod=2026-05&groupBy=Day
{
  "data": {
    "billingPeriod": "2026-05",
    "billingPeriodStart": "2026-05-01T00:00:00Z",
    "billingPeriodEnd": "2026-06-01T00:00:00Z",
    "billingCurrency": "USD",
    "decimalPlaces": 6,
    "groupBy": "Day",
    "periodRowCount": 100,
    "rowCount": 100,
    "groupCount": 33,
    "groups": [
      {
        "groupKey": "2026-04-01",
        "rowCount": 1,
        "billedCost": -152.46,
        "contractedCost": -152.46,
        "effectiveCost": -152.46,
        "listCost": -152.46
      },
      {
        "groupKey": "2026-04-16",
        "rowCount": 1,
        "billedCost": -15.21,
        "contractedCost": -15.21,
        "effectiveCost": -15.21,
        "listCost": -15.21
      },
      {
        "groupKey": "2026-05-01",
        "rowCount": 8,
        "billedCost": 1436.318539,
        "contractedCost": 1467.206859,
        "effectiveCost": 1308.109872,
        "listCost": 1547.804994
      },
      {
        "groupKey": "2026-05-02",
        "rowCount": 3,
        "billedCost": 84.796384,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Spend by sub account
GET /api/cloud-costs/summary?seed=42&groupBy=SubAccountId&subAccounts=5
{
  "data": {
    "billingPeriod": "2026-06",
    "billingPeriodStart": "2026-06-01T00:00:00Z",
    "billingPeriodEnd": "2026-07-01T00:00:00Z",
    "billingCurrency": "USD",
    "decimalPlaces": 6,
    "groupBy": "SubAccountId",
    "periodRowCount": 100,
    "rowCount": 100,
    "groupCount": 6,
    "groups": [
      {
        "groupKey": "EX-SA-0001",
        "rowCount": 19,
        "billedCost": 3739.495102,
        "contractedCost": 3769.27917,
        "effectiveCost": 3763.665151,
        "listCost": 4253.059568
      },
      {
        "groupKey": "EX-SA-0002",
        "rowCount": 18,
        "billedCost": 706.523627,
        "contractedCost": 727.093721,
        "effectiveCost": 724.169608,
        "listCost": 848.69809
      },
      {
        "groupKey": "EX-SA-0003",
        "rowCount": 20,
        "billedCost": 151.811422,
        "contractedCost": 194.452608,
        "effectiveCost": 187.314168,
        "listCost": 235.275591
      },
      {
        "groupKey": "EX-SA-0004",
        "rowCount": 20,
        "billedCost": 717.524762,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Committed versus on-demand pricing split
GET /api/cloud-costs/summary?seed=42&groupBy=PricingCategory&commitments=3
{
  "data": {
    "billingPeriod": "2026-06",
    "billingPeriodStart": "2026-06-01T00:00:00Z",
    "billingPeriodEnd": "2026-07-01T00:00:00Z",
    "billingCurrency": "USD",
    "decimalPlaces": 6,
    "groupBy": "PricingCategory",
    "periodRowCount": 100,
    "rowCount": 100,
    "groupCount": 3,
    "groups": [
      {
        "groupKey": "Committed",
        "rowCount": 44,
        "billedCost": 0,
        "contractedCost": 107.114768,
        "effectiveCost": 88.939821,
        "listCost": 129.528676
      },
      {
        "groupKey": "Standard",
        "rowCount": 53,
        "billedCost": 12477.777158,
        "contractedCost": 12477.777158,
        "effectiveCost": 12388.837337,
        "listCost": 13968.739911
      },
      {
        "groupKey": null,
        "rowCount": 3,
        "billedCost": 2327.885432,
        "contractedCost": 2327.885432,
        "effectiveCost": 2327.885432,
        "listCost": 2327.885432
      }
    ],
    "totals": {
      "rowCount": 100,
      "billedCost": 14805.66259,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Compute totals by service name
GET /api/cloud-costs/summary?seed=42&groupBy=ServiceName&serviceCategory=Compute
{
  "data": {
    "billingPeriod": "2026-06",
    "billingPeriodStart": "2026-06-01T00:00:00Z",
    "billingPeriodEnd": "2026-07-01T00:00:00Z",
    "billingCurrency": "USD",
    "decimalPlaces": 6,
    "groupBy": "ServiceName",
    "periodRowCount": 100,
    "rowCount": 20,
    "groupCount": 3,
    "groups": [
      {
        "groupKey": "Container Service",
        "rowCount": 3,
        "billedCost": 1.116489,
        "contractedCost": 1.116489,
        "effectiveCost": 1.116489,
        "listCost": 1.213575
      },
      {
        "groupKey": "Serverless Functions",
        "rowCount": 9,
        "billedCost": -13.522093,
        "contractedCost": -13.522093,
        "effectiveCost": -13.522093,
        "listCost": -13.433256
      },
      {
        "groupKey": "Virtual Machines",
        "rowCount": 8,
        "billedCost": -148.612141,
        "contractedCost": -148.612141,
        "effectiveCost": -148.612141,
        "listCost": -148.184601
      }
    ],
    "totals": {
      "rowCount": 20,
      "billedCost": -161.017745,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

GET /api/cloud-costs/commitments

One row per commitment discount in the seeded period. A commitment aggregates every usage row that draws on it, across sub accounts and availability zones, so this route takes no selection filters — only the generation params, which must match the ones you passed to the root route.

Live requestRuns against the public API
No key required
GET/api/cloud-costs/commitments?seed=42

Request parameters

The calendar month this fixture invoices, as YYYY-MM (2000-01 … 2099-12). It sets BillingPeriodStart and BillingPeriodEnd on every row. Defaults to the previous complete UTC month and the resolved value is echoed in meta.params, so any response can be replayed exactly.

Active ISO 4217 code (case-insensitive) used as BillingCurrency and as the denomination of every price and cost. Prices are NOT converted — changing this relabels the fixture, it does not apply an exchange rate.

Charge-period length for metered usage rows: one clean UTC hour or one clean UTC day. Period-level rows (commitment purchase, unused commitment, tax, credit) always span the whole billing period.

How many distinct sub accounts the period's metered usage is spread across (EX-SA-0001 upward). Tax, credit, purchase and unused rows stay at billing-account level with a null SubAccountId.

How many commitment discounts exist in the period. Each one adds a Purchase row, an Unused row and a block of commitment-covered Used usage rows. 0 means no committed pricing anywhere and /commitments returns an empty list.

Whole-percentage tax applied once per period to the summed BilledCost of every non-correction Usage and Purchase row, producing the single Tax row. 0 emits no Tax row at all.

Advanced response options7 options

Limit the number of returned records (1–100). Defaults to all matches.

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/cloud-costs/commitments?seed=42"
const res = await fetch("https://randomapi.dev/api/cloud-costs/commitments?seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/cloud-costs/commitments?seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/cloud-costs/commitments?seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 6
billingPeriod string

The calendar month this fixture invoices, as YYYY-MM (2000-01 … 2099-12). It sets BillingPeriodStart and BillingPeriodEnd on every row. Defaults to the previous complete UTC month and the resolved value is echoed in meta.params, so any response can be replayed exactly.

example: billingPeriod=2026-05
currency string

Active ISO 4217 code (case-insensitive) used as BillingCurrency and as the denomination of every price and cost. Prices are NOT converted — changing this relabels the fixture, it does not apply an exchange rate.

default: USD
example: currency=EUR
granularity enum

Charge-period length for metered usage rows: one clean UTC hour or one clean UTC day. Period-level rows (commitment purchase, unused commitment, tax, credit) always span the whole billing period.

default: daily
allowed: hourly | daily
example: granularity=hourly
subAccounts int

How many distinct sub accounts the period's metered usage is spread across (EX-SA-0001 upward). Tax, credit, purchase and unused rows stay at billing-account level with a null SubAccountId.

default: 3
allowed: 1 – 8
example: subAccounts=5
commitments int

How many commitment discounts exist in the period. Each one adds a Purchase row, an Unused row and a block of commitment-covered Used usage rows. 0 means no committed pricing anywhere and /commitments returns an empty list.

default: 2
allowed: 0 – 4
example: commitments=4
taxRatePercent int

Whole-percentage tax applied once per period to the summed BilledCost of every non-correction Usage and Purchase row, producing the single Tax row. 0 emits no Tax row at all.

default: 20
allowed: 0 – 30
example: taxRatePercent=25
Universal parameters Shared response and formatting options 7
count int

Limit the number of returned records (1–100). Defaults to all matches.

default: all matches
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=commitmentDiscountId,commitmentDiscountName
exclude list

Return all fields except these (comma-separated).

example: exclude=netSavings
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 20
commitmentDiscountId string

Fictional commitment id, identical to the CommitmentDiscountId on the period's rows.

example: EX-CMT-0001

commitmentDiscountName string

Display name, identical to CommitmentDiscountName on those rows.

example: Capacity commitment — Virtual Machines (1 year)

commitmentDiscountCategory string

Always Usage; spend-based commitments are out of scope.

example: Usage

commitmentDiscountType string

Provider-defined type from this fictional provider's own vocabulary (FOCUS fixes no enum).

example: Capacity Commitment

commitmentDiscountUnit string

Unit the committed quantity is measured in. Always Hours.

example: Hours

skuId string

The single fictional SKU this commitment covers.

example: EX-CMP-VM-A2

regionId string

The single fictional region this commitment covers.

example: ex-eu-1

chargePeriodStart string (ISO 8601, seconds precision, UTC)

Purchase row's inclusive charge-period start — the billing-period start.

example: 2026-06-01T00:00:00Z

chargePeriodEnd string (ISO 8601, seconds precision, UTC)

Purchase row's exclusive charge-period end — the billing-period end.

example: 2026-07-01T00:00:00Z

billingCurrency string

ISO 4217 code for every amount below.

example: USD

committedQuantity number

Purchase row's CommitmentDiscountQuantity for the period, in Hours.

example: 412.5

usedQuantity number

Exact sum of CommitmentDiscountQuantity over this commitment's Used rows.

example: 350.625

unusedQuantity number

Unused row's CommitmentDiscountQuantity. usedQuantity + unusedQuantity equals committedQuantity exactly.

example: 61.875

utilizationPercent number

usedQuantity / committedQuantity × 100, rounded to 2 decimals — the only rounded-for-display value in this response. 0 when committedQuantity is 0.

example: 85

coveredRowCount integer

Number of Used usage rows drawing on this commitment.

example: 9

purchaseBilledCost number

Purchase row's BilledCost — the money actually invoiced for the commitment this period.

example: 12.7361

usedEffectiveCost number

Exact sum of EffectiveCost over the Used rows.

example: 10.8257

unusedEffectiveCost number

Unused row's EffectiveCost. usedEffectiveCost + unusedEffectiveCost equals purchaseBilledCost exactly.

example: 1.9104

onDemandEquivalentCost number

Exact sum of ContractedCost over the Used rows: what that usage would have cost at the negotiated on-demand rate.

example: 13.122

netSavings number

onDemandEquivalentCost − purchaseBilledCost. Negative when poor utilization makes the commitment a loss; the fixture deliberately produces both signs.

example: 0.3859

Documented examples

Build-generated requests and complete responses
4
Commitment utilization for the default period
GET /api/cloud-costs/commitments?seed=42
{
  "data": [
    {
      "commitmentDiscountId": "EX-CMT-0001",
      "commitmentDiscountName": "Usage commitment — Managed Relational Database (3 year)",
      "commitmentDiscountCategory": "Usage",
      "commitmentDiscountType": "Usage Commitment",
      "commitmentDiscountUnit": "Hours",
      "skuId": "EX-DB-SQL-M4",
      "regionId": "ex-eu-1",
      "chargePeriodStart": "2026-06-01T00:00:00Z",
      "chargePeriodEnd": "2026-07-01T00:00:00Z",
      "billingCurrency": "USD",
      "committedQuantity": 302.786,
      "usedQuantity": 257.368,
      "unusedQuantity": 45.418,
      "utilizationPercent": 85,
      "coveredRowCount": 21,
      "purchaseBilledCost": 56.168014,
      "usedEffectiveCost": 47.742793,
      "unusedEffectiveCost": 8.425221,
      "onDemandEquivalentCost": 54.253176,
      "netSavings": -1.914838
    },
    {
      "commitmentDiscountId": "EX-CMT-0002",
      "commitmentDiscountName": "Capacity commitment — Data Warehouse (1 year)",
      "commitmentDiscountCategory": "Usage",
      "commitmentDiscountType": "Capacity Commitment",
      "commitmentDiscountUnit": "Hours",
      "skuId": "EX-DB-WH-SLOT",
      "regionId": "ex-us-2",
      "chargePeriodStart": "2026-06-01T00:00:00Z",
      "chargePeriodEnd": "2026-07-01T00:00:00Z",
      "billingCurrency": "USD",
      "committedQuantity": 319.231,
      "usedQuantity": 296.884,
      "unusedQuantity": 22.347,
      "utilizationPercent": 93,
      "coveredRowCount": 21,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
Four commitments over hourly usage
GET /api/cloud-costs/commitments?seed=42&commitments=4&granularity=hourly
{
  "data": [
    {
      "commitmentDiscountId": "EX-CMT-0001",
      "commitmentDiscountName": "Usage commitment — Managed Relational Database (3 year)",
      "commitmentDiscountCategory": "Usage",
      "commitmentDiscountType": "Usage Commitment",
      "commitmentDiscountUnit": "Hours",
      "skuId": "EX-DB-SQL-M4",
      "regionId": "ex-eu-1",
      "chargePeriodStart": "2026-06-01T00:00:00Z",
      "chargePeriodEnd": "2026-07-01T00:00:00Z",
      "billingCurrency": "USD",
      "committedQuantity": 7.032,
      "usedQuantity": 5.977,
      "unusedQuantity": 1.055,
      "utilizationPercent": 85,
      "coveredRowCount": 10,
      "purchaseBilledCost": 1.304464,
      "usedEffectiveCost": 1.108757,
      "unusedEffectiveCost": 0.195707,
      "onDemandEquivalentCost": 1.25995,
      "netSavings": -0.044514
    },
    {
      "commitmentDiscountId": "EX-CMT-0002",
      "commitmentDiscountName": "Capacity commitment — Data Warehouse (1 year)",
      "commitmentDiscountCategory": "Usage",
      "commitmentDiscountType": "Capacity Commitment",
      "commitmentDiscountUnit": "Hours",
      "skuId": "EX-DB-WH-SLOT",
      "regionId": "ex-us-2",
      "chargePeriodStart": "2026-06-01T00:00:00Z",
      "chargePeriodEnd": "2026-07-01T00:00:00Z",
      "billingCurrency": "USD",
      "committedQuantity": 6.945,
      "usedQuantity": 6.458,
      "unusedQuantity": 0.487,
      "utilizationPercent": 92.99,
      "coveredRowCount": 10,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}
A period with no commitment discounts
GET /api/cloud-costs/commitments?seed=42&commitments=0
{
  "data": [],
  "meta": {
    "endpoint": "cloud-costs",
    "route": "/commitments",
    "count": 0,
    "seed": 42,
    "params": {
      "currency": "USD",
      "granularity": "daily",
      "subAccounts": 3,
      "commitments": 0,
      "taxRatePercent": 20,
      "billingPeriod": "2026-06"
    },
    "generatedAt": "2026-07-30T15:14:08.000Z",
    "warnings": [
      "'commitments' is 0, so this billing period has no commitment discounts."
    ]
  }
}
May 2026 in euros
GET /api/cloud-costs/commitments?seed=9&billingPeriod=2026-05&currency=EUR
{
  "data": [
    {
      "commitmentDiscountId": "EX-CMT-0001",
      "commitmentDiscountName": "Capacity commitment — Virtual Machines (1 year)",
      "commitmentDiscountCategory": "Usage",
      "commitmentDiscountType": "Capacity Commitment",
      "commitmentDiscountUnit": "Hours",
      "skuId": "EX-CMP-VM-A2",
      "regionId": "ex-us-1",
      "chargePeriodStart": "2026-05-01T00:00:00Z",
      "chargePeriodEnd": "2026-06-01T00:00:00Z",
      "billingCurrency": "EUR",
      "committedQuantity": 338.766,
      "usedQuantity": 243.911,
      "unusedQuantity": 94.855,
      "utilizationPercent": 72,
      "coveredRowCount": 20,
      "purchaseBilledCost": 9.132115,
      "usedEffectiveCost": 6.575109,
      "unusedEffectiveCost": 2.557006,
      "onDemandEquivalentCost": 9.13203,
      "netSavings": -0.000085
    },
    {
      "commitmentDiscountId": "EX-CMT-0002",
      "commitmentDiscountName": "Capacity commitment — Virtual Machines (1 year)",
      "commitmentDiscountCategory": "Usage",
      "commitmentDiscountType": "Capacity Commitment",
      "commitmentDiscountUnit": "Hours",
      "skuId": "EX-CMP-VM-A8",
      "regionId": "ex-us-1",
      "chargePeriodStart": "2026-05-01T00:00:00Z",
      "chargePeriodEnd": "2026-06-01T00:00:00Z",
      "billingCurrency": "EUR",
      "committedQuantity": 279.876,
      "usedQuantity": 279.876,
      "unusedQuantity": 0,
      "utilizationPercent": 100,
      "coveredRowCount": 21,
    …
    "generatedAt": "2026-07-30T15:14:08.000Z"
  }
}

About this API

Coverage & behavior

One fictional cloud provider's billing period for one billing account, shaped with FOCUS column names — the vocabulary a FinOps cost pipeline actually reads.

Nothing here is real pricing

The provider (Example Cloud), the services, the SKU ids, the SkuPriceIds, the region ids, the account ids, the resource ids, the unit prices and the discounts are all invented. No value corresponds to an AWS, Azure, Google Cloud or any other real rate, and no real vendor string appears anywhere. What comes from a published standard is only the column vocabulary: the column identifiers and their allowed values implement the FOCUS 1.4 cost_and_usage dataset, ratified 2026-06-04, as a documented 49-column subset. The specification is published under CC BY 4.0 by the FOCUS Series of the Joint Development Foundation Projects, LLC, with the FinOps Foundation as the supporting community; this endpoint is not certified, not validated and not endorsed by either, and it makes no conformance claim of any kind. FOCUS moves quickly — 1.4 alone added 47 columns and two datasets — so the implemented version is pinned on this page and this page is what to trust.

A seeded period is exactly 100 rows

A seed plus the six generation parameters defines exactly 100 rows. Filters select from those 100 rows; they never regenerate them, and count is only a limit. That is why the first three rows of ?seed=42&count=3 are byte-identical to the first three of ?seed=42&count=100.

The parameters come in two classes:

  • GenerationbillingPeriod, currency, granularity, subAccounts, commitments, taxRatePercent. These decide which rows exist. Pass the same generation params on all three routes to reconcile.
  • SelectionchargeCategory, serviceCategory, chargeClass, subAccountId (root route and /summary). These only choose which of the existing rows come back, in their original order.

Reconciliation guarantees

These are this fixture's guarantees, not the specification's, except where noted:

  1. ListCost is exactly ListUnitPrice × PricingQuantity and ContractedCost exactly ContractedUnitPrice × PricingQuantity whenever both operands are non-null — the two product rules FOCUS does state.
  2. Across the whole period, the sum of EffectiveCost equals the sum of BilledCost. This is the one spec-derived identity here: FOCUS requires the sums to match across related covering and covered charges, and in this fixture every covering charge and every charge it covers sit in the same period.
  3. Each commitment's Used rows plus its Unused row have EffectiveCost summing exactly to its Purchase row's BilledCost.
  4. Each commitment's Used plus Unused CommitmentDiscountQuantity equals its Purchase row's, exactly.
  5. On every row ListCost ≥ ContractedCost ≥ EffectiveCost and BilledCost ≤ ContractedCost. FOCUS does not require this — it is a property this fixture chooses to guarantee so that "am I reading the columns in the right order?" is testable.
  6. On /summary, every group's four cost measures sum exactly to totals, and totals matches what you get by summing the root route's rows yourself.

All of that is exact because nothing is computed in floating point. Prices are integers in micro-units (1e-6 of a currency unit), quantities integers in milli-units (1e-3), and every cost is one half-up rounding of price × quantity. Monetary values stay far below 1e6 currency units and quantities below 1e6 units, so Math.round(value * 1e6) and Math.round(quantity * 1e3) recover the exact scaled integers from the parsed JSON — that is the documented recovery contract the reconciliation assertions rely on.

The row taxonomy

Row kind ChargeCategory ChargeClass Charge period Cost shape
On-demand usage Usage null one granularity slot EffectiveCost = BilledCost = ContractedCost
Commitment-covered usage Usage null one granularity slot BilledCost = 0, EffectiveCost = amortized share
Unused commitment Usage null whole period BilledCost = 0, EffectiveCost = residual
Commitment purchase Purchase null whole period EffectiveCost = 0, BilledCost = ContractedCost
Tax Tax null whole period all four costs equal
Credit Credit null whole period all four costs equal and negative
Prior-period correction Usage Correction one day in the previous month all four costs equal and negative

Correction rows keep the invoiced month in BillingPeriodStart/BillingPeriodEnd while their ChargePeriodStart sits in the month before it — which is exactly how a closed period gets corrected, and exactly what breaks ingesters that assume the two agree. The tax base is the summed BilledCost of non-correction Usage and Purchase rows only, so the tax row never taxes itself, a credit or a correction.

The Unused row is always emitted, even at 100 % utilization, where it carries a zero quantity and a zero EffectiveCost — a deliberate parser test case. Its ListUnitPrice and ContractedUnitPrice are the SKU's list and negotiated on-demand rates, which is how FinOps tools present waste: list and contracted value the wasted capacity at on-demand rates while EffectiveCost is the amortized money actually spent. The amortized share on Used rows is allocated by largest remainder so the shares sum exactly; that is legal precisely because FOCUS imposes a product rule on ListCost and ContractedCost but none on EffectiveCost.

On both commitment rows — the Purchase and the Unused — the commitment itself is the resource: ResourceId equals CommitmentDiscountId, ResourceName is the commitment's name and ResourceType is Commitment discount. FOCUS requires that equality on exactly those two row kinds, so metered rows are not the only rows carrying a resource and ResourceId is null only on the tax, credit and correction rows.

Emitted order

The response is not globally sorted by ChargePeriodStart. Rows come back as: metered usage ascending by charge period (on-demand and commitment-covered interleaved), then Unused rows, then Purchase rows, then credits, then the tax row, then corrections. A small count therefore gives you ordinary metered rows; count=100 gives the whole period including the rows that break naive ingesters.

Precision, units and currency

Every monetary value carries at most 6 fractional digits and every quantity at most 3. FOCUS explicitly leaves precision to the provider, so this is this fixture's choice — it is not the currency's ISO 4217 minor unit, and a currency with 0 minor digits still gets 6 here. Timestamps follow the FOCUS DateTimeFormat exactly: YYYY-MM-DDTHH:mm:ssZ with no fractional seconds, deliberately unlike the rest of this catalogue. currency relabels the fixture and nothing else — prices are not converted and no exchange rate is invented.

Quantities for time-priced SKUs scale with granularity (at most 1 hour per hourly row, 24 per daily row); quantities for the data-size SKUs are drawn from a fixed GB/TB range and do not. ConsumedQuantity is a separate consumption measure, always PricingQuantity times one documented integer factor per SKU — there is no block or tiered pricing here.

/summary and /commitments are ours, not FOCUS

Both are this endpoint's own reconciliation views and their fields are deliberately camelCase, because FOCUS does not define these shapes. FOCUS 1.3 and 1.4 do define their own Contract Commitment, Invoice Detail and Billing Period datasets, and this endpoint implements none of them; emitting FOCUS-looking PascalCase names on a shape FOCUS never defined would be quiet dishonesty.

What is deliberately left out

  • Columns. Sixteen cost_and_usage columns are not emitted: PricingCurrency, PricingCurrencyContractedUnitPrice, PricingCurrencyEffectiveCost and PricingCurrencyListUnitPrice exist for a pricing currency that differs from the billing currency, which this fixture never models, so they would be pure duplication; AllocatedMethodDetails, AllocatedMethodId, AllocatedResourceId, AllocatedResourceName and AllocatedTags belong to split-cost allocation; CapacityReservationId and CapacityReservationStatus to capacity reservations; CommitmentProgramEligibilityDetails, ContractApplied and SkuPriceDetails to contract and commitment features; InvoiceDetailId to the Invoice Detail dataset; and HostProviderName to reseller and marketplace billing. None of those features is implemented, so emitting the columns would be decoration.
  • Values. No ChargeCategory Adjustment; no PricingCategory Dynamic or Other; no CommitmentDiscountCategory Spend (its natural unit is a currency amount, which does not fit the FOCUS unit vocabulary, and inventing a unit string would be a fabrication); no cross-SKU flexible commitments — each commitment covers one SKU in one region; no reseller rows, so ServiceProviderName always equals InvoiceIssuerName.
  • Derived tax costs. FOCUS asks a charge that is calculated from other charges — a Tax row is its own example — to derive its ListCost from those charges' ListCost and its ContractedCost from their ContractedCost. This fixture deliberately does not: the tax row's ListCost, ContractedCost and EffectiveCost all equal its BilledCost, which is taxRatePercent applied to the taxed rows' BilledCost. The period therefore carries one tax amount instead of three, and because BilledCost ≤ ContractedCost ≤ ListCost holds on every taxed row, the tax row's ListCost and ContractedCost are at most what a strict FOCUS producer would report and never more. Σ EffectiveCost = Σ BilledCost is unaffected. If you are testing a three-basis tax reconciliation, this row is not the fixture for it.
  • Shape. Charge periods are whole UTC hours or whole UTC days plus the whole-period rows: no sub-hour and no multi-day metered rows. A seeded period is exactly 100 rows for exactly one billing account — this is not a paginated multi-month feed and there is no offset. It is not an invoice document either: no per-service tax lines, no payment terms, no PDF. Use /api/invoices for that.

One rendering note: in format=csv the envelope flattens the Tags object into Tags.env and Tags.costCenter columns, and rows whose Tags is null contribute a separate empty Tags column. JSON and NDJSON carry the nested object unchanged.

Use it for

  • Feed a FinOps cost dashboard or allocation report before any customer's real bill exists
  • Test a FOCUS ingester against rows with commitment coverage, unused waste, tax, credits and prior-period corrections
  • Reconcile a grouped cost summary against the raw rows it was built from, without a warehouse
  • Exercise a cost-anomaly or showback pipeline against negative-cost rows and zero-billed committed usage

Frequently asked questions

Is this real cloud pricing?

No. The provider, service names, SKU ids, region ids, account ids and every unit price are fictional — nothing here is a real AWS, Azure or Google Cloud rate. Only the column vocabulary comes from a published standard.

Which FOCUS version do the column names follow?

The column ids and their allowed values follow FOCUS 1.4, ratified 2026-06-04. The root route emits a documented 49-column subset of the FOCUS cost_and_usage dataset; the endpoint is not certified, validated or endorsed as FOCUS-conformant.

Do the costs actually reconcile?

Yes, exactly. Wherever a unit price is present, ListCost and ContractedCost are its exact product with PricingQuantity at six decimal places; across a billing period the sum of EffectiveCost equals the sum of BilledCost; each commitment's Used plus Unused effective cost equals its purchase row's BilledCost; and /summary group totals sum exactly to the grand total.

Can I match /summary and /commitments to the rows I fetched?

Yes. A seeded billing period is exactly 100 rows. Pass the same seed and the same generation parameters (billingPeriod, currency, granularity, subAccounts, commitments, taxRatePercent) and all three routes describe the same period.

Standards & references