go+docker转发OpenAI的API接口,部署在海外服务器即可对https://api.openai.com进行代理,支持stream流。
可以配置(点击配置文件路径):
- 是否打印请求参数,默认值:false
- 转发目标地址,默认值:https://api.openai.com
- 需要转发的路径列表(多个可用|分割),默认值:/v1/chat/completions
docker run -d \
--name forward_openai \
-p 8080:8080 \
-e sg.forward_openai.printParam=false \
-e sg.forward_openai.targetHost="https://api.openai.com" \
-e sg.forward_openai.forwardPathList="/v1/chat/completions" \
--restart=always \
--pull=always \
samge/forward_openai:latest
将原来的https://api.openai.com
改为http://yourIpAddr:8080
即可
go run main.go
- Join Discord >>
- WeChat:
SamgeApp