Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the reverse proxy based OpenAI access via https://github.com/acheong08/ChatGPT-to-API/. #1014

Merged
merged 21 commits into from
Aug 13, 2023

Conversation

hongyi-zhao
Copy link
Collaborator

The PR try to fix the reverse proxy based OpenAI access via https://github.com/acheong08/ChatGPT-to-API/.
See #900 (comment) for more detailed discussions.

@binary-husky binary-husky merged commit aaf4f37 into binary-husky:master Aug 13, 2023
@hongyi-zhao
Copy link
Collaborator Author

hongyi-zhao commented Aug 17, 2023

测试成功,用法如下:

  1. 基于chatgpt-to-api:
    image

  2. 基于 go-chatgpt-api :

如下修改即可,其他不变:

# 启动反代:
werner@X10DAi:~/Public/repo/github.com/linweiyuan/go-chatgpt-api.git$ PORT=18080 TZ=Asia/Shanghai PROXY=socks5://127.0.0.1:18890 OPENAI_EMAIL="username" OPENAI_PASSWORD="password" IMITATE_ACCESS_TOKEN=$(grep -o '"[^"]*"' ~/Public/repo/github.com/acheong08/ChatGPT-to-API.git/access_tokens.json | sed -n '2p' | cut -d '"' -f 2) ./go-chatgpt-api

# 调用方法:
API_URL_REDIRECT='{"https://api.openai.com/v1/chat/completions": "http://127.0.0.1:18080/imitate/v1/chat/completions"}'

See below for the related description and discussion:

https://github.com/binary-husky/gpt_academic/wiki/%E7%AC%AC%E4%B8%89%E6%96%B9API%E2%80%90KEY%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97#%E4%BE%8B%E5%AD%901-%E7%AC%AC%E4%B8%89%E6%96%B9%E6%8E%A5%E5%8F%A3api2d

linweiyuan/go-chatgpt-api#236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants