Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou26 committed Apr 5, 2024
1 parent 49be8e2 commit 640f6c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/chatgpt/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
)

func getWSURL(token string, retry int) (string, error) {
request, err := http.NewRequest(http.MethodPost, "https://chat.openai.com/backend-api/register-websocket", nil)
request, err := http.NewRequest(http.MethodPost, "https://chat.openai.com/backend-anon/register-websocket", nil)
if err != nil {
return "", err
}
Expand Down Expand Up @@ -242,7 +242,7 @@ func POSTTurnStile(secret *tokens.Secret, proxy string) (*http.Response, error)
if proxy != "" {
client.SetProxy(proxy)
}
apiUrl := "https://chat.openai.com/backend-api/sentinel/chat-requirements"
apiUrl := "https://chat.openai.com/backend-anon/sentinel/chat-requirements"
payload := strings.NewReader(`{"conversation_mode_kind":"primary_assistant"}`)
request, err := http.NewRequest(http.MethodPost, apiUrl, payload)
if err != nil {
Expand Down Expand Up @@ -275,7 +275,7 @@ type urlAttr struct {
}

func getURLAttribution(access_token string, puid string, url string) string {
request, err := http.NewRequest(http.MethodPost, "https://chat.openai.com/backend-api/attributions", bytes.NewBuffer([]byte(`{"urls":["`+url+`"]}`)))
request, err := http.NewRequest(http.MethodPost, "https://chat.openai.com/backend-anon/attributions", bytes.NewBuffer([]byte(`{"urls":["`+url+`"]}`)))
if err != nil {
return ""
}
Expand Down Expand Up @@ -310,7 +310,7 @@ func POSTconversation(message chatgpt_types.ChatGPTRequest, secret *tokens.Secre
if proxy != "" {
client.SetProxy(proxy)
}
apiUrl := "https://chat.openai.com/backend-api/conversation"
apiUrl := "https://chat.openai.com/backend-anon/conversation"
if API_REVERSE_PROXY != "" {
apiUrl = API_REVERSE_PROXY
}
Expand Down Expand Up @@ -379,7 +379,7 @@ func GETengines(secret *tokens.Secret, proxy string) (*EnginesData, int, error)
if proxy != "" {
client.SetProxy(proxy)
}
reqUrl := "https://chat.openai.com/backend-api/models"
reqUrl := "https://chat.openai.com/backend-anon/models"
req, _ := http.NewRequest("GET", reqUrl, nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("User-Agent", userAgent)
Expand Down Expand Up @@ -651,7 +651,7 @@ func Handler(c *gin.Context, response *http.Response, secret *tokens.Secret, uui
continue
}
if original_response.Message.Content.ContentType == "multimodal_text" {
apiUrl := "https://chat.openai.com/backend-api/files/"
apiUrl := "https://chat.openai.com/backend-anon/files/"
if FILES_REVERSE_PROXY != "" {
apiUrl = FILES_REVERSE_PROXY
}
Expand Down

0 comments on commit 640f6c5

Please sign in to comment.