@byteplus/ark-cli-darwin-x64 0.0.0-stage → 1.0.46-prerelease.dc921200a42d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/LICENSE +201 -0
  2. package/bin/arkcli-darwin-amd64 +4 -0
  3. package/manifest.json +43 -0
  4. package/package.json +20 -4
  5. package/skills/arkcli-agent/SKILL.md +152 -0
  6. package/skills/arkcli-agent/references/agent.md +398 -0
  7. package/skills/arkcli-agent/references/byok.md +65 -0
  8. package/skills/arkcli-agent/references/context-management.md +42 -0
  9. package/skills/arkcli-agent/references/debug-export.md +26 -0
  10. package/skills/arkcli-agent/references/evals.md +178 -0
  11. package/skills/arkcli-agent/references/events-chat.md +148 -0
  12. package/skills/arkcli-agent/references/interfaces-gaps.md +52 -0
  13. package/skills/arkcli-agent/references/mcp-vault.md +111 -0
  14. package/skills/arkcli-agent/references/model-config.md +46 -0
  15. package/skills/arkcli-agent/references/self-hosted.md +47 -0
  16. package/skills/arkcli-agent/references/session-files.md +149 -0
  17. package/skills/arkcli-agent/references/session-upgrade.md +61 -0
  18. package/skills/arkcli-agent/references/skills.md +87 -0
  19. package/skills/arkcli-agent/references/todo-write.md +31 -0
  20. package/skills/arkcli-api-explorer/SKILL.md +188 -0
  21. package/skills/arkcli-api-explorer/references/arkcli-api.md +180 -0
  22. package/skills/arkcli-api-explorer/references/evals.md +176 -0
  23. package/skills/arkcli-auth/SKILL.md +184 -0
  24. package/skills/arkcli-auth/references/arkcli-auth-login.md +92 -0
  25. package/skills/arkcli-auth/references/arkcli-auth-status.md +109 -0
  26. package/skills/arkcli-auth/references/arkcli-auth-whoami.md +56 -0
  27. package/skills/arkcli-auth/references/auth-modes.md +78 -0
  28. package/skills/arkcli-auth/references/evals.md +82 -0
  29. package/skills/arkcli-auth/references/identity-resolution.md +33 -0
  30. package/skills/arkcli-auth/references/realname-gate.md +69 -0
  31. package/skills/arkcli-billing/SKILL.md +122 -0
  32. package/skills/arkcli-billing/references/arkcli-billing-list.md +259 -0
  33. package/skills/arkcli-billing/references/evals.md +107 -0
  34. package/skills/arkcli-chat/SKILL.md +114 -0
  35. package/skills/arkcli-chat/references/arkcli-chat.md +283 -0
  36. package/skills/arkcli-chat/references/caching-thinking.md +124 -0
  37. package/skills/arkcli-chat/references/chat-meta.md +77 -0
  38. package/skills/arkcli-chat/references/evals.md +34 -0
  39. package/skills/arkcli-chat/references/stream-events.md +124 -0
  40. package/skills/arkcli-chat/references/text-format.md +167 -0
  41. package/skills/arkcli-chat/references/tools.md +119 -0
  42. package/skills/arkcli-config/SKILL.md +197 -0
  43. package/skills/arkcli-config/references/arkcli-config-init.md +89 -0
  44. package/skills/arkcli-config/references/arkcli-config-profile.md +106 -0
  45. package/skills/arkcli-config/references/evals.md +154 -0
  46. package/skills/arkcli-connect/SKILL.md +196 -0
  47. package/skills/arkcli-connect/references/arkcli-connect.md +165 -0
  48. package/skills/arkcli-connect/references/evals.md +231 -0
  49. package/skills/arkcli-custommodel/SKILL.md +167 -0
  50. package/skills/arkcli-custommodel/references/arkcli-custommodel-available-quantizations.md +29 -0
  51. package/skills/arkcli-custommodel/references/arkcli-custommodel-delete.md +37 -0
  52. package/skills/arkcli-custommodel/references/arkcli-custommodel-get.md +45 -0
  53. package/skills/arkcli-custommodel/references/arkcli-custommodel-list.md +65 -0
  54. package/skills/arkcli-custommodel/references/arkcli-custommodel-quantize.md +59 -0
  55. package/skills/arkcli-custommodel/references/arkcli-custommodel-update.md +47 -0
  56. package/skills/arkcli-custommodel/references/arkcli-custommodel-upload.md +64 -0
  57. package/skills/arkcli-custommodel/references/evals.md +59 -0
  58. package/skills/arkcli-datasets/SKILL.md +39 -0
  59. package/skills/arkcli-datasets/references/commands.md +83 -0
  60. package/skills/arkcli-datasets/references/evals.md +31 -0
  61. package/skills/arkcli-deploy/SKILL.md +89 -0
  62. package/skills/arkcli-deploy/references/arkcli-deploy.md +141 -0
  63. package/skills/arkcli-deploy/references/evals.md +80 -0
  64. package/skills/arkcli-docs/SKILL.md +453 -0
  65. package/skills/arkcli-docs/references/commands.md +283 -0
  66. package/skills/arkcli-docs/references/evals.md +201 -0
  67. package/skills/arkcli-docs/references/failure-modes.md +85 -0
  68. package/skills/arkcli-doctor/CONTRIBUTING.md +54 -0
  69. package/skills/arkcli-doctor/SKILL.md +367 -0
  70. package/skills/arkcli-doctor/references/error-codes.md +162 -0
  71. package/skills/arkcli-doctor/references/evals.md +385 -0
  72. package/skills/arkcli-doctor/references/scope-account.md +94 -0
  73. package/skills/arkcli-doctor/references/scope-cli.md +88 -0
  74. package/skills/arkcli-doctor/references/scope-infer-endpoint.md +132 -0
  75. package/skills/arkcli-doctor/references/scope-metrics.md +157 -0
  76. package/skills/arkcli-doctor/references/scope-model.md +130 -0
  77. package/skills/arkcli-doctor/references/verify-origin.md +102 -0
  78. package/skills/arkcli-gen/SKILL.md +188 -0
  79. package/skills/arkcli-gen/references/arkcli-gen.md +230 -0
  80. package/skills/arkcli-gen/references/gen-meta.md +154 -0
  81. package/skills/arkcli-gen/references/image-stream.md +105 -0
  82. package/skills/arkcli-helper/SKILL.md +200 -0
  83. package/skills/arkcli-helper/references/arkcli-helper.md +298 -0
  84. package/skills/arkcli-helper/references/evals.md +334 -0
  85. package/skills/arkcli-iam/SKILL.md +46 -0
  86. package/skills/arkcli-iam/references/arkcli-iam-userid.md +54 -0
  87. package/skills/arkcli-iam/references/evals.md +24 -0
  88. package/skills/arkcli-infer-endpoint/SKILL.md +82 -0
  89. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-capability-get.md +50 -0
  90. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-create.md +121 -0
  91. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-delete.md +71 -0
  92. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-get.md +43 -0
  93. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-list.md +82 -0
  94. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-start.md +36 -0
  95. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-stop.md +36 -0
  96. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-update.md +78 -0
  97. package/skills/arkcli-infer-endpoint/references/evals.md +24 -0
  98. package/skills/arkcli-models/SKILL.md +305 -0
  99. package/skills/arkcli-models/references/arkcli-models-activate.md +103 -0
  100. package/skills/arkcli-models/references/arkcli-models-get.md +94 -0
  101. package/skills/arkcli-models/references/arkcli-models-list.md +71 -0
  102. package/skills/arkcli-models/references/arkcli-models-scenario-table.md +75 -0
  103. package/skills/arkcli-models/references/arkcli-models-search.md +170 -0
  104. package/skills/arkcli-models/references/evals.md +57 -0
  105. package/skills/arkcli-onboard/SKILL.md +169 -0
  106. package/skills/arkcli-onboard/references/evals.md +156 -0
  107. package/skills/arkcli-plans/SKILL.md +135 -0
  108. package/skills/arkcli-plans/references/arkcli-plans-buy.md +125 -0
  109. package/skills/arkcli-plans/references/arkcli-plans-get.md +84 -0
  110. package/skills/arkcli-plans/references/arkcli-plans-model-apply.md +58 -0
  111. package/skills/arkcli-plans/references/arkcli-plans-model-list.md +114 -0
  112. package/skills/arkcli-plans/references/arkcli-plans-renew.md +125 -0
  113. package/skills/arkcli-plans/references/arkcli-plans-team-rotate-apikey.md +61 -0
  114. package/skills/arkcli-plans/references/arkcli-plans-team-seat-assign.md +147 -0
  115. package/skills/arkcli-plans/references/arkcli-plans-team-seat-list.md +100 -0
  116. package/skills/arkcli-plans/references/evals.md +178 -0
  117. package/skills/arkcli-pricing/SKILL.md +120 -0
  118. package/skills/arkcli-pricing/references/arkcli-pricing-models.md +258 -0
  119. package/skills/arkcli-pricing/references/arkcli-pricing-plans.md +139 -0
  120. package/skills/arkcli-profile/SKILL.md +168 -0
  121. package/skills/arkcli-profile/references/arkcli-profile-create.md +92 -0
  122. package/skills/arkcli-profile/references/arkcli-profile-keys.md +135 -0
  123. package/skills/arkcli-profile/references/arkcli-profile-set-default.md +81 -0
  124. package/skills/arkcli-profile/references/evals.md +93 -0
  125. package/skills/arkcli-resources/SKILL.md +112 -0
  126. package/skills/arkcli-resources/references/arkcli-resources-list.md +105 -0
  127. package/skills/arkcli-shared/SKILL.md +209 -0
  128. package/skills/arkcli-shared/references/global-flags.md +77 -0
  129. package/skills/arkcli-shared/references/profile-defaults.md +35 -0
  130. package/skills/arkcli-shared/references/troubleshooting.md +49 -0
  131. package/skills/arkcli-shared/references/update.md +117 -0
  132. package/skills/arkcli-train-finetune/SKILL.md +109 -0
  133. package/skills/arkcli-train-finetune/references/create.md +274 -0
  134. package/skills/arkcli-train-finetune/references/download.md +50 -0
  135. package/skills/arkcli-train-finetune/references/evals.md +59 -0
  136. package/skills/arkcli-train-finetune/references/export-deploy.md +179 -0
  137. package/skills/arkcli-train-finetune/references/list.md +79 -0
  138. package/skills/arkcli-train-finetune/references/manage.md +140 -0
  139. package/skills/arkcli-understand/SKILL.md +105 -0
  140. package/skills/arkcli-understand/references/arkcli-understand.md +249 -0
  141. package/skills/arkcli-understand/references/evals.md +109 -0
  142. package/skills/arkcli-understand/references/sub-skills.md +137 -0
  143. package/skills/arkcli-usage/SKILL.md +123 -0
  144. package/skills/arkcli-usage/references/arkcli-usage-balance.md +196 -0
  145. package/skills/arkcli-usage/references/arkcli-usage-plan.md +153 -0
  146. package/skills/arkcli-usage/references/arkcli-usage-seats.md +199 -0
  147. package/skills/arkcli-usage/references/arkcli-usage-stats.md +160 -0
  148. package/README.md +0 -3
