Please check the API documentation https://openai-proxy.apifox.cn
openai-proxy is a solution for Chinese users. The problems that can help you solve are:
Now you just need to replace https://api.openai.com with https://openai.aihey.cc/openai to eat
# openai api
curl https://api.openai.com/v1/chat/completions
-H " Content-Type: application/json "
-H " Authorization: Bearer $OPENAI_API_KEY "
-d ' {
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
} '
# 替换后
curl https://openai.aihey.cc/openai/v1/chat/completions
-H " Content-Type: application/json "
-H " Authorization: Bearer $OPENAI_API_KEY "
-d ' {
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
} ' Since April 2023,
https://api.openai.com/dashboard/billing/credit_grantscan only be requested through the session id generated by the web login, and the key (sk-*****) method will be invalid. However, you can request it in two ways .
openai-proxyshortcoming:
# 指定统计开始日期和结束日期
curl https://openai.aihey.cc/openai/billing/credit_grants ? start_date=2022-05-10 & end_date=2023-05-10
-H " Content-Type: application/json "
-H " Authorization: Bearer sk-*********** "
# 不指定参数,默认统计最近 90 天的数据
curl https://openai.aihey.cc/openai/billing/credit_grants
-H " Content-Type: application/json "
-H " Authorization: Bearer sk-********** "sensitive_id generated by the web pageshortcoming:
sensitive_id will be relatively long)docker run -itd --name openai-proxy -p 13000:3000 unickcheng/openai-proxy
# 查看服务
docker ps -a If you are familiar with docker compose, you can refer to the docker-compose.yml file and use docker compose up -d command to start the service
No, but don't let go of your vigilance . There are also many excellent products of similar open source on the market, and they will not maliciously steal the user's key. Unfortunately, this does not mean everything. Therefore, when using third-party platforms products, try to use a regularly updated key .
If you have the conditions, it is recommended to refer to the previous content to deploy it yourself. If you encounter any problems, you can ask questions in Issues.
Because I wanted to get started with Next.js, I had this project.
In addition, here is just a solution, which has not improved much for API request speed. You need to provide additional domain names by yourself, which seems to be troublesome.
