ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

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

Open wengyk opened this issue 9 months ago • 18 comments

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" }

wengyk avatar May 09 '24 00:05 wengyk

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

hu19940121 avatar May 09 '24 03:05 hu19940121

have the same error in docker

it started well

Starting the application...
2024-05-09 15:16:34 
2024-05-09 15:16:34 > [email protected] 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

goga2k avatar May 09 '24 12:05 goga2k

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

pqnhan avatar May 10 '24 16:05 pqnhan

I have the same problem.

dianavintila avatar May 10 '24 17:05 dianavintila

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

ocdevcn avatar May 10 '24 22:05 ocdevcn

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 avatar May 10 '24 23:05 pqnhan

Works as expected image

pqnhan avatar May 10 '24 23:05 pqnhan

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

ocdevcn avatar May 11 '24 00:05 ocdevcn

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

vermilion-bird avatar May 13 '24 09:05 vermilion-bird

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 avatar May 14 '24 01:05 pqnhan

@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.

pqnhan avatar May 14 '24 01:05 pqnhan

@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.

navhub007 avatar May 14 '24 02:05 navhub007

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
  }'

pqnhan avatar May 14 '24 02:05 pqnhan

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

9xcoder avatar May 15 '24 10:05 9xcoder

seems it does NOT work for me

jackiezhangcn avatar May 16 '24 07:05 jackiezhangcn

The same problem, have any updates ?

Aldans avatar May 26 '24 22:05 Aldans

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

Meelee35 avatar Jun 18 '24 20:06 Meelee35

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

VON0000 avatar Aug 09 '24 02:08 VON0000