Read the plan and credits
Owners and admins only. The plan, credits left, add-ons, the monthly total, and this period’s usage, from the cached billing customer. Money is in microcredits: 1,000,000 is one credit, which is one USD. The card and billing address are never returned.
GET
/billing/overviewAuthorization
AuthorizationBearer token · headerrequired`MEDIAN_KEY` from Settings under API, or an MCP OAuth access token. A key acts as the organization; a token acts as the person who approved it.
Responses
200The billing page's numbers.
planstringAllowed:
explorestandardproplanGrantedbooleanstatusstringAllowed:
activepast_duecancelednoneperiodStartnumber | nullperiodEndnumber | nullincludedMicrocreditsintegeravailableMicrocreditsintegermonthlyMicrocreditsintegerpurchasedMicrocreditsintegerfreeTasksAllowanceMicrocreditsintegerrecurringTotalUsdnumbercancellationScheduledbooleanaddOnsobject[]Show propertiesHide properties
Array of
objectidstringAllowed:
siteapi_higherapi_highestunlimited_apimonthlyUsdnumbergrantedbooleancurrentPeriodUsageobjectShow propertiesHide properties
amountMicrocreditsintegerinputTokensintegeroutputTokensintegerquantityByServiceobjectShow propertiesHide properties
aiintegeremailintegerscrapeinteger400The request is malformed, and the message names the field.
errorobjectShow propertiesHide properties
codestringmessagestring401The bearer token is missing, revoked, or expired.
errorobjectShow propertiesHide properties
codestringmessagestring403The token's person does not hold the role this needs.
errorobjectShow propertiesHide properties
codestringmessagestring429Too many requests. Wait the seconds in `Retry-After`. Limits depend on the plan. See [rate limits](/api/errors-and-limits#rate-limits).
errorobjectShow propertiesHide properties
codestringmessagestringRequest
curl -X GET "https://api.median.sh/v1/billing/overview" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.median.sh/v1/billing/overview", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"plan": "explore",
"planGranted": true,
"status": "active",
"periodStart": 0,
"periodEnd": 0,
"includedMicrocredits": 0,
"availableMicrocredits": 0,
"monthlyMicrocredits": 0,
"purchasedMicrocredits": 0,
"freeTasksAllowanceMicrocredits": 0,
"recurringTotalUsd": 0,
"cancellationScheduled": true,
"addOns": [
{
"id": "site",
"monthlyUsd": 0,
"granted": true
}
],
"currentPeriodUsage": {
"amountMicrocredits": 0,
"inputTokens": 0,
"outputTokens": 0,
"quantityByService": {
"ai": 0,
"email": 0,
"scrape": 0
}
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}