Account quota
Read how much of your plan quota and coupon budget is left, in whole Rupiah, so an agent or script can check before it starts a long job. The endpoint is specific to kenari and has no OpenAI or Anthropic equivalent.
GET /v1/account/quota
Request
Section titled “Request”The endpoint takes no query parameters and no body. It needs an API key in the Authorization header.
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer kn-.... A shared API key and a restricted key are refused. See Authentication and API keys. |
Response
Section titled “Response”The response has two fields, plan and coupon. Each is an object, or null when it does not apply.
| Field | Type | Description |
|---|---|---|
plan | object or null | Your active plan. null when you have never subscribed, the plan has ended, or the plan is no longer offered. |
plan.name | string | The plan name. |
plan.windows | object | The quota windows that have a ceiling. Possible keys are five_hour, week and month. A window with no ceiling is left out, so the object can be empty. |
plan.windows.<key>.used_rp | integer | Rupiah used in this window, rounded up. |
plan.windows.<key>.remaining_rp | integer | Rupiah left in this window, rounded down and never below 0. |
plan.windows.<key>.resets_at | string | When this rolling window resets, in RFC 3339 UTC. |
coupon | object or null | The active coupon. null when you have none or it has expired. It is reported separately from the plan, so you can have a coupon without a plan. |
coupon.name | string | The coupon name. |
coupon.used_rp | integer | Rupiah used from the coupon, rounded up. |
coupon.remaining_rp | integer or null | Rupiah left on the coupon: the budget rounded down to whole Rupiah, minus used_rp, and never below 0. null when the coupon has no spending limit. |
coupon.expires_at | string | When the coupon expires, in RFC 3339 UTC. |
coupon.scope_models | array of strings | The model ids the coupon covers. |
{ "plan": { "name": "Indie", "windows": { "week": { "used_rp": 12000, "remaining_rp": 63000, "resets_at": "2026-10-13T07:12:00Z" }, "month": { "used_rp": 12000, "remaining_rp": 288000, "resets_at": "2026-10-30T07:12:00Z" } } }, "coupon": null}For how windows, coupons and covered models work, see Subscriptions.
Examples
Section titled “Examples”curl https://kenari.id/v1/account/quota \ -H "Authorization: Bearer $KENARI_API_KEY"Python
Section titled “Python”import osimport requests
response = requests.get( "https://kenari.id/v1/account/quota", headers={"Authorization": f"Bearer {os.environ['KENARI_API_KEY']}"},)response.raise_for_status()quota = response.json()
for name, window in (quota["plan"] or {}).get("windows", {}).items(): print(name, window["remaining_rp"], window["resets_at"])JavaScript
Section titled “JavaScript”const response = await fetch("https://kenari.id/v1/account/quota", { headers: { Authorization: `Bearer ${process.env.KENARI_API_KEY}` },});if (!response.ok) throw new Error(await response.text());const quota = await response.json();
for (const [name, window] of Object.entries(quota.plan?.windows ?? {})) { console.log(name, window.remaining_rp, window.resets_at);}The MCP tool kenari_quota returns the same plan and coupon data as plain text. See MCP server.
Billing
Section titled “Billing”Reading your quota is free. See How billing works.
Errors
Section titled “Errors”| Status | Code | When |
|---|---|---|
| 401 | None | The key is missing, invalid or expired. The body is a short plain-text message, not JSON. |
| 403 | shared_key_not_allowed | The key is a shared API key. A shared key cannot read the owner’s quota. |
| 403 | restricted_key_not_allowed | The key has a model restriction, a spend cap or a token cap. Use an unrestricted key from the account itself. |
| 500 | internal_error | Reading the quota failed in kenari. Retry once. |
See Errors for the error format and the remaining codes.