Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit ebda40a

Browse files
authored
Merge pull request #31 from RedwindA/fix/authHeader-userID
Refactor API headers to remove 'Bearer' prefix from 'New-Api-User' token in multiple documentation files
2 parents bdc4c4c + 2b8b1d3 commit ebda40a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+267
-267
lines changed

docs/api/fei-account-billing-panel.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const response = await fetch('/dashboard/billing/subscription', {
2525
headers: {
2626
'Content-Type': 'application/json',
2727
'Authorization': 'Bearer your_user_token',
28-
'New-Api-User': 'Bearer your_user_id'
28+
'New-Api-User': 'your_user_id'
2929
}
3030
});
3131
const data = await response.json();
@@ -80,7 +80,7 @@ const response = await fetch('/v1/dashboard/billing/subscription', {
8080
headers: {
8181
'Content-Type': 'application/json',
8282
'Authorization': 'Bearer your_user_token',
83-
'New-Api-User': 'Bearer your_user_id'
83+
'New-Api-User': 'your_user_id'
8484
}
8585
});
8686
const data = await response.json();
@@ -135,7 +135,7 @@ const response = await fetch('/dashboard/billing/usage', {
135135
headers: {
136136
'Content-Type': 'application/json',
137137
'Authorization': 'Bearer your_user_token',
138-
'New-Api-User': 'Bearer your_user_id'
138+
'New-Api-User': 'your_user_id'
139139
}
140140
});
141141
const data = await response.json();
@@ -182,7 +182,7 @@ const response = await fetch('/v1/dashboard/billing/usage', {
182182
headers: {
183183
'Content-Type': 'application/json',
184184
'Authorization': 'Bearer your_user_token',
185-
'New-Api-User': 'Bearer your_user_id'
185+
'New-Api-User': 'your_user_id'
186186
}
187187
});
188188
const data = await response.json();

