CLI 参考

pikeway activities

钱包流水:充值、每次调用的扣费以及其他余额变动,按时间倒序。

用法

bash
pikeway activities [--limit 20] [--cursor <cursor>] [--json]

说明

读取 key 所属账户的 GET /v1/wallet/activities。每行显示时间、金额(扣费为负数,入账带 +)、类型和说明。还有更多记录时,最后一行给出翻到下一页的命令。需要 key。

参数

--limit, -linteger
每页条数。默认 20,最大 100。
--cursorstring
上一页返回的游标(more: 后面打印的值)。

示例

bash
pikeway activities

# more at once
pikeway activities --limit 100

# next page
pikeway activities --cursor MjAyNi0xMC0yM1QxODo0MDoxMS4...

# only top-ups
pikeway activities -l 100 --json | jq '.items[] | select(.type == "TOPUP")'

输出

text
2026-10-24T09:12:03Z  -0.001  CONSUMPTION  call Birdeye
2026-10-23T18:40:11Z  +10  TOPUP  Top-up

more: pikeway activities --cursor MjAyNi0xMC0yM1QxODo0MDoxMS4…
  • 没有任何流水的账户不输出内容,以 0 退出。
  • 调用扣费的记录在 JSON 中带有 runId,可以用 pikeway runs get 查询对应运行。

--json

json
{
  "items": [
    {
      "id": "6a1f0c52-8d3e-4b7a-9f21-0e4c5d6b7a89",
      "type": "CONSUMPTION",
      "amount": { "value": -0.001, "currency": "USD" },
      "balanceAfter": 12.4831,
      "description": "call Birdeye",
      "createdAt": "2026-10-24T09:12:03Z",
      "runId": "0192f6b0-5e2a-7d40-b1c3-8f9e2a4d6c11"
    },
    {
      "id": "3c9b1e7d-2f4a-4c8e-b5d6-7a8f9e0d1c2b",
      "type": "TOPUP",
      "amount": { "value": 10, "currency": "USD" },
      "balanceAfter": 12.4841,
      "description": "Top-up",
      "createdAt": "2026-10-23T18:40:11Z"
    }
  ],
  "cursor": null
}

错误与退出码

退出码错误信息触发条件
3no API key: run `pikeway keys add --label main --key pk-...`, set PIKEWAY_API_KEY, or pass --key没有 --key、没有 PIKEWAY_API_KEY,也没有已保存的当前 key。在发出请求之前就会检查。
3invalid or revoked API key — add a key with `pikeway keys add --label main --key pk-...` (or use --x402)网关返回 401(key 不存在、已吊销或已过期)。403 同样以 3 退出。
1cannot reach <gateway>: ECONNREFUSED无法连接网关(DNS、网络,或 PIKEWAY_API_BASE_URL 写错)。冒号后的错误码来自 Node。
同样支持全局参数 -j, --json 和 -k, --key。见 全局参数 与 退出码。