360 Secure SkillHub
360 安全技能中心

vike-account-usage

通过 MCP 工具、vike-data CLI 或 REST API 查询当前凭据的套餐、月度与每日请求余量、分钟及滚动小时限额和重置时间,并按模板给出用量说明;匿名令牌需改用 whoami 查看当日余量。

分类:数据
vikeio
vikeio
热度 37.37
最近更新 2026-12-02 09:54:52

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add vikeio/vike-account-usage
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
vike-account-usage
description
Say how many vike API requests you have used and how many are left - your plan, this month's requests used and remaining with the date new ones arrive, today's count on the Free plan with its midnight-UTC reset, the per-minute limit and the requests used in the last hour per key - for the API key or sign-in in use; the anonymous token's left-for-today count too. Use when the user asks "how many requests do I have left" / "what is my vike usage" / "when does my limit reset" / "which plan am I on" / "why am I being rate limited".
allowed-tools
Bash(vike-data:*)

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:

  1. MCP: the account_usage tool, no arguments.
  2. CLI: there is no command of its own; call prints the tool's raw JSON:
    vike-data whoami                          # first: which credential is in use (oauth | api_key | anonymous)
    vike-data call account_usage
    
  3. curl with an API key in VIKE_API_KEY (or api_key from ~/.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, or null when no plan limit covers the account.
  • month {limit, used, remaining, resets_at}: a paid plan's requests. remaining is what you hold now; unused requests never expire; resets_at is when new requests next arrive (the renewal day, or a yearly plan's next monthly date, UTC), null when none will (cancelled at period end, or requests left after payments stopped). All null on 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 and used counts it so: another account on the same network uses it too. All null on 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; use vike-data whoami as 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 429 on other calls while remaining looks 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)