Rate cards
A rate card is a product’s usage price list. Each of its rates prices one slice of what a meter measures, such as requests to one endpoint. The prices live in numbered versions: you prepare a version as a draft, commit it with the date it takes effect, and existing orders stay on the version they have until you move them. Introduction to pricing shows how rate cards, orders, negotiated pricing and migrations fit together.
Rate cards are in the rate_cards=v1 internal beta. Send Paid-Beta: rate_cards=v1 with each request. The beta includes four read operations: list and retrieve rate cards, and list and retrieve a card’s versions. Write and lifecycle requests return 404 until those routes are available.
How a rate card works
- It belongs to a product and prices in one thing. Its
pricedInis money, in each currency a version lists, or one credit currency. The product andpricedInnever change. - A version holds the prices. It names the meter versions it prices, its rates and its modifiers. Once committed, a version never changes.
- A rate prices one measure. Its
targetnames a meter, one of its measures and, withmatch, a slice of the meter’s dimensions. - An order pins a version. An order line keeps its version until a migration moves it to a later one.
Planned rate card creation
A search API charges per request by endpoint: Search at $0.005, Answer at $0.01 and Deep at $0.025. Its requests meter has a requests measure and an endpoint dimension.
The planned API creates the card first and then its first version. A rate is a decimal string in minor units, so $0.005 is "0.5".
The version is a draft at revision 1. Review it, then commit the revision you reviewed:
If the draft changed after you reviewed it, the commit fails with 409, so what becomes binding is what you saw.
Versions
Every version moves through the same lifecycle as other changes to what orders bill:
To change prices, create a draft copiedFrom the current version, edit it and commit it. To go back to earlier prices, commit a later version with those prices. To find the version in effect at a time, list versions with status=inEffect and startsAt[lte] set to that time.
Before you commit, preview lists each rate of the draft with how it differs from the version it follows (added, changed, unchanged or removed), and warns about anything commit would allow but may be a mistake. A backtest shows what the draft would have charged each customer in each billing period since its startsAt, next to what was billed. It runs once on the draft’s latest revision and is stale once the draft changes, so create a new one instead of rerunning it.
Rates and matching
A rate’s key is unique within the card and stays the same across versions, so orders, negotiated pricing and migrations can name it. match conditions use eq, in (with a list) or prefix. A dimension that match leaves out matches every value, and a rate with no match is a fallback.
When several rates match one reading, the most specific wins: eq beats in, in beats prefix, a longer prefix beats a shorter one, and any condition beats none; across dimensions, the rate that constrains more dimensions wins. Two rates that match the same values equally are rejected when you commit (ambiguous_match). A reading that no rate matches is charged nothing and flagged, and the preview warns when a priced measure has no fallback rate.
A rate’s pricing is perUnit, graduated or volume, as on a price, and its tiers can count over the billing period, each event or each workflow instance (tierScope). On a card priced in money, pricing is in the version’s first currency and currencyOptions prices each of its other currencies; a committed version keeps every currency earlier versions of the card offered. A rate priced in credits can’t use pricing whose charge for one reading could go negative or depends on the end of the period, such as volume tiers over the billing period.
When a later version replaces a rate, for example by splitting Search into slow, medium and fast, each new rate lists the old one in replaces. A migration then keeps a customer’s percentage discount on every rate that replaces the old one.
Modifiers
A modifier multiplies the charges of the targets it lists, for every customer, such as half price for batch requests. It can apply only when another measure passes a threshold, with when. Every modifier that matches a reading applies, and their multipliers multiply. Prices for one customer don’t go on the rate card: they’re negotiated pricing on that customer’s order.
Change or archive a rate card
A rate card’s key, product and pricedIn never change, and update changes only its name. Prices change only through a new version. Archive a rate card to stop it going on new orders or gaining versions. Orders already on it keep billing through every version, including scheduled ones. A rate card is never deleted.