Create a rate plan version
Prices a metric. A saved version never changes: to change a price, save a new version with the same rate_plan_id. Tiers and package sizes price only the units above the included allowance. Secret and trusted tokens may call it; a limited token may not (403). The plan is not checked against an agreement's currency here: use a plan in the agreement's currency, or its billing run fails with currency_mismatch.
AuthorizationBearer <token>A secret, trusted or limited token. See Authentication.
A rate plan version.
application/json- body
rate_plan_id?stringDefaults to a new id. Send an existing id with a new version to change a price.
version?integerDefaults to 1.
metric_id*stringRequired.
currency*stringRequired. Three ASCII letters, trimmed and saved in upper case. Digits, punctuation or another length answer 400 (reference UbV13). Must be a currency Comecero supports and match the agreement currency.
^\s*[A-Za-z]{3}\s*$pricing_model*stringRequired.
"flat_per_unit""package""tiered_volume""tiered_graduated""stair_step"included_allowance?numberUnits included each period before anything is charged. When left out, the entitlement's capacity is used. At most 1,000,000,000,000.
overage_price?numberFor flat_per_unit: the price per billable unit. For package: the price per package. At most 1,000,000.
tiers?array<>Required for tiered_volume, tiered_graduated and stair_step. Tiers count billable units, the units above included_allowance. At most 100 tiers; each up_to above 0 and unique; only one tier (the last) open-ended. For stair_step: every tier has a flat_fee and no unit_price, the last tier is open-ended, and fees never go down as up_to goes up.
billing_region?stringBilling region. Defaults to us.
"us""uk""eu"package_size?numberOnly for package: units in one package. Billable units are rounded up to whole packages. Defaults to 1.
effective_from?stringWhen the version was published. Defaults to now. Billing does not use it: an entitlement pins the exact version it is billed with.
date-timecredit_pricing?Success.
application/json- response
The price of one metric in one currency. Each version is fixed once saved. There is no archive field or archive endpoint.
object?stringAlways rate_plan.
rate_plan_id?stringYour id, or rate_ plus 32 characters.
version?integer1 or more. Never changes once saved.
metric_id?stringThe metric it prices.
currency?stringThree ASCII letters, saved in upper case. Must be the currency of the agreements that use it.
^[A-Z]{3}$pricing_model?stringHow billable units are priced.
"flat_per_unit""package""tiered_volume""tiered_graduated""stair_step"included_allowance?numberUnits included in each period before any charge.
overage_price?numberPrice per billable unit for flat_per_unit and package.
tiers?array<>Set for tiered_volume, tiered_graduated and stair_step.
effective_from?stringKept with the plan.
date-timeeffective_to?stringKept with the plan.
date-timebilling_region?stringBilling region. Defaults to us.
"us""uk""eu"test?booleanTest or live.
credit_pricing?unit_snapshot?curl -X POST 'https://api.comecero.com/api/v1/usage/rate_plans' \ -H 'Content-Type: application/json' \ -d '{ "rate_plan_id": "ai_tokens_standard", "version": 1, "metric_id": "met_ai_tokens", "currency": "USD", "pricing_model": "flat_per_unit", "included_allowance": 100000, "overage_price": 0.00002}'{ "object": "rate_plan", "rate_plan_id": "ai_tokens_standard", "version": 1, "metric_id": "met_ai_tokens", "currency": "USD", "pricing_model": "flat_per_unit", "included_allowance": 100000, "overage_price": 0.00002, "tiers": [], "billing_region": "us", "test": false}List rate plans GET
Every saved version of every rate plan, newest `effective_from` first, up to 500. There is no paging. Secret and trusted tokens may call it; a limited token may not (`403`).
Get a rate plan version GET
One version of a rate plan. Secret and trusted tokens may call it; a limited token may not (`403`).