@@ -0,0 +1,160 @@
1
+ # usage stats
2
+
3
+ > **Prerequisite:** Read [`../arkcli-shared/SKILL.md`](../../arkcli-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.
4
+
5
+ > **⚠️ Data freshness:** `usage stats` uses an upstream BFF aggregation pipeline with a **5–30 minute delay** and is intended for daily/aggregate analysis. It is **not suitable** for real-time budget monitoring, rate limits, or alerts. For real-time controls, read per-request `.usage` from inference commands ([arkcli-chat](../../arkcli-chat/SKILL.md) / [arkcli-gen](../../arkcli-gen/SKILL.md)); this data has no aggregation delay and is measured per call.
6
+
7
+ Query ARK inference usage over a date range with filtering/grouping by endpoint, model, API Key, and other dimensions.
8
+
9
+ **Voice models are unsupported**: do not query TTS / ASR / dubbing / podcast / voice / real-time voice interaction with `usage stats --model`; state that usage queries are unsupported.
10
+
11
+ ## Commands
12
+
13
+ ```bash
14
+ # Query today's usage (--start is required; omitting it returns required flag(s) "start" not set)
15
+ arkcli usage stats --start <YYYY-MM-DD>
16
+
17
+ # Query this month by day
18
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30
19
+
20
+ # Hourly query
21
+ arkcli usage stats --start 2025-09-17 --end 2025-09-19 --interval Hour --endpoint ep-20xxxx-xxx
22
+
23
+ # Query a specified model
24
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30 --model dola-seed-2-1-turbo-260628
25
+
26
+ # Group all usage by model
27
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30 --by model
28
+
29
+ # Group by endpoint
30
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30 --by endpoint
31
+
32
+ # Group by model and endpoint
33
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30 --by model,endpoint
34
+
35
+ # Filter by API Key
36
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30 --apikey ak-xxxxxxxx
37
+
38
+ # Query through a profile that owns the intended project
39
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30 \
40
+ --profile platform_ap-southeast-1_my-project
41
+
42
+ # Show billing-window details
43
+ arkcli usage stats --start 2025-09-01 --end 2025-09-30 --show-window-detail
44
+
45
+ # Entry for "my usage" (frequent AI Agent call)
46
+ # Endpoint dimension by default: list all Endpoints I created and query their combined usage
47
+ arkcli usage stats --start <YYYY-MM-DD> --mine
48
+
49
+ # Explicit endpoint dimension (same semantics as --mine)
50
+ arkcli usage stats --start <YYYY-MM-DD> --mine --mine-by=endpoint
51
+
52
+ # APIKey dimension: list all active APIKeys under my account, query each, and merge
53
+ arkcli usage stats --start 2026-05-01 --end 2026-05-08 --mine --mine-by=apikey
54
+
55
+ # Fuzzy match by APIKey suffix (aligned with console AuthToken ValueLike)
56
+ arkcli usage stats --start <YYYY-MM-DD> --apikey-suffix d9bcce38dab0
57
+ ```
58
+
59
+ ## Parameters
60
+
61
+ | Parameter | Required | Type | Description |
62
+ |---|---|---|---|
63
+ | `--start` | **Yes** | string | Start date, YYYY-MM-DD |
64
+ | `--end` | No | string | End date in YYYY-MM-DD format. The interval from `--start` cannot exceed 31 days; defaults to today |
65
+ | `--interval` | No | string | Query granularity: `Day` (default) or `Hour` |
66
+ | `--endpoint` | No | string | Filter by endpoint ID |
67
+ | `--model` | No | string | Filter by model name; adds `ModelName`, `ModelUnitID` |
68
+ | `--apikey` | No | string | Filter by the complete API Key value (`Values` exact matching; retained for compatibility with the earlier behavior) |
69
+ | `--apikey-suffix` | No | string | Filter by API Key suffix using `ValueLike` fuzzy matching, consistent with the console; the last 12 characters are recommended |
70
+ | `--mine` | No | bool | Restrict results to resources owned by the current authenticated identity; used with `--mine-by` |
71
+ | `--mine-by` | No | string | Dimension used by `--mine`: `endpoint` (default) means all Endpoints created by me; `apikey` means all active API Keys under my account |
72
+ | `--by` | No | string | Additional grouping dimensions, comma-separated: `model`, `endpoint`, `apikey` |
73
+ | `--show-window-detail` | No | bool | Include details split by billing window. Mutually exclusive with `SplitByWindows`, which is currently available only through the raw `arkcli api GetInferenceUsage` call |
74
+
75
+ ### `--mine` behavior
76
+
77
+ **BytePlus:**
78
+ - **Requires SSO sub-user login**: root accounts and AK/SK logins are rejected, with guidance to run `arkcli auth login` again.
79
+ - **Mutual exclusion rules**: `--mine --mine-by=endpoint` conflicts with `--endpoint`; `--mine --mine-by=apikey` conflicts with `--apikey` / `--apikey-suffix`.
80
+ - **`--mine-by=endpoint`**: uses the `sys:ark:createdBy` tag to retrieve all Endpoints created by me and query them together (`--page-all` forced).
81
+ - If `data_count=0` (the Endpoints have no invocation records, or the user mainly invokes models directly through API Keys), immediately retry with `--mine --mine-by=apikey`.
82
+ - **Never fall back to a query without `--mine`**; whole-account data is not "my usage".
83
+ - **`--mine-by=apikey`**: lists all active API Keys under my account and issues one serial request per key (`ValueLike` is single-value), then merges the records; `totals` contains the merged total.
84
+
85
+ ### `--by`
86
+
87
+ `--by` returns and groups by dimensions without filtering:
88
+
89
+ | Value | Added columns |
90
+ |----|------------|
91
+ | `model` | `ModelName`, `ModelUnitID` |
92
+ | `endpoint` | `ModelEndpoint` |
93
+ | `apikey` | `AuthToken` |
94
+
95
+ `--model` filters one model; `--by model` returns all models grouped by model. Both add `ModelName` and `ModelUnitID`.
96
+
97
+ ## Return value
98
+
99
+ JSON format:
100
+
101
+ ```json
102
+ {
103
+ "fields": [
104
+ { "name": "AccountID", "type": "BIGINT" },
105
+ { "name": "Day", "type": "DATE" },
106
+ { "name": "InputTokens", "type": "BIGINT" },
107
+ { "name": "CacheTokensHit", "type": "BIGINT" },
108
+ { "name": "OutputTokens", "type": "BIGINT" },
109
+ { "name": "TotalTokens", "type": "BIGINT" },
110
+ { "name": "ReqCnt", "type": "BIGINT" },
111
+ { "name": "ImageCount", "type": "BIGINT" }
112
+ ],
113
+ "records": [...],
114
+ "totals": {
115
+ "InputTokens": "382",
116
+ "OutputTokens": "5317",
117
+ "TotalTokens": "5699",
118
+ "ReqCnt": "11",
119
+ "CacheTokensHit": "0",
120
+ "ImageCount": "4"
121
+ },
122
+ "data_count": 3
123
+ }
124
+ ```
125
+
126
+ `totals` sums all metric columns across `records`: `InputTokens`, `OutputTokens`, `TotalTokens`, `ReqCnt`, `CacheTokensHit`, and `ImageCount`. Dimension columns (`AccountID`, `Day`, `ModelEndpoint`, `AuthToken`, `ProjectName`, and `BillingStatus`) are **not** summed. To answer "How many tokens did I use today?", read `totals.TotalTokens`; for a dimensional breakdown, use `records`.
127
+
128
+ Dimension columns appear under these conditions:
129
+
130
+ | Column | Appears when |
131
+ |------|---------|
132
+ | `ModelEndpoint` | `--endpoint` or `--by endpoint` |
133
+ | `ModelName` | `--model` or `--by model` |
134
+ | `ModelUnitID` | `--model` or `--by model` |
135
+ | `AuthToken` | `--apikey` or `--by apikey` |
136
+
137
+ ## Common errors
138
+
139
+ | Error | Cause | Handling |
140
+ |---|---|---|
141
+ | `not logged in` | Not authenticated | Run `arkcli auth login` |
142
+ | `AuthFailure` / 401 | Invalid AK/SK or SSO token | Log in again |
143
+ | Range exceeds 31 days | API limit | Split into multiple queries |
144
+ | Empty records | No matching data or filters too strict | Retry without filters |
145
+
146
+ ## Notes
147
+
148
+ - **`--start` is required**: omitting it returns `required flag(s) "start" not set`; the CLI does **not** default to today. If the user provides no date, set `--start` to today and omit `--end` so the query covers the same day.
149
+ - **Data is delayed 5–30 minutes** because of the upstream aggregation pipeline; arkcli only passes it through and cannot reduce the delay. For real-time budget, rate-limit, or alerting controls, use per-request `.usage` instead of polling this interface.
150
+ - **Voice models are outside this command's supported scope**: do not construct `--model`, `--by model`, or API Key fallback queries for TTS / ASR / voice interaction; state that arkcli does not support voice-model usage queries.
151
+ - arkcli automatically filters out `free_for_coding_plan` usage rows and always retains rows that have a `ModelUnitID`.
152
+ - With `--interval Hour`, the returned `Hour` field has type STRING.
153
+ - Date range cannot exceed 31 days.
154
+
155
+ ## References
156
+
157
+ - [arkcli-usage](../SKILL.md) -- Usage overview
158
+ - [arkcli-chat](../../arkcli-chat/SKILL.md) -- Real-time per-request `.usage`
159
+ - [arkcli-gen](../../arkcli-gen/SKILL.md) -- Real-time image/video task `.usage`
160
+ - [arkcli-shared](../../arkcli-shared/SKILL.md) -- Authentication and global parameters
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.