Get pricing - Platform API

GET /pricing returns the plans on sale, cheapest first, each with its price per billing period and its limits.

GET https://public-api.getblock.io/api/v1/pricing

The prices are the ones your account would pay at checkout. Discounts depend on the account, so they can differ from the public pricing page. Prices are whole units of currency (499 is $499) for the whole period, not per month.

Parameters

ParameterTypeRequiredDescription
limitintegerNoQuery parameter. Page size. Default 20, at most 100.
offsetintegerNoQuery parameter. Items to skip. Default 0.
searchstringNoQuery parameter. Case-insensitive substring of the plan id or name.

Request Example

bashcurl 'https://public-api.getblock.io/api/v1/pricing?search=pro' \
  -H "Authorization: Bearer $GETBLOCK_API_KEY"
javascriptconst response = await fetch('https://public-api.getblock.io/api/v1/pricing?search=pro', {
  headers: { Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}` }
});
const body = await response.json();

console.log(body.plans.map((p) => `${p.id}: ${p.periods[0].renewal} ${p.currency}`));
pythonimport os
import requests

body = requests.get(
    "https://public-api.getblock.io/api/v1/pricing",
    headers={"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"},
    params={"search": "pro"},
).json()

print([(p["id"], p["periods"][0]["renewal"], p["currency"]) for p in body["plans"]])

Response Example

json{
  "total": 1,
  "limit": 20,
  "offset": 0,
  "plans": [
    {
      "id": "pro",
      "name": "Pro",
      "currency": "USD",
      "limits": {
        "rps": 800,
        "cu_amount": 1000000000,
        "max_tokens": 150,
        "cu_replenishment": "monthly"
      },
      "periods": [
        {
          "period": "1m",
          "base": 499,
          "first_payment": 499,
          "renewal": 499
        },
        {
          "period": "12m",
          "base": 5988,
          "first_payment": 4790,
          "renewal": 4790
        }
      ]
    }
  ]
}

Response Parameters

FieldTypeDescription
totalintegerPlans matching the filters, before limit and offset.
limitintegerPage size applied.
offsetintegerItems skipped.
plans[].idstringPlan id. The same id GET /subscription reports.
plans[].namestringDisplay name.
plans[].currencystringCurrency of every price in the entry, such as USD.
plans[].limitsobjectrps, cu_amount, max_tokens, and cu_replenishment, as in GET /subscription.
plans[].periods[].periodstringBilling period, such as 1m or 12m. Shortest first.
plans[].periods[].baseintegerThe undiscounted price for the period.
plans[].periods[].first_paymentintegerWhat a new customer pays for the first period.
plans[].periods[].renewalintegerWhat is paid afterwards. Differs from first_payment only when an introductory discount applies.

Plans no longer sold are left out. GET /subscription can still name one, because an account may still be on it.

Use Cases

  • Compare plans by price per CU or per RPS
  • Show the upgrade price in an internal billing tool

Error Handling

HTTPCause
401Missing or invalid API key.
502A GetBlock service behind the API did not answer. Retry later.

Error bodies carry an error message and a request_id. See Errors.