Offers
What an Offer posts for an API, how its usage is counted, the caps it declares, and the rules it is checked against.
An Offer posts the rate of every Operation and the free calls a month, and every call of the API is priced from it.
What an Offer posts
| Field | Type | Required | What it is |
|---|---|---|---|
rates | Record<operationId, | required | The posted rate of each operation, per call that returns a result. |
currency | "USD" | required | The currency every rate is posted in. |
free | integer | The calls a month that cost nothing, across every operation, posted on the pricing document. | |
requiresKey | boolean | Every call needs a Key; when it is off, a call with no Key is answered as anonymous. |
Every call states the posted rate: its cost header and its usage Event carry the same number, the one the pricing document prints (the guarantee).
How usage is counted
| Unit | Counts |
|---|---|
per-request | One for each call. |
per-row | One for each row an answer holds. |
per-byte | One for each byte an answer holds. |
The caps an Offer declares
A rate limit and a spend ceiling are two separate members. No field links them, so paying never lifts a rate limit.
| Cap | Member | Declares |
|---|---|---|
| Rate limit | rateLimit | A window and the most calls it allows, such as 10 a second. |
| Spend ceiling | spendCeiling | A ceiling above 0 on what the calls may spend in total. |
Checks
- The Offer posts a rate for every operation; until it does, the API serves no call.
- An Offer declares its model, free or metered; free is never silent.
- A metered Offer declares a hard ceiling above 0.
- A metered Offer names the channel that answers a call over its ceiling.
- A metered Offer names where it is paid for.
- No field links the rate limit to the spend ceiling, so paying never lifts a rate limit.
Example
{
"rates": {
"findPlaces": 0.002,
"getHours": 0.002
},
"currency": "USD",
"free": 1000,
"requiresKey": true
}