vike-account-usage
Your own usage for the credential in use, in one call that never counts toward your day or your month. Shared by the MCP server, the CLI and the REST API: every request of every key of the account is in the same count.
Example questions
- "How many vike requests do I have left today / this month?"
- "When does my limit reset?"
- "Which plan is this key on?"
Call it
Use the first of these that is available:
- MCP: the
account_usagetool, no arguments. - CLI: there is no command of its own;
callprints the tool's raw JSON:vike-data whoami # first: which credential is in use (oauth | api_key | anonymous) vike-data call account_usage - curl with an API key in
VIKE_API_KEY(orapi_keyfrom~/.vike/config.json; Windows%USERPROFILE%\.vike\config.json):curl -s "https://data.vike.io/v1/account/usage" -H "X-API-KEY: $VIKE_API_KEY"
An anonymous token cannot call it (refused with anon_scope, exit 3 on the CLI). For it, vike-data whoami shows remaining_today (from the last response today; absent before the first), and every REST response carries X-Vike-Anon-Remaining. An anonymous token has 50 requests a day; vike-data login gives 400.
Reading the answer
A key on a custom plan (no monthly or daily limit, only the hourly one):
{"plan": "custom", "month": {"limit": null, "used": null, "remaining": null, "resets_at": null},
"day": {"limit": null, "used": null, "remaining": null, "resets_at": null}, "minute": {"limit": null}, "hour": {"limit": 20000, "used": 25}}
plan:free,starter,requests,requests_plus,high,high_plus,custom, ornullwhen no plan limit covers the account.month{limit, used, remaining, resets_at}: a paid plan's requests.remainingis what you hold now; unused requests never expire;resets_atis when new requests next arrive (the renewal day, or a yearly plan's next monthly date, UTC),nullwhen none will (cancelled at period end, or requests left after payments stopped). Allnullon Free and custom.day{limit, used, remaining, resets_at}: the Free plan's daily limit, reset at 00:00 UTC. Free accounts on one IP address share one daily allowance andusedcounts it so: another account on the same network uses it too. Allnullon every other plan.minute.limit: the per-minute limit (null= none).hour{limit, used}: the rolling hour, counted per API key.- Counts trail by up to about a minute: a burst you just sent may not show yet.
Answer template
Plan
<plan>.<Free: used <day.used> of <day.limit> today, <day.remaining> left, resets <day.resets_at>.><Paid: <month.remaining> requests left of <month.limit>, new ones on <month.resets_at>.>This key:<hour.used>requests in the last hour (limit<hour.limit>).
Errors
anon_scope/ exit 3: the credential is an anonymous token; usevike-data whoamias above, or sign in (vike-data login).- HTTP 503 right after a server restart: the plans are not read yet; retry once after a few seconds.
HTTP 429on other calls whileremaininglooks positive: the per-minute or hourly limit, or the shared Free allowance of the IP address; wait for the window, do not retry in a loop.
See also
vike-core(sign-in, API keys, exit codes, what each limit means)
