API

Billing

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
GET /api/v1/organizations/{organization_id}/billing load Billing page
GET /api/v1/organizations/{organization_id}/billing/usage load Meters

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

billing, err := client.Billing(nil).Load(map[string]any{"organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(billing)

Lua

Construct client as shown in the Lua setup, then call the operations:

local billing, err = client:Billing():load({ organization_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$billing = $client->Billing()->load(["organization_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

billing = client.Billing().load({"organization_id": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

billing = client.Billing.load({ "organization_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const billing = await client.Billing().load({ organization_id: "example" })

Fields

Field Type Required Description
addons array Yes Addons
breakdown any Yes The 24-hour live series with its provenance; null only when the rollup fallback itself failed.
budget any Yes Budget
can_manage_contact boolean Yes Can Manage Contact
can_manage_extra_spend boolean Yes Can Manage Extra Spend
can_manage_local_subscription boolean Yes Can Manage Local Subscription
can_manage_payment_method boolean Yes Can Manage Payment Method
can_set_up_billing boolean Yes Can Set Up Billing
customer any Yes Customer
deployment_usage_visible boolean Yes Deployment Usage Visible
entitlements object Yes Entitlements
extra_spend_enabled boolean Yes Organization consent to paid overages across all metered usage.
feature_enabled boolean Yes Whether the billing feature is on for this organization.
organization_id string Yes Organization Id
package any Yes Package
prepaid any Yes Prepaid
preview any Yes Metronome draft invoice and credits, or null.
storage_usage object Yes Storage Usage
stripe object Yes Stripe
subscription any Yes Subscription
token_account object Yes Token Account

load

GET /api/v1/organizations/{organization_id}/billing

Operation ID: api_v1_organization_billing.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes

Responses

200: Billing page

application/json

Property Type Required Description
addons array of object Yes
addons[].addon_key string Yes
addons[].monthly_price_cents integer,null No
addons[].name string,null No
addons[].quantity integer Yes
breakdown object or null Yes The 24-hour live series with its provenance; null only when the rollup fallback itself failed.
budget object or null Yes
can_manage_contact boolean Yes
can_manage_extra_spend boolean Yes
can_manage_local_subscription boolean Yes
can_manage_payment_method boolean Yes
can_set_up_billing boolean Yes
customer object or null Yes
deployment_usage_visible boolean Yes
entitlements object Yes
entitlements.ci_overage_cents integer No Net overage from the shared CI dollar pool; zero without a CI dollar allowance. Omitted by older API releases.
entitlements.ci_projected_overage_cents integer No Forecast net overage from the shared CI dollar pool. Omitted by older API releases.
entitlements.ci_raw_used number Yes Full-period CI usage with the shared standard pool counted once.
entitlements.ci_spend_cents integer No Total CI spend before the monthly USD credit in cents, including runner, cache, storage and add-on charges. Omitted by older API releases.
entitlements.ci_uncapped boolean No CI runner usage has no minute cap under the current package and extra-spend setting. Omitted by older API releases.
entitlements.enforcing boolean Yes
entitlements.meters array of object Yes
entitlements.meters[].allowance_pool enum: ci_spend, null No Shared dollar allowance covering this meter. Omitted by older API releases.
entitlements.meters[].cap number,null No The quantity past which new usage is refused; null means unlimited.
entitlements.meters[].dimension_value string,null No
entitlements.meters[].hard_cap number,null No
entitlements.meters[].included number Yes
entitlements.meters[].meter_key string Yes
entitlements.meters[].pay_as_you_go boolean Yes
entitlements.meters[].projected_overage_cents integer Yes Forecast overage for the current allowance window.
entitlements.meters[].raw_used number Yes Full billing-period usage before allowance resets.
entitlements.meters[].remaining number Yes
entitlements.meters[].spend_cents integer Yes What this period's overage costs so far at the unit price. The standard CI runner classes split their shared pool's overage by each class's own minutes.
entitlements.meters[].unit string Yes
entitlements.meters[].unit_price_nanodollars integer Yes
entitlements.meters[].used number Yes
entitlements.period_spend_cents integer Yes Overage spend so far this period across every meter
entitlements.period_started_at string Yes
entitlements.recurring_price_cents integer Yes
entitlements.roder_daily_run_limit integer Yes
entitlements.roder_run_concurrency_limit integer Yes
entitlements.seat_limit integer,null No
entitlements.seats integer Yes
entitlements.seats_remaining integer,null No
entitlements.state enum: none, trialing, active, past_due, suspended, exempt Yes
entitlements.usage_reset_at string,null (date-time) Yes
extra_spend_enabled boolean Yes Organization consent to paid overages across all metered usage.
feature_enabled boolean Yes Whether the billing feature is on for this organization. False renders the page as not enabled, with no Subscribe action.
organization_id string Yes
package object or null Yes
prepaid object or null Yes
preview object or null Yes Metronome draft invoice and credits, or null.
storage_usage object Yes
storage_usage.as_of string (date-time) Yes
storage_usage.categories array of object Yes
storage_usage.categories[].allowance object or null Yes
storage_usage.categories[].current_bytes integer Yes
storage_usage.categories[].measurement enum: stored, sampled, provisioned Yes
storage_usage.categories[].meter_key string Yes
storage_usage.categories[].sampled_at string (date-time) Yes
storage_usage.categories[].unmeasured_count integer Yes
storage_usage.incomplete boolean Yes
storage_usage.provisioned_bytes integer Yes
storage_usage.stored_bytes integer Yes
stripe object Yes
stripe.configured boolean Yes
subscription object or null Yes
token_account object Yes
token_account.available_usd string Yes
token_account.balance_usd string Yes
token_account.reserved_usd string Yes
token_account.top_up_cents array of enum: 1000, 2500, 5000, 10000 Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway

GET /api/v1/organizations/{organization_id}/billing/usage

Operation ID: api_v1_organization_billing_usage.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes

Responses

200: Meters

application/json

Property Type Required Description
meters array of object Yes
meters[].allowance_pool enum: ci_spend, null No Shared dollar allowance covering this meter. Omitted by older API releases.
meters[].cap number,null No The quantity past which new usage is refused; null means unlimited.
meters[].dimension_value string,null No
meters[].hard_cap number,null No
meters[].included number Yes
meters[].meter_key string Yes
meters[].pay_as_you_go boolean Yes
meters[].projected_overage_cents integer Yes Forecast overage for the current allowance window.
meters[].raw_used number Yes Full billing-period usage before allowance resets.
meters[].remaining number Yes
meters[].spend_cents integer Yes What this period's overage costs so far at the unit price. The standard CI runner classes split their shared pool's overage by each class's own minutes.
meters[].unit string Yes
meters[].unit_price_nanodollars integer Yes
meters[].used number Yes
period_started_at string Yes
seats integer Yes
state string Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway