PawanOsman / ChatGPT

OpenAI API Free Reverse Proxy
https://discord.pawan.krd
GNU Affero General Public License v3.0
5.49k stars 978 forks source link

The requested endpoint (GET /v1/chat/completions) was not found #129

Closed wengyk closed 2 weeks ago

wengyk commented 4 months ago

I run "docker run -dp 3040:3040 pawanosman/chatgpt:latest", then open "http://localhost:3040/v1/chat/completions" in chromium. The following error message appears on the web page:

{ "status": false, "error": { "message": "The requested endpoint (GET /v1/chat/completions) was not found. please make sure to use \"http://localhost:3040/v1\" as the base URL.", "type": "invalid_request_error" }, "support": "https://discord.pawan.krd" }

hu19940121 commented 4 months ago

If you open it directly in the browser, the request method is GET. You should use POST method to request this api.

goga2k commented 4 months ago

have the same error in docker

it started well

Starting the application...
2024-05-09 15:16:34 
2024-05-09 15:16:34 > chatgpt@1.0.0 start
2024-05-09 15:16:34 > tsc && node dist/app.js
2024-05-09 15:16:34 
2024-05-09 15:16:47 💡 Server is running at http://localhost:3040
2024-05-09 15:16:47 
2024-05-09 15:16:47 🔗 Local Base URL: http://localhost:3040/v1
2024-05-09 15:16:47 🔗 Local Endpoint: http://localhost:3040/v1/chat/completions
2024-05-09 15:16:47 
2024-05-09 15:16:47 🔗 Public Base URL: https://removed-governor-default-bits.trycloudflare.com/v1
2024-05-09 15:16:47 🔗 Public Endpoint: https://removed-governor-default-bits.trycloudflare.com/v1/chat/completions
2024-05-09 15:16:47 
2024-05-09 15:16:47 📝 Author: Pawan.Krd
2024-05-09 15:16:47 🌐 Discord server: https://discord.gg/pawan
2024-05-09 15:16:47 🌍 GitHub Repository: https://github.com/PawanOsman/ChatGPT
2024-05-09 15:16:47 💖 Don't forget to star the repository if you like this project!

but then I get an error: {"status":false,"error":{"message":"The requested endpoint (GET /v1/chat/completions) was not found. please make sure to use \"http://localhost:3040/v1\" as the base URL.","type":"invalid_request_error"},"support":"https://discord.pawan.krd"}

add an additional slash to the end of the base URL doesn't work

also tried to use to "http://localhost:3040/v1/chat/completions" instead of "http://localhost:3040/v1\chat/completions" - all result in the same error,

I've already tried use "http://localhost:3040/v1/" and "http://localhost:3040/v1\" - same error

i even tried to use the direct ip link,instead of localhost and get the same error, doesn't work anyway

pqnhan commented 3 months ago

For me, it's the same. Besides..

dianavintila commented 3 months ago

I have the same problem.

ocdevcn commented 3 months ago

散了吧,这玩意来不起,无论哪种方式都不行,除非能看到一篇可行的方案。

pqnhan commented 3 months ago

Gotchas, you will need "clean" IP address to use this. I've first tried on AWS but failed. But now, it's worked.

image

pqnhan commented 3 months ago

Works as expected image

ocdevcn commented 3 months ago

Which deployment method did you use successfully? Where can the resulting API work? Thanks

vermilion-bird commented 3 months ago

Gotchas, you will need "clean" IP address to use this. I've first tried on AWS but failed. But now, it's worked.

image

Gotchas, you will need "clean" IP address to use this. I've first tried on AWS but failed. But now, it's worked.

image

Gotchas, you will need "clean" IP address to use this. I've first tried on AWS but failed. But now, it's worked.

image

Did you mean the IP forbidden by OpenAI? Does the local network work? thx

pqnhan commented 3 months ago

Which deployment method did you use successfully? Where can the resulting API work? Thanks

https://github.com/PawanOsman/ChatGPT/tree/main/docker-compose and https://github.com/PawanOsman/ChatGPT?tab=readme-ov-file#using-docker all work.

pqnhan commented 3 months ago

@ocdevcn @CodeDevNinja

Cause ChatGPT uses CloudFlare, you need a "clean" IP address that doesn't fall into their filters. They banned IPs from most cloud services, and sometime is resident IP addresses (also maybe some countries or regions, idk)

Hmm, basically, this project exploits ChatGPT web public session (non-login session), which is basically fragile. If logging user sessions tokens can be used, may it'll be more stable.

navhub007 commented 3 months ago

@ocdevcn @CodeDevNinja

Cause ChatGPT uses CloudFlare, you need a "clean" IP address that doesn't fall into their filters. They banned IPs from most cloud services, and sometime is resident IP addresses (also maybe some countries or regions, idk)

Hmm, basically, this project exploits ChatGPT web public session (non-login session), which is basically fragile. If logging user sessions tokens can be used, may it'll be more stable.

Thank you very much for answering my confusion. I think I should try more. I did use the computer room IP, but the IP I used can access https://chatgpt.com/ normally.

pqnhan commented 3 months ago

Thank you very much for answering my confusion. I think I should try more. I did use the computer room IP, but the IP I used can access chatgpt.com normally.

Have you tried calling a POST Request to your own API Endpoint (http://127.0.0.1:3040/v1/chat/completions)?

Direct access from web browsers will not work because they use GET Request. If you use a home network, you can try resetting the router to get a new public IP address and try again.

Cloudflare uses many different criteria to scan and filter requests that it considers "robotic".

curl http://127.0.0.1:3040/v1/chat/completions \
  -i -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "stream": true
  }'
9xcoder commented 3 months ago

Thank you very much for answering my confusion. I think I should try more. I did use the computer room IP, but the IP I used can access chatgpt.com normally.

Have you tried calling a POST Request to your own API Endpoint (http://127.0.0.1:3040/v1/chat/completions)?

Direct access from web browsers will not work because they use GET Request. If you use a home network, you can try resetting the router to get a new public IP address and try again.

Cloudflare uses many different criteria to scan and filter requests that it considers "robotic".

curl http://127.0.0.1:3040/v1/chat/completions \
  -i -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "stream": true
  }'

I have same issue when call from curl I am using docker to run this project image

jackiezhangcn commented 3 months ago

seems it does NOT work for me

Aldans commented 3 months ago

The same problem, have any updates ?

Meelee35 commented 2 months ago

you need to send a post request. This has already been said here why's everyone ignoring them?

VON0000 commented 4 weeks ago

I have tried POST request

curl --max-time 10 http://127.0.0.1:3040/v1/chat/completions \
-i -X POST \
-H "Content-Type: application/json" \
-d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "stream": true
  }'

but it shows

curl: (28) Operation timed out after 10000 milliseconds with 0 bytes received