Skip to content

Commit 8bbb6f2

Browse files
committed
docs: update
1 parent 06088eb commit 8bbb6f2

File tree

4 files changed

+29
-140
lines changed

4 files changed

+29
-140
lines changed

README.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ https://openai.451024.xyz
1010
```
1111

1212

13-
~~https://openai.1rmb.tk~~
14-
15-
1613
```url
1714
https://openai-proxy-api.pages.dev/api
1815
```
@@ -26,24 +23,11 @@ https://openai-proxy-api.pages.dev/api
2623

2724
![worker](./docs/img/worker.png)
2825

29-
## 1、利用Cloudflare Worker中转api.openai.com
30-
31-
1. 新建一个 Cloudflare Worker
32-
2. 复制 [cf_worker.js](https://cdn.jsdelivr.net/gh/x-dr/chatgptProxyAPI@main/cf_worker.js) 里的代码粘贴到 Worker 中并部署
33-
3. 给 Worker 绑定一个没有被墙的域名
34-
4. 使用自己的域名代替 api.openai.com
35-
36-
37-
**[详细教程](./docs/cloudflare_workers.md)**
38-
3926

40-
## 2、使用CloudFlare Pages进行中转
4127

42-
**[详细教程](./docs/cloudflare_proxy_pages.md)**
28+
## 使用CloudFlare Pages进行中转
4329

44-
## 3、利用nextjs edge中转api.openai.com
45-
46-
### 利用Cloudflare pages部署
30+
### 1、部署中转API+ Openai API余额查询
4731

4832
> [官方文档](https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/)
4933
@@ -59,10 +43,33 @@ https://openai-proxy-api.pages.dev/api
5943
> 把官方接口的`https://api.openai.com`替换为`https://xxx.pages.dev` 即可
6044
6145

62-
6346
**[详细教程](./docs/cloudflare_pages.md)**
6447

65-
### docker 部署(要境外vps)
48+
49+
### 2、只部署中转API
50+
51+
52+
**[详细教程](./docs/cloudflare_proxy_pages.md)**
53+
54+
***
55+
56+
57+
## 利用Cloudflare Worker中转api.openai.com
58+
59+
1. 新建一个 Cloudflare Worker
60+
2. 复制 [cf_worker.js](https://cdn.jsdelivr.net/gh/x-dr/chatgptProxyAPI@main/cf_worker.js) 里的代码粘贴到 Worker 中并部署
61+
3. 给 Worker 绑定一个没有被墙的域名
62+
4. 使用自己的域名代替 api.openai.com
63+
64+
65+
**[详细教程](./docs/cloudflare_workers.md)**
66+
67+
68+
69+
70+
71+
72+
## docker 部署(要境外vps)
6673

6774
> 好像不支持sse 所以不建议
6875

assets/css/style.css

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -82,120 +82,7 @@ body {}
8282
padding-left: 15px
8383
}
8484

85-
/* pre {
86-
display: block;
87-
padding: 10px;
88-
margin: 0 0 10.5px;
89-
font-size: 14px;
90-
line-height: 1.42857143;
91-
word-break: break-all;
92-
word-wrap: break-word;
93-
color: #333;
94-
background-color: #f5f5f5;
95-
border: 1px solid #ccc;
96-
border-radius: 0
97-
}
9885

99-
code {
100-
font-size: 80%
101-
}
102-
103-
#uploadconfig {
104-
border-radius: 5px;
105-
border: 1px solid #ddd;
106-
padding: 10px;
107-
width: 100%;
108-
margin-bottom: 5px
109-
}
110-
111-
.panel-heading-sm {
112-
height: 28px;
113-
padding: 5px 10px
114-
}
115-
116-
.panel-body-sm {
117-
padding: 5px 10px
118-
}
119-
120-
.file-preview-thumbnails {
121-
max-height: 1000px;
122-
overflow: overlay
123-
}
124-
125-
fieldset {
126-
border: 1px solid rgba(0, 0, 0, .125);
127-
padding: 15px 20px;
128-
}
129-
130-
legend {
131-
font-size: 14px;
132-
font-weight: 700;
133-
color: #232323;
134-
padding-left: 8px;
135-
padding-right: 8px;
136-
margin-bottom: 0;
137-
border-bottom: 0;
138-
width: inherit
139-
}
140-
141-
fieldset legend img {
142-
vertical-align: middle;
143-
line-height: 16px;
144-
height: 16px;
145-
padding-right: 5px
146-
}
147-
148-
.padding10 {
149-
padding-left: 10px
150-
}
151-
152-
.tab-content {
153-
border-left: 1px solid #ddd;
154-
border-right: 1px solid #ddd
155-
}
156-
157-
.dlinput_header {
158-
font-size: 11px;
159-
margin-top: 10px
160-
}
161-
162-
.accepr_box {
163-
margin-bottom: 130px
164-
}
165-
166-
.content-box {
167-
background-color: #c4e3ff;
168-
padding: 10px;
169-
margin-top: 20px;
170-
border: 1px solid #a6cef3;
171-
border-radius: 3px;
172-
padding: 10px 20px
173-
}
174-
175-
.content-box::before {
176-
font-size: 100px
177-
}
178-
179-
.content-box span {
180-
padding: 5px;
181-
margin-right: 20px;
182-
color: #2b557c
183-
}
184-
185-
.content-box a {
186-
color: #155724;
187-
background-color: #90caff;
188-
border-radius: 3px;
189-
margin: 0 5px;
190-
font-size: 14px;
191-
padding: 2px 9px;
192-
text-decoration: none;
193-
transition: .3s all ease
194-
}
195-
196-
.content-box a:hover {
197-
background-color: #78bfff
198-
} */
19986

20087

20188
.fixed-top {
@@ -206,11 +93,6 @@ fieldset legend img {
20693
}
20794

20895

209-
/* main {
210-
padding-left: 2rem;
211-
padding-right: 2rem;
212-
} */
213-
21496
main[x-cloak] {
21597
opacity: 0;
21698
}

assets/js/openai.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const app = {
122122
//总
123123
const total_granted = subscription.hard_limit_usd;
124124
//已用
125-
const total_used = usageData.total_usage / 100
125+
const total_used = usageData.total_usage / 100 || -1
126126
//剩余额度
127127
const total_available = total_granted - total_used;
128128

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<div class="page-header" x-data="{ origin: '' }" x-init="origin = window.location.origin">
4242
<h2>查询 OpenaiAPI 余额</h2>
4343
<p>API接口: <span class="proxy" x-text="origin" @click="copyToClipboard(origin)"></span>
44-
;支持批量查询,一行一个;点击清理可以清理失效的key</p>
44+
;支持批量查询,一行一个;点击清理可以清理失效的key。 (已用额度是-1时该key查询失败)</p>
4545
</div>
4646
<main x-data="app" x-cloak>
4747
<p x-show.transition.opacity="alert" :class="alert?.type" x-text="alert?.message"></p>

0 commit comments

Comments
 (0)