docs/api/fei-channel-management.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const response = await fetch('/api/channel/?p=1&page_size=20&id_sort=false&tag_m
2626
headers: {
2727
'Content-Type': 'application/json',
2828
'Authorization': 'Bearer your_admin_token',
29-
'New-Api-User': 'Bearer your_user_id'
29+
'New-Api-User': 'your_user_id'
3030
}
3131
});
3232
const data = await response.json();
@@ -97,7 +97,7 @@ const response = await fetch('/api/channel/search?keyword=openai&group=default&m
9797
headers: {
9898
'Content-Type': 'application/json',
9999
'Authorization': 'Bearer your_admin_token',
100-
'New-Api-User': 'Bearer your_user_id'
100+
'New-Api-User': 'your_user_id'
101101
}
102102
});
103103
const data = await response.json();
@@ -158,7 +158,7 @@ const response = await fetch('/api/channel/models', {
158158
headers: {
159159
'Content-Type': 'application/json',
160160
'Authorization': 'Bearer your_admin_token',
161-
'New-Api-User': 'Bearer your_user_id'
161+
'New-Api-User': 'your_user_id'
162162
}
163163
});
164164
const data = await response.json();
@@ -219,7 +219,7 @@ const response = await fetch('/api/channel/models_enabled', {
219219
headers: {
220220
'Content-Type': 'application/json',
221221
'Authorization': 'Bearer your_admin_token',
222-
'New-Api-User': 'Bearer your_user_id'
222+
'New-Api-User': 'your_user_id'
223223
}
224224
});
225225
const data = await response.json();
@@ -268,7 +268,7 @@ const response = await fetch('/api/channel/123', {
268268
headers: {
269269
'Content-Type': 'application/json',
270270
'Authorization': 'Bearer your_admin_token',
271-
'New-Api-User': 'Bearer your_user_id'
271+
'New-Api-User': 'your_user_id'
272272
}
273273
});
274274
const data = await response.json();
@@ -329,7 +329,7 @@ const response = await fetch('/api/channel/test?model=gpt-3.5-turbo', {
329329
headers: {
330330
'Content-Type': 'application/json',
331331
'Authorization': 'Bearer your_admin_token',
332-
'New-Api-User': 'Bearer your_user_id'
332+
'New-Api-User': 'your_user_id'
333333
}
334334
});
335335
const data = await response.json();
@@ -398,7 +398,7 @@ const response = await fetch('/api/channel/test/123?model=gpt-4', {
398398
headers: {
399399
'Content-Type': 'application/json',
400400
'Authorization': 'Bearer your_admin_token',
401-
'New-Api-User': 'Bearer your_user_id'
401+
'New-Api-User': 'your_user_id'
402402
}
403403
});
404404
const data = await response.json();
@@ -446,7 +446,7 @@ const response = await fetch('/api/channel/update_balance', {
446446
headers: {
447447
'Content-Type': 'application/json',
448448
'Authorization': 'Bearer your_admin_token',
449-
'New-Api-User': 'Bearer your_user_id'
449+
'New-Api-User': 'your_user_id'
450450
}
451451
});
452452
const data = await response.json();
@@ -490,7 +490,7 @@ const response = await fetch('/api/channel/update_balance/123', {
490490
headers: {
491491
'Content-Type': 'application/json',
492492
'Authorization': 'Bearer your_admin_token',
493-
'New-Api-User': 'Bearer your_user_id'
493+
'New-Api-User': 'your_user_id'
494494
}
495495
});
496496
const data = await response.json();
@@ -536,7 +536,7 @@ const response = await fetch('/api/channel/', {
536536
headers: {
537537
'Content-Type': 'application/json',
538538
'Authorization': 'Bearer your_admin_token',
539-
'New-Api-User': 'Bearer your_user_id'
539+
'New-Api-User': 'your_user_id'
540540
},
541541
body: JSON.stringify({
542542
mode: "single",
@@ -604,7 +604,7 @@ const response = await fetch('/api/channel/', {
604604
headers: {
605605
'Content-Type': 'application/json',
606606
'Authorization': 'Bearer your_admin_token',
607-
'New-Api-User': 'Bearer your_user_id'
607+
'New-Api-User': 'your_user_id'
608608
},
609609
body: JSON.stringify({
610610
id: 123,
@@ -656,7 +656,7 @@ const response = await fetch('/api/channel/disabled', {
656656
headers: {
657657
'Content-Type': 'application/json',
658658
'Authorization': 'Bearer your_admin_token',
659-
'New-Api-User': 'Bearer your_user_id'
659+
'New-Api-User': 'your_user_id'
660660
}
661661
});
662662
const data = await response.json();
@@ -702,7 +702,7 @@ const response = await fetch('/api/channel/tag/disabled', {
702702
headers: {
703703
'Content-Type': 'application/json',
704704
'Authorization': 'Bearer your_admin_token',
705-
'New-Api-User': 'Bearer your_user_id'
705+
'New-Api-User': 'your_user_id'
706706
},
707707
body: JSON.stringify({
708708
tag: "test-tag"
@@ -749,7 +749,7 @@ const response = await fetch('/api/channel/tag/enabled', {
749749
headers: {
750750
'Content-Type': 'application/json',
751751
'Authorization': 'Bearer your_admin_token',
752-
'New-Api-User': 'Bearer your_user_id'
752+
'New-Api-User': 'your_user_id'
753753
},
754754
body: JSON.stringify({
755755
tag: "production-tag"
@@ -796,7 +796,7 @@ const response = await fetch('/api/channel/tag', {
796796
headers: {
797797
'Content-Type': 'application/json',
798798
'Authorization': 'Bearer your_admin_token',
799-
'New-Api-User': 'Bearer your_user_id'
799+
'New-Api-User': 'your_user_id'
800800
},
801801
body: JSON.stringify({
802802
tag: "old-tag",
@@ -854,7 +854,7 @@ const response = await fetch('/api/channel/123', {
854854
headers: {
855855
'Content-Type': 'application/json',
856856
'Authorization': 'Bearer your_admin_token',
857-
'New-Api-User': 'Bearer your_user_id'
857+
'New-Api-User': 'your_user_id'
858858
}
859859
});
860860
const data = await response.json();
@@ -898,7 +898,7 @@ const response = await fetch('/api/channel/batch', {
898898
headers: {
899899
'Content-Type': 'application/json',
900900
'Authorization': 'Bearer your_admin_token',
901-
'New-Api-User': 'Bearer your_user_id'
901+
'New-Api-User': 'your_user_id'
902902
},
903903
body: JSON.stringify({
904904
ids: [1, 2, 3, 4, 5]
@@ -947,7 +947,7 @@ const response = await fetch('/api/channel/fix', {
947947
headers: {
948948
'Content-Type': 'application/json',
949949
'Authorization': 'Bearer your_admin_token',
950-
'New-Api-User': 'Bearer your_user_id'
950+
'New-Api-User': 'your_user_id'
951951
}
952952
});
953953
const data = await response.json();
@@ -997,7 +997,7 @@ const response = await fetch('/api/channel/fetch_models/123', {
997997
headers: {
998998
'Content-Type': 'application/json',
999999
'Authorization': 'Bearer your_admin_token',
1000-
'New-Api-User': 'Bearer your_user_id'
1000+
'New-Api-User': 'your_user_id'
10011001
}
10021002
});
10031003
const data = await response.json();
@@ -1047,7 +1047,7 @@ const response = await fetch('/api/channel/fetch_models', {
10471047
headers: {
10481048
'Content-Type': 'application/json',
10491049
'Authorization': 'Bearer your_admin_token',
1050-
'New-Api-User': 'Bearer your_user_id'
1050+
'New-Api-User': 'your_user_id'
10511051
},
10521052
body: JSON.stringify({
10531053
base_url: "https://api.openai.com",
@@ -1103,7 +1103,7 @@ const response = await fetch('/api/channel/batch/tag', {
11031103
headers: {
11041104
'Content-Type': 'application/json',
11051105
'Authorization': 'Bearer your_admin_token',
1106-
'New-Api-User': 'Bearer your_user_id'
1106+
'New-Api-User': 'your_user_id'
11071107
},
11081108
body: JSON.stringify({
11091109
ids: [1, 2, 3],
@@ -1154,7 +1154,7 @@ const response = await fetch('/api/channel/tag/models?tag=production', {
11541154
headers: {
11551155
'Content-Type': 'application/json',
11561156
'Authorization': 'Bearer your_admin_token',
1157-
'New-Api-User': 'Bearer your_user_id'
1157+
'New-Api-User': 'your_user_id'
11581158
}
11591159
});
11601160
const data = await response.json();
@@ -1200,7 +1200,7 @@ const response = await fetch('/api/channel/copy/123?suffix=_备份&reset_balance
12001200
headers: {
12011201
'Content-Type': 'application/json',
12021202
'Authorization': 'Bearer your_admin_token',
1203-
'New-Api-User': 'Bearer your_user_id'
1203+
'New-Api-User': 'your_user_id'
12041204
}
12051205
});
12061206
const data = await response.json();

docs/api/fei-data-statistics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const response = await fetch('/api/data/self?start_timestamp=1640908800&end_time
2525
headers: {
2626
'Content-Type': 'application/json',
2727
'Authorization': 'Bearer your_user_token',
28-
'New-Api-User': 'Bearer your_user_id'
28+
'New-Api-User': 'your_user_id'
2929
}
3030
});
3131
const data = await response.json();
@@ -101,7 +101,7 @@ const response = await fetch('/api/data/?start_timestamp=1640908800&end_timestam
101101
headers: {
102102
'Content-Type': 'application/json',
103103
'Authorization': 'Bearer your_admin_token',
104-
'New-Api-User': 'Bearer your_user_id'
104+
'New-Api-User': 'your_user_id'
105105
}
106106
});
107107
const data = await response.json();

docs/api/fei-group.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const response = await fetch('/api/group/', {
2525
headers: {
2626
'Content-Type': 'application/json',
2727
'Authorization': 'Bearer your_admin_token',
28-
'New-Api-User': 'Bearer your_user_id'
28+
'New-Api-User': 'your_user_id'
2929
}
3030
});
3131
const data = await response.json();

docs/api/fei-log.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const response = await fetch('/api/log/self/stat?type=2&start_timestamp=16409088
8080
headers: {
8181
'Content-Type': 'application/json',
8282
'Authorization': 'Bearer your_user_token',
83-
'New-Api-User': 'Bearer your_user_id'
83+
'New-Api-User': 'your_user_id'
8484
}
8585
});
8686
const data = await response.json();
@@ -137,7 +137,7 @@ const response = await fetch('/api/log/self?p=1&page_size=20&type=2&start_timest
137137
headers: {
138138
'Content-Type': 'application/json',
139139
'Authorization': 'Bearer your_user_token',
140-
'New-Api-User': 'Bearer your_user_id'
140+
'New-Api-User': 'your_user_id'
141141
}
142142
});
143143
const data = await response.json();
@@ -200,7 +200,7 @@ const response = await fetch('/api/log/self/search?keyword=gpt-4', {
200200
headers: {
201201
'Content-Type': 'application/json',
202202
'Authorization': 'Bearer your_user_token',
203-
'New-Api-User': 'Bearer your_user_id'
203+
'New-Api-User': 'your_user_id'
204204
}
205205
});
206206
const data = await response.json();
@@ -255,7 +255,7 @@ const response = await fetch('/api/log/?p=1&page_size=20&type=2&start_timestamp=
255255
headers: {
256256
'Content-Type': 'application/json',
257257
'Authorization': 'Bearer your_admin_token',
258-
'New-Api-User': 'Bearer your_user_id'
258+
'New-Api-User': 'your_user_id'
259259
}
260260
});
261261
const data = await response.json();
@@ -336,7 +336,7 @@ const response = await fetch('/api/log/?target_timestamp=1640908800', {
336336
headers: {
337337
'Content-Type': 'application/json',
338338
'Authorization': 'Bearer your_admin_token',
339-
'New-Api-User': 'Bearer your_user_id'
339+
'New-Api-User': 'your_user_id'
340340
}
341341
});
342342
const data = await response.json();
@@ -382,7 +382,7 @@ const response = await fetch('/api/log/stat?type=2&start_timestamp=1640908800&en
382382
headers: {
383383
'Content-Type': 'application/json',
384384
'Authorization': 'Bearer your_admin_token',
385-
'New-Api-User': 'Bearer your_user_id'
385+
'New-Api-User': 'your_user_id'
386386
}
387387
});
388388
const data = await response.json();
@@ -434,7 +434,7 @@ const response = await fetch('/api/log/search?keyword=error', {
434434
headers: {
435435
'Content-Type': 'application/json',
436436
'Authorization': 'Bearer your_admin_token',
437-
'New-Api-User': 'Bearer your_user_id'
437+
'New-Api-User': 'your_user_id'
438438
}
439439
});
440440
const data = await response.json();

docs/api/fei-midjourney-task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const response = await fetch('/api/mj/self?p=1&page_size=20&mj_id=task123&start_
2525
headers: {
2626
'Content-Type': 'application/json',
2727
'Authorization': 'Bearer your_user_token',
28-
'New-Api-User': 'Bearer your_user_id'
28+
'New-Api-User': 'your_user_id'
2929
}
3030
});
3131
const data = await response.json();
@@ -116,7 +116,7 @@ const response = await fetch('/api/mj/?p=1&page_size=20&channel_id=1&mj_id=task1
116116
headers: {
117117
'Content-Type': 'application/json',
118118
'Authorization': 'Bearer your_admin_token',
119-
'New-Api-User': 'Bearer your_user_id'
119+
'New-Api-User': 'your_user_id'
120120
}
121121
});
122122
const data = await response.json();

docs/api/fei-model-rate-sync.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const response = await fetch('/api/ratio_sync/channels', {
2626
headers: {
2727
'Content-Type': 'application/json',
2828
'Authorization': 'Bearer your_root_token',
29-
'New-Api-User': 'Bearer your_user_id'
29+
'New-Api-User': 'your_user_id'
3030
}
3131
});
3232
const data = await response.json();
@@ -94,7 +94,7 @@ const response = await fetch('/api/ratio_sync/fetch', {
9494
headers: {
9595
'Content-Type': 'application/json',
9696
'Authorization': 'Bearer your_root_token',
97-
'New-Api-User': 'Bearer your_user_id'
97+
'New-Api-User': 'your_user_id'
9898
},
9999
body: JSON.stringify({
100100
channel_ids: [1, 2, -100],
@@ -112,7 +112,7 @@ const response = await fetch('/api/ratio_sync/fetch', {
112112
headers: {
113113
'Content-Type': 'application/json',
114114
'Authorization': 'Bearer your_root_token',
115-
'New-Api-User': 'Bearer your_user_id'
115+
'New-Api-User': 'your_user_id'
116116
},
117117
body: JSON.stringify({
118118
upstreams: [

docs/api/fei-public-info.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const response = await fetch('/api/pricing', {
213213
headers: {
214214
'Content-Type': 'application/json',
215215
'Authorization': 'Bearer your_token', // 可选,登录用户可获得更详细信息
216-
'New-Api-User': 'Bearer your_user_id' // 可选
216+
'New-Api-User': 'your_user_id' // 可选
217217
}
218218
});
219219
const data = await response.json();
@@ -312,7 +312,7 @@ const response = await fetch('/api/models', {
312312
headers: {
313313
'Content-Type': 'application/json',
314314
'Authorization': 'Bearer your_user_token',
315-
'New-Api-User': 'Bearer your_user_id'
315+
'New-Api-User': 'your_user_id'
316316
}
317317
});
318318
const data = await response.json();

0 commit comments

Comments
 (0)