Get current plan - Platform API

GET /subscription returns the plan you are on and its limits. To list add-ons and request packages as well, use GET /subscriptions.

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

Parameters

None.

Request Example

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

console.log(body.plan?.limits);
pythonimport os
import requests

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

print(body["plan"]["limits"] if body["has_plan"] else None)

Response Example

json{
  "has_plan": true,
  "plan": {
    "id": "pro",
    "name": "Pro",
    "status": "active",
    "period": "1m",
    "type": "regular",
    "limits": {
      "rps": 800,
      "cu_amount": 1000000000,
      "max_tokens": 150,
      "cu_replenishment": "monthly"
    },
    "started_at": "2025-09-13T10:20:06Z",
    "paid_until": "2026-11-01T00:00:00Z",
    "current_period_end": "2026-11-01T00:00:00Z"
  }
}

An account without a plan is a normal state, not an error. It answers 200 with {"has_plan": false, "plan": null}.

Response Parameters

FieldTypeDescription
has_planbooleanWhether you are on a plan.
planobject or nullnull when has_plan is false.
plan.idstringPlan id, such as pro. The same id GET /pricing uses.
plan.namestringDisplay name. Empty for plans that are not publicly listed; use id instead.
plan.statusstringactive or grace_period. A plan in grace_period still serves requests: it is a payment state, not a suspension.
plan.periodstringBilling period, such as 1m.
plan.typestringregular or trial.
plan.limits.rpsintegerRequests per second.
plan.limits.cu_amountintegerCompute units granted per replenishment period.
plan.limits.max_tokensintegerMaximum number of access tokens.
plan.limits.cu_replenishmentstringHow often the CU quota resets, such as monthly.
plan.started_at, plan.paid_until, plan.current_period_endstringRFC 3339 UTC times.

A limit of 0 means the value is not reported for the plan, not a zero allowance.

Use Cases

  • Check max_tokens before creating tokens in bulk
  • Warn when paid_until is close
  • Configure client-side rate limiting from rps

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.