Closed lyf61 closed 1 year ago
Can you share the full request you are passing in?
I am also getting this error (macOS); running the openai-quickstart-node codebase with no modification
Relevant request in my case is this part of the try block
try { const response = await fetch("/api/generate", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ animal: animalInput }), });
Interestingly, I have my own code that uses a POST request and doesn't trigger the 403 error; there shouldn't really be any difference and I would expect the official quickstart to work out of the box
I am also getting the same error, but while testing in postman it just works fine
here is my code
Note : I also tried using https instead http
`import 'dart:convert';
import 'package:chatgpt/constants/api_consts.dart'; import 'package:http/http.dart' as http;
class ApiService {
static Future
Map jsonResponse = jsonDecode(response.body);
print("response $jsonResponse");
} catch (error) {
print("error $error");
}
} } `
hey in the morning i was also getting the same issue, but now it is resolve the issue had came because of my silly mistake
here is my solution @lyf61
solve this just removing the slash from the like
"https://api.openai.com/v1/"; ----> "https://api.openai.com/v1";
you can close this sir @logankilpatrick
problem solved after i turn off VPN.
problem solved after i turn off VPN.
lol
i dont use vpn and my error look like html
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<center>
<h1>403 Forbidden</h1>
</center>
<hr>
<center>cloudflare</center>
</body>
</html>
Describe the bug
request header Request URL: http://localhost:3000/api/generate Request Method: POST Status Code: 403 Forbidden
response {"error":{"message":"The OpenAI API can only be accessed over HTTPS. You should access https://api.openai.com rather than the current URL.","type":"invalid_request_error"}}
To Reproduce
the alert showed after clicked on the Generate names button
OS
macOS
Node version
v14.18.1