acheong08 / ChatGPT-to-API

Scalable unofficial ChatGPT API for production.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

{"error":"error sending request"},Docker-Compose配置、反向代理均正常

ventusoon opened this issue · comments

commented

Docker-Compose配置如下

version: '3'

services:
  app:
    image: acheong08/chatgpt-to-api
    container_name: chatgpttoapi
    restart: unless-stopped
    ports:
      - '8081:8081'
    environment:
      SERVER_HOST: 0.0.0.0
      SERVER_PORT: 8081
      ADMIN_PASSWORD: TotallySecurePassword
      API_REVERSE_PROXY: http://127.0.0.1:6789/chatgpt/backend-api/conversation
      PUID: user-oQxkKBxxxxxxxxxxRJ3Xq

以上反代地址,为linweiyuan/go-chatgpt-api项目搭建,正常使用。
接着,
按照使用文档配置,通过使用

curl http://127.0.0.1:8081/v1/chat/completions \
  -d '{
     "model": "text-davinci-002-render-sha",
     "messages": [{"role": "user", "content": "你是什么模型,是GPT3.5吗"}]
   }'

输出

{"error":"error sending request"}

无法获取APIkey,通过提交token依然显示如此

网页访问http://127.0.0.1:8081/v1/chat/completions,显示404