acheong08 / ChatGPT-to-API

Scalable unofficial ChatGPT API for production.
1.11k stars 371 forks source link

Does this package call https://github.com/acheong08/ChatGPT-Proxy-V4 under the hood? #80

Open hongyi-zhao opened 1 year ago

hongyi-zhao commented 1 year ago

IMO, the following two packages are wonderful and key tools when working with OpenAI API:

https://github.com/acheong08/ChatGPT-to-API https://github.com/acheong08/ChatGPT-Proxy-V4

So, I want to know if the ChatGPT-TO-API calls ChatGPT-PROXY-V4 in the background to further simplify the access workflow?

acheong08 commented 1 year ago

It doesn't.

You can tell it to by setting API_REVERSE_PROXY="https://bypass.churchless.tech/conversation" or something like that

hongyi-zhao commented 1 year ago
  1. Do you mean that all the endpoints exposed under the domain churchless.tech are constructed based on https://github.com/acheong08/ChatGPT-Proxy-V4?
  2. What is the difference between the following endpoints?

https://bypass.churchless.tech/conversation https://free.churchless.tech/v1/chat/completions

  1. In addition, are there still other endpoints exposed in the domain churchless.tech?

See https://github.com/binary-husky/gpt_academic/issues/900#issuecomment-1615961556 for the related discussion.

acheong08 commented 1 year ago

Do you mean that all the endpoints exposed under the domain churchless.tech are constructed based on https://github.com/acheong08/ChatGPT-Proxy-V4?

No. The bypass endpoint can be used if your IP is banned by Cloudflare/OpenAI

What is the difference between the following endpoints?

Bypass: Gets around cloudflare. API format is identical to chat.openai.com

Free: Gets around cloudflare and makes the API format identical to api.openai.com

hongyi-zhao commented 1 year ago

Bypass: Gets around cloudflare. API format is identical to chat.openai.com

If I understand correctly, the endpoint of this method is only applicable to applications that are compatible with web-based access, aka, without using API key.

For example, the https://github.com/binary-husky/gpt_academic works based on the API key, so the Bypass endpoint cannot be used directly with it, while the Free endpoint does, as you have commented here.

acheong08 commented 1 year ago

For example, the https://github.com/binary-husky/gpt_academic works based on the API key, so the Bypass endpoint cannot be used directly with it, while the Free endpoint does, as you have commented https://github.com/binary-husky/gpt_academic/issues/900#issuecomment-1615961556.

It's not a matter of whether it uses API key or not. The difference is in the API response format:

{"id":"chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK","object":"chat.completion","created":0,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0},"choices":[{"index":0,"message":{"role":"assistant","content":"1"},"finish_reason":null}]}

vs


{"message": {"id": "787e1451-6c7d-4a07-bf33-16a99ec51755", "author": {"role": "assistant", 
"name": null, "metadata": {}}, "create_time": 1688381993.772501, "update_time": null, 
"content": {"content_type": "text", "parts": ["Hello! How can I assist you today?\n"]}, 
"status": "finished_successfully", "end_turn": true, "weight": 1.0, "metadata": 
{"message_type": "next", "model_slug": "gpt-4", "finish_details": {"type": "stop", "stop": 
"<|diff_marker|>"}}, "recipient": "all"}, "conversation_id": 
"c6639e58-2ebc-470e-a57e-d68ec5dcce0d", "error": null}
hongyi-zhao commented 1 year ago

Why did the returned content, aka, ["Hello! How can I assist you today?"], not appear in the former response?

acheong08 commented 1 year ago

Oh. It was a different prompt

acheong08 commented 1 year ago

The response was "1"

hongyi-zhao commented 1 year ago

The response was "1"

I see.

But how can I use https://bypass.churchless.tech/conversation as the endpoint of https://github.com/binary-husky/gpt_academic, as what you have commented here?

acheong08 commented 1 year ago

cant