sk-vQLrRRnZebySrwboicmoT3BlbkFJmse7rnrXvYUUOTrFgELNsk-y4klImSZ7MCKne4eEwnDT3BlbkFJUTLdNm4f78t9opeZY9NK

同时推荐一下一个国内比较稳定的代理

#查询余额curl https://api.openai-proxy.com/pro/balance?apiKey=sk-XXX | jq

Python代码也可以查询

import requestsimport jsondef get_balance(api_key):url = "https://api.openai-proxy.com/pro/balance"params = {'apiKey': api_key}response = requests.get(url, params=params)json_data = json.loads(response.text)if 'data' in json_data:data = json_data['data']return {"total": data['total'], "balance": data['balance'], "used": data['used']}else:return Noneapi_key = input("请输入 OpenAI API 密钥:")balance = get_balance(api_key)if balance is not None:print("当前账户: 总共=${}, 剩余=${:.2f}, 已使用=${}".format(balance['total'], balance['balance'], balance['used']))else:print("发生错误:无法获取账户余额")

docker部署

docker run -d \--name chatgpt-web \-p :3002:3002 \-e OPENAI_API_KEY=sk-xxxx \-e OPENAI_API_BASE_URL=https://api.openai-proxy.com \images:xxx

k8s部署

apiVersion: v1kind: ConfigMapmetadata:name: chatgpt-configdata:OPENAI_API_KEY: "sk-xxxx"OPENAI_API_BASE_URL: "https://api.openai-proxy.com"---apiVersion: apps/v1kind: Deploymentmetadata:name: chatgpt-deploymentspec:selector:matchLabels:app: chatgptreplicas: 1template:metadata:labels:app: chatgptspec:containers:- name: chatgptimage: xxxximagePullPolicy: Neverports:- containerPort: 3002envFrom:- configMapRef:name: chatgpt-configvolumeMounts:# 挂载 SSL 证书- name: tls-certsmountPath: /etc/ssl/certs/ca-certificates.crtreadOnly: truevolumes:- name: tls-certsconfigMap:name: tls-certs---apiVersion: v1kind: Servicemetadata:name: chatgpt-servicespec:selector:app: chatgptports:- name: webport: 3002targetPort: 3002nodePort: 3002type: NodePort

不在需要翻墙本地访问就可以了