stepfun-status 1.0.2 → 1.0.3

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.
@@ -0,0 +1,175 @@
1
+ # StepFun Status 项目架构文档
2
+
3
+ ## 概述
4
+
5
+ StepFun Status 是一个 StepFun Token-Plan 使用状态监控工具,支持 CLI 命令和 Claude Code 状态栏集成。
6
+
7
+ **注意**: 此工具需要 StepFun 官方开放用量查询 API 后才能显示完整额度信息。
8
+
9
+ ---
10
+
11
+ ## API 接口汇总
12
+
13
+ ### 1. Platform API (需要浏览器 Cookie)
14
+
15
+ **Base URL**: `https://platform.stepfun.com`
16
+
17
+ **认证方式**: 完整 Cookie 字符串(包含 `Oasis-Token` 和 `Oasis-Webid`)
18
+
19
+ **获取方式**:
20
+ 1. 登录 https://platform.stepfun.com/plan-subscribe
21
+ 2. F12 → Network 标签
22
+ 3. 刷新页面
23
+ 4. 点击任意 API 请求(如 `GetStepPlanStatus`)
24
+ 5. 滚动到 Request Headers → 找到 `Cookie` 行
25
+ 6. 右键 → Copy value
26
+
27
+ ---
28
+
29
+ #### 1.1 GetStepPlanStatus - 获取订阅信息
30
+
31
+ **Endpoint**: `POST /api/step.openapi.devcenter.Dashboard/GetStepPlanStatus`
32
+
33
+ **请求体**: `{}`
34
+
35
+ **响应格式**:
36
+ ```json
37
+ {
38
+ "status": 1,
39
+ "desc": "",
40
+ "subscription": {
41
+ "plan_type": 4,
42
+ "name": "Mini",
43
+ "status": 1,
44
+ "pay_channel": 1,
45
+ "activated_at": "1774255868",
46
+ "expired_at": "1776847868",
47
+ "auto_renew": false,
48
+ "plan_id": "5"
49
+ },
50
+ "plan_definition": {
51
+ "type": 4,
52
+ "price": "2500",
53
+ "support_models": ["step-3.5-flash"],
54
+ "available": true,
55
+ "original_price": "4900",
56
+ "plan_id": "5"
57
+ }
58
+ }
59
+ ```
60
+
61
+ **字段说明**:
62
+ - `subscription.name`: 套餐名称 (Mini/Pro等)
63
+ - `subscription.activated_at`: 激活时间戳(秒)
64
+ - `subscription.expired_at`: 到期时间戳(秒)
65
+ - `plan_definition.support_models`: 支持的模型列表
66
+
67
+ ---
68
+
69
+ #### 1.2 QueryStepPlanRateLimit - 获取用量信息
70
+
71
+ **Endpoint**: `POST /api/step.openapi.devcenter.Dashboard/QueryStepPlanRateLimit`
72
+
73
+ **请求体**: `{}`
74
+
75
+ **响应格式**:
76
+ ```json
77
+ {
78
+ "status": 1,
79
+ "desc": "",
80
+ "five_hour_usage_left_rate": 0.9999867,
81
+ "five_hour_usage_reset_time": "1774324800",
82
+ "weekly_usage_left_rate": 0.9103905,
83
+ "weekly_usage_reset_time": "1774857600"
84
+ }
85
+ ```
86
+
87
+ **字段说明**:
88
+ - `five_hour_usage_left_rate`: 5小时窗口剩余比例 (0-1)
89
+ - `five_hour_usage_reset_time`: 5小时窗口重置时间戳(秒)
90
+ - `weekly_usage_left_rate`: 每周剩余比例 (0-1)
91
+ - `weekly_usage_reset_time`: 每周重置时间戳(秒)
92
+
93
+ ---
94
+
95
+ ### 2. Developer API (API Key 方式) - [待开放]
96
+
97
+ **Base URL**: `https://api.stepfun.com`
98
+
99
+ **认证方式**: `Authorization: Bearer <API_KEY>`
100
+
101
+ **API Key 获取**: https://platform.stepfun.com/interface-key
102
+
103
+ #### 2.1 Models - 模型列表
104
+
105
+ **Endpoint**: `GET /v1/models`
106
+
107
+ **响应格式**:
108
+ ```json
109
+ {
110
+ "data": [
111
+ {
112
+ "id": "step-3.5-flash",
113
+ "object": "model",
114
+ "created": 1769580037,
115
+ "owned_by": "stepai"
116
+ }
117
+ ],
118
+ "object": "list"
119
+ }
120
+ ```
121
+
122
+ #### 2.2 Chat Completions - 对话
123
+
124
+ **Endpoint**: `POST /v1/chat/completions`
125
+
126
+ **请求示例**:
127
+ ```json
128
+ {
129
+ "model": "step-3.5-flash",
130
+ "messages": [{"role": "user", "content": "hi"}]
131
+ }
132
+ ```
133
+
134
+ #### 2.3 Usage API - [待 StepFun 官方开放]
135
+
136
+ **Endpoint**: `GET /v1/usage` (待确认)
137
+
138
+ 此接口将允许使用 API Key 查询账户用量,无需浏览器 Cookie。
139
+
140
+ ---
141
+
142
+ ## 配置文件
143
+
144
+ **路径**: `~/.stepfun-config.json`
145
+
146
+ **格式**:
147
+ ```json
148
+ {
149
+ "cookie": "Oasis-Webid=xxx; Oasis-Token=xxx; ..."
150
+ }
151
+ ```
152
+
153
+ ---
154
+
155
+ ## 与 MiniMax 的对比
156
+
157
+ | 功能 | MiniMax | StepFun |
158
+ |------|---------|---------|
159
+ | AI API | ✅ OpenAI Compatible | ✅ OpenAI Compatible |
160
+ | 用量查询 API | ✅ 有 | ⏳ 待开放 |
161
+ | 认证方式 | API Key | Cookie (当前) / API Key (待开放) |
162
+ | 配置文件 | `~/.minimax-config.json` | `~/.stepfun-config.json` |
163
+
164
+ ---
165
+
166
+ ## 页面显示数据来源
167
+
168
+ 页面 https://platform.stepfun.com/plan-subscribe 显示的数据:
169
+
170
+ ```
171
+ 5小时用量: 剩余 100%, 重置时间: 2026-03-24 12:00:00
172
+ 每周用量: 剩余 91%, 重置时间: 2026-03-30 16:00:00
173
+ ```
174
+
175
+ 这些数据来自 `QueryStepPlanRateLimit` 接口。
package/package.json CHANGED
@@ -1,16 +1,12 @@
1
1
  {
2
2
  "name": "stepfun-status",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "StepFun Token-Plan 使用状态监控工具,支持 Claude Code 状态栏集成",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
7
7
  "stepfun-status": "cli/index.js",
8
8
  "stepfun": "cli/index.js"
9
9
  },
10
- "files": [
11
- "cli/",
12
- "README.md"
13
- ],
14
10
  "scripts": {
15
11
  "test": "node cli/index.js health",
16
12
  "start": "node cli/index.js status",
@@ -35,6 +31,7 @@
35
31
  "bugs": {
36
32
  "url": "https://github.com/Daiyimo/stepfun-status/issues"
37
33
  },
34
+ "readme": "README.md",
38
35
  "dependencies": {
39
36
  "boxen": "^8.0.1",
40
37
  "chalk": "^5.6.2",
Binary file