Enabled per organizationUsage-based billing must be enabled for your organization before these endpoints accept requests. Contact your Yuno account manager to enable it. Requests from an organization where it is not enabled return
403 PRODUCT_NOT_ENABLED.Attributes
A metered price is the relation between a meter and a plan. It says how many units of the meter are included in the plan each billing cycle (credits) and what every unit beyond that costs (price_per_credit, optionally per country). A plan can carry any number of metered prices alongside its flat price; every subscription on the plan inherits them. Returned by the /subscriptions/plans/{plan_id}/meters endpoints and embedded as meters[] on Create Plan and Retrieve Plan — always present, an empty array for a plan without metered prices.
credits are included units, not prepaid moneycredits is the usage allowance bundled in the plan’s flat price — “the first 10,000 tokens each month are included”. It is measured in the meter’s own unit and resets every billing cycle. It is not a prepaid balance or wallet.string
The unique identifier of the metered price (MAX 64; MIN 36).Example: 77777777-7777-7777-7777-777777777777
string
The unique identifier of the plan the meter is attached to (MAX 64; MIN 36).Example: 00000000-0000-4000-8000-000000000001
string
The unique identifier of the attached meter (MAX 64; MIN 36). Must be
ACTIVE when attaching. A meter can be attached to a given plan only once (409 PLAN_METER_ALREADY_ASSIGNED).Example: 66666666-6666-6666-6666-666666666666number
Units of the meter included in the plan per billing cycle — the allowance a subscriber can consume before any usage is billed. Must be greater than or equal to 0;
0 means every unit is billed. Decimals allowed.Example: 100.5enum
How usage beyond
credits is priced. Only PER_UNIT’s fields (price_per_credit, country_prices) can be changed after attach — PACKAGE and TIERED config is set once, at attach time (see the field notes below and Update Plan Meter).Possible values:PER_UNIT= Billable units ×price_per_credit(or the matchingcountry_pricesentry).PACKAGE= Billable units rounded up to the nearest wholepackage_size, billed atpackage_priceper bundle.TIERED= Graduated: usage is split acrosstiers[], each band billed at its own rate.
object
The price per unit beyond the included credits, in the plan’s base currency. Used for every subscriber whose country has no explicit entry in
country_prices. Only applies to pricing_strategy: PER_UNIT.Rules when attaching or updating:currencymust equal the plan’sbase_amountcurrency, else400 INVALID_PARAMETERS.- Optional only when the plan’s base currency is
USDand the meter has adefault_price— the meter’s default then applies and this field is returned asnull. - Required when the plan’s base currency is not
USD, or when the meter has nodefault_price.
array of objects
Optional explicit per-unit prices by subscriber country, one entry per country (a repeated country is rejected with
400). A country not listed falls back to price_per_credit. Same shape as the plan-level country_prices. Only applies to pricing_strategy: PER_UNIT.number
Only for
pricing_strategy: PACKAGE. The bundle size — billable units are rounded up to the nearest whole multiple of this. Must be greater than 0; decimals and scientific notation (1e3) are accepted and coerced. Stored rounded to 4 decimal places. Set only at attach time — rejected with 400 PLAN_METER_PRICING_CONFIG_UNSUPPORTED on Update Plan Meter.Example: 1000object
Only for
pricing_strategy: PACKAGE. The price per bundle, in the plan’s base currency unless overridden per country in package_country_prices. Required when pricing_strategy is PACKAGE. Same shape as price_per_credit. Set only at attach time.array of objects
Only for
pricing_strategy: PACKAGE. Optional explicit per-bundle prices by subscriber country. Same shape as country_prices. Set only at attach time.array of objects
Only for
pricing_strategy: TIERED. Ordered, graduated pricing bands — at least one entry, required when pricing_strategy is TIERED. Set only at attach time; rejected with 400 PLAN_METER_PRICING_CONFIG_UNSUPPORTED on Update Plan Meter.For
PACKAGE and TIERED, the metered price must be priced in every currency the plan supports: a currency the plan uses with no matching package_country_prices/country_rates entry (and no applicable base price) is rejected with 400 PLAN_METER_MISSING_CURRENCY; a package_price/tier rate in a currency the plan doesn’t use at all is rejected with 400 PLAN_METER_BASE_CURRENCY_MISMATCH. All three pricing strategies round the computed usage charge half-up to 4 decimal places.Timestamp
Set by Yuno when the metered price is attached.
Timestamp
Set by Yuno on every update of the metered price.
Related
- Attach Meter to Plan
- List Plan Meters
- Update Plan Meter
- Create Plan — attach meters inline with
meters[] - The Meter Object
- Usage-Based Billing